我在Debian上安装了Apache 2,并且是一名初学者。
当我在网络浏览器中访问我的Web服务器时,我会看到Apache默认的欢迎页面(如下图所示):
相反,我想要显示我的真正网站(位于var/www/mywebsite.com/),而不是这个页面(位于var/www/html)。以下是我的服务器上的目录树:
我的.vhost文件已经配置好了:
---- etc
-------- apache2
------------ sites-enabled
---------------- mywebsite.com.vhost -> etc/apache2/sites-available/mywebsite.com.vhost
------------ sites-available
---------------- mywebsite.com.vhost
---- var
-------- www
------------ mywebsite.com
---------------- web
-------------------- css/
-------------------- js/
-------------------- img/
-------------------- error/
-------------------- index.html
-------------------- robots.txt
我的.vhost文件已经配置好了:
AllowOverride None
Require all denied
DocumentRoot /var/www/mywebsite.com
ServerName mywebsite.com
ServerAlias www.mywebsite.com
ServerAdmin webmaster@mywebsite.com
ErrorLog /var/log/ispconfig/httpd/mywebsite.com/error.log
Alias /error/ "/var/www/mywebsite.com/web/error/"
ErrorDocument 400 /error/400.html
ErrorDocument 401 /error/401.html
ErrorDocument 403 /error/403.html
ErrorDocument 404 /error/404.html
ErrorDocument 405 /error/405.html
ErrorDocument 500 /error/500.html
ErrorDocument 502 /error/502.html
ErrorDocument 503 /error/503.html
<Directory /var/www/mywebsite.com/web>
# Clear PHP settings of this website
<FilesMatch ".+\.ph(p[345]?|t|tml)$">
SetHandler None
</FilesMatch>
Options +FollowSymLinks
AllowOverride All
Require all granted.
</Directory>
我尝试重新启动了Apache,但没有成功!Apache默认页面仍然存在。我错过了什么吗?