【发布时间】:2019-09-10 22:32:40
【问题描述】:
我有附加的配置,我正在尝试显示mysite.com(最后定义为 vhost),但它始终显示默认索引页面,即我在/var/www/html/domains/default/index.php 中的那个
我知道一个原因可能是我的 vhost 文件夹上的权限代码错误,但我认为现在情况并非如此,我在日志中没有看到常见的 forbidden 错误,出于调试目的,我设置了完整的属于apache:apache的子目录路径
我也尝试将我的虚拟主机移动到 .conf 的顶部,但没有任何区别。
ServerRoot "/etc/httpd"
Listen *:80
Listen *:443
Include conf.modules.d/*.conf
User apache
Group apache
ServerAdmin root@localhost
ServerName vm3.mysite.com:80
<Directory />
AllowOverride all
Require all granted
</Directory>
DocumentRoot "/var/www/html/domains/default"
<Directory "/var/www">
AllowOverride All
Require all granted
</Directory>
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
<Files ".ht*">
Require all denied
</Files>
ErrorLog "logs/error_log"
LogLevel warn
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
CustomLog "logs/access_log" combined
</IfModule>
<IfModule alias_module>
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
</IfModule>
<Directory "/var/www/cgi-bin">
AllowOverride None
Options None
Require all granted
</Directory>
<IfModule mime_module>
TypesConfig /etc/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
</IfModule>
AddDefaultCharset UTF-8
<IfModule mime_magic_module>
MIMEMagicFile conf/magic
</IfModule>
EnableSendfile on
IncludeOptional conf.d/*.conf
<VirtualHost mysite.com:80>
DocumentRoot /var/www/html/domains/mysite.com
ServerName mysite.com
<Directory "/var/www/html/domains/mysite.com">
allow from all
Options None
Require all granted
</Directory>
</VirtualHost>
KeepAlive on
【问题讨论】:
标签: apache debugging web webserver virtualhost