You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Apache2自定义虚拟主机配置后仍显示默认页面问题求助

Apache2自定义虚拟主机配置后仍显示默认页面问题求助

各位大佬好,我在Ubuntu 22.10上用ISPConfig配置Apache2时遇到了个棘手的问题:明明配置了自定义虚拟主机,但访问域名时始终显示默认的Ubuntu Apache2“it works”页面,想请教下到底哪里出问题了。

先跟大家说下我的配置情况,我用占位域名ilikecabbag.es代替了真实域名:

首先是默认的VirtualHost配置:

<VirtualHost *:80>

# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com

ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>

然后是我配置的自定义虚拟主机相关内容:

<Directory /var/www/ilikecabbag.es>
AllowOverride None
Require all denied
</Directory>

<VirtualHost *:80>
DocumentRoot /var/www/ilikecabbag.es/web
ServerName ilikecabbag.es
ServerAlias *.ilikecabbag.es
ServerAdmin webmaster@ilikecabbag.es
ErrorLog /var/log/ispconfig/httpd/ilikecabbag.es/error.log

<Directory /var/www/ilikecabbag.es/web>
# Clear PHP settings of this website
<FilesMatch ".+\.ph(p[345]?|t|tml)$">
SetHandler None
</FilesMatch>
Options +SymlinksIfOwnerMatch
AllowOverride All
Require all granted
<Files ~ '.php[s3-6]{0,1}$'>
Require all denied
</Files>
</Directory>

<Directory /var/www/clients/client1/web1/web>
# Clear PHP settings of this website
<FilesMatch ".+\.ph(p[345]?|t|tml)$">
SetHandler None
</FilesMatch>
Options +SymlinksIfOwnerMatch
AllowOverride All
Require all granted
<Files ~ '.php[s3-6]{0,1}$'>
Require all denied
</Files>
</Directory>

# suexec enabled
<IfModule mod_suexec.c>
SuexecUserGroup web1 client1
</IfModule>

# add support for apache mpm_itk
<IfModule mpm_itk_module>
AssignUserId web1 client1
</IfModule>

<IfModule mod_dav_fs.c>
# Do not execute PHP files in webdav directory
<Directory /var/www/clients/client1/web1/webdav>
<ifModule mod_security2.c>
SecRuleRemoveById 960015
SecRuleRemoveById 960032
</ifModule>
<FilesMatch "\.ph(p3?|tml)$">
SetHandler None
</FilesMatch>
</Directory>

DavLockDB /var/www/clients/client1/web1/tmp/DavLock
# DO NOT REMOVE THE COMMENTS!
# WEBDAV BEGIN
# WEBDAV END
</IfModule>
</VirtualHost>

我已经确认DNS配置是正常的,ServerName和ServerAlias也都按要求设置了,但访问ilikecabbag.es的时候还是跳转到默认页面。服务器用的是ISPConfig管理,系统是Ubuntu 22.10,有没有大佬能帮我排查下问题所在?

备注:内容来源于stack exchange,提问作者CabbageGremlin

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.22 15:27:56