URL显示目录列表而不是网站

时间:2015-06-10 09:30:45

标签: apache .htaccess centos6 virtual-hosts

我的VPS包含多个以centos格式托管的域名。以下是我的httpd.conf

        NameVirtualHost *:80
        NameVirtualHost *:443

        <Directory "/var/www/html">
         Options +FollowSymLinks
         AllowOverride All
         Order allow,deny
         Allow from all
        </Directory>


        <VirtualHost *:80>
            ServerAdmin vijay@abc.in
            DocumentRoot /var/www/html/abc.in
            ServerName abc.in
            ServerAlias abc.in
            ErrorLog logs/abc-error_log
            CustomLog logs/abc-access_log common
        </VirtualHost>

        <VirtualHost *:443>
            ServerAdmin vijay@abc.in
            DirectoryIndex index.php
            DocumentRoot "/var/www/html/abc.in"
            ServerName www.abc.in
            ServerAlias abc.in
         ErrorLog logs/abc.in-error_log
            CustomLog logs/abc.in-access_log common
            ServerAlias abc.in
          <Directory "/var/www/html/abc.in">
            Options Indexes FollowSymLinks
            AllowOverride all
            Order allow,deny
            Allow from all
        </Directory>
        </VirtualHost>

        <VirtualHost *:80>
            ServerAdmin vijay@abc.in
            DocumentRoot /var/www/html/blog
            ServerName blog.abc.in
            ErrorLog logs/blog-error_log
            CustomLog logs/blog-access_log common

        <Directory "/var/www/html/blog">
            Options Indexes FollowSymLinks MultiViews Includes
            AllowOverride All
            Order allow,deny
            Allow from all
        </Directory>

        </VirtualHost>
        <VirtualHost *:80>
            ServerAdmin vijay@abc.in
            DocumentRoot /var/www/html/domain1
            ServerName domain1.abc.in
            ErrorLog logs/ped-error_log
            CustomLog logs/ped-access_log common

        <Directory "/var/www/html/domain1">
            Options Indexes FollowSymLinks MultiViews Includes
            AllowOverride All
            Order allow,deny
            Allow from all
        </Directory>

        </VirtualHost>

         <VirtualHost *:80>
            ServerAdmin vijay@abc.in
            DocumentRoot /var/www/html/domain2
            ServerName domain2.com
            ServerAlias www.domain2.com
            ErrorLog logs/domain2-error_log
            CustomLog logs/domain2-access_log common
        <Directory "/var/www/html/domain2">
            Options Indexes FollowSymLinks
            AllowOverride All
            Order allow,deny
            Allow from all
        </Directory>

        </VirtualHost>


        <VirtualHost *:80>
            ServerAdmin vijay@abc.in
            DocumentRoot /var/www/html/domain3
            ServerName domain3.co
            ServerAlias www.domain3.co
            ErrorLog logs/domain3-error_log
            CustomLog logs/domain3-access_log common

        <Directory "/var/www/html/domain3">
            Options Indexes FollowSymLinks
            AllowOverride All
            Order allow,deny
            Allow from all
        </Directory>

        </VirtualHost>

Welcome.conf

        <LocationMatch "^/+$">
        Options Indexes +FollowSymLinks
        ErrorDocument 403 /error/noindex.html
        </LocationMatch>

问题:

当我们访问https://abc.in显示目录列表而不是在访问abc.in时显示相同的内容时,

abc.in正常工作。

非常感谢您的帮助

1 个答案:

答案 0 :(得分:1)

我已经为自己的问题找到了答案!!

我已经改变了

        <VirtualHost IP:443>
        ServerAdmin vijay@abc.in
        DirectoryIndex index.php
        DocumentRoot "/var/www/html/abc.in"
        ServerName www.abc.in
        ServerAlias abc.in
        ErrorLog logs/abc.in-error_log
        CustomLog logs/abc.in-access_log common
        ServerAlias abc.in
        <Directory "/var/www/html/abc.in">
        Options Indexes FollowSymLinks
        AllowOverride all
        Order allow,deny
        Allow from all
        </Directory>
        </VirtualHost>

<VirtualHost *:443>
        ServerAdmin vijay@smartrx.in
        #DirectoryIndex index.php
        DocumentRoot "/var/www/html/smartrx.in"
        ServerName www.abc.in
        SSLEngine on
        SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
        SSLCertificateFile /path/certificate.crt
        SSLCertificateKeyFile /path/certificate.key
        SSLCertificateChainFile /path/keychain.crt
        ServerAlias abc.in
        ErrorLog logs/abc.in-error_log
        CustomLog logs/abc.in-access_log common

        <Directory "/var/www/html/abc.in">
        Options Includes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        Allow from all
        </Directory>
        </VirtualHost>

主要更改:已删除IP和包含的SSL相关项目,并且已删除选项中的索引注释了welcome.conf中的所有项目

相关问题