【发布时间】:2021-07-24 23:52:31
【问题描述】:
在我启用了 Wordpress 的 Ubuntu 实例中,我有一个 000-default.conf 文件,其中包含以下设置:
./apache2/sites-available/000-default.conf: ServerName $domain
./apache2/sites-available/000-default.conf: ServerAlias www.$domain
grepping for \$domain inside etc 基本上只给了我这个文件。
Apache 在运行我的网站时从哪里获得这个值?
完整的 000-default.conf:
UseCanonicalName On
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName $domain
ServerAlias www.$domain
DocumentRoot /var/www/html
<Directory /var/www/html/>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<FilesMatch \.php$>
# 2.4.10+ can proxy to unix socket
SetHandler "proxy:unix:/var/run/php/php7.4-fpm.sock|fcgi://localhost"
</FilesMatch>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
【问题讨论】:
-
显示完整的 000-default.conf
-
@Exampleperson 添加。你看到什么相关的了吗?
-
@Adeerlike 请同时显示 000-default 包含在主配置中的部分。
-
@JohannesH。只是
# Include the virtual host configurations: IncludeOptional sites-enabled/*.conf -
包括
sites-enabled/000-default.conf- 您在上面发布了sites-available/000-default.conf。你确定它们是相同的/符号链接的吗?