我的 Ubuntu 20.04LTS 发行版上有多个域。当我为每个域配置文件时/etc/apache2/sites-available/domain.com.conf
,我将 DocumentRoot 设置为/var/www/html/domain.com/public_html
.
正如您所期望的,站点文件全部位于该public_html
文件夹中,并且我的所有域的一切都正常工作除了一个。尽管它的配置与其他域一样,但它的站点文件实际上以/var/www/html/
.所以如果我去https://marcmanley.dev,域名运行良好,但站点文件不在 中,/var/www/html/marcmanley.dev/public_html
而是在 中/var/www/html/
。关于这里发生的事情有任何线索吗?
如果我没说清楚的话,这就是html
目录好像:
这是.conf
工作域的文件:
$ cat /etc/apache2/sites-available/imammarc.com.conf
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName imammarc.com
ServerAlias www.imammarc.com
DirectoryIndex index.html index.php
DocumentRoot /var/www/html/imammarc.com/public_html
LogLevel warn
ErrorLog /var/www/html/imammarc.com/log/error.log
CustomLog /var/www/html/imammarc.com/log/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =imammarc.com [OR]
RewriteCond %{SERVER_NAME} =www.imammarc.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
以及故障域 (marcmanley.dev)
$ cat /etc/apache2/sites-available/marcmanley.dev.conf
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName marcmanley.dev
ServerAlias www.marcmanley.dev
DirectoryIndex index.html index.php
DocumentRoot /var/www/html/marcmanley.dev/public_html
LogLevel warn
ErrorLog /var/www/html/marcmanley.dev/log/error.log
CustomLog /var/www/html/marcmanley.dev/log/access.log combined
</VirtualHost>
编辑:此外:
$ ls -lR /etc/apache2/sites-available
total 84
-rw-r--r-- 1 root root 1516 May 31 23:35 000-default.conf
-rw-r--r-- 1 root root 1569 Jun 1 01:14 000-default-le-ssl.conf
-rw-r--r-- 1 root root 6338 Apr 13 17:19 default-ssl.conf
-rw-r--r-- 1 root root 495 Jun 4 05:38 eid.rocks.conf
-rw-r--r-- 1 root root 536 Jun 4 05:38 eid.rocks-le-ssl.conf
-rw-r--r-- 1 root root 572 Jun 4 05:31 goodbookorganics.com.conf
-rw-r--r-- 1 root root 613 Jun 4 05:31 goodbookorganics.com-le-ssl.conf
-rw-r--r-- 1 root root 762 Jun 1 01:10 imammarc.com.conf
-rw-r--r-- 1 root root 729 Jun 1 01:10 imammarc.com-le-ssl.conf
-rw-r--r-- 1 root root 516 Jun 4 06:44 islaam.rocks.conf
-rw-r--r-- 1 root root 557 Jun 4 06:44 islaam.rocks-le-ssl.conf
-rw-r--r-- 1 root root 399 Jun 1 02:12 marcmanley.dev.conf
-rw-r--r-- 1 root root 523 Jun 4 20:19 marcmanley.me.conf
-rw-r--r-- 1 root root 564 Jun 4 20:19 marcmanley.me-le-ssl.conf
-rw-r--r-- 1 root root 574 Jun 1 04:25 mynew.faith.conf
-rw-r--r-- 1 root root 615 Jun 1 04:25 mynew.faith-le-ssl.conf
-rw-r--r-- 1 root root 621 Jun 1 06:57 ramadaan.rocks.conf
-rw-r--r-- 1 root root 632 Jun 1 06:57 ramadaan.rocks-le-ssl.conf
-rw-r--r-- 1 root root 530 Jun 4 05:51 shaykhchef.com.conf
-rw-r--r-- 1 root root 571 Jun 4 05:51 shaykhchef.com-le-ssl.conf
和
$ ls -lR /etc/apache2/sites-enabled
total 4
lrwxrwxrwx 1 root root 52 May 31 23:34 000-default-le-ssl.conf -> /etc/apache2/sites-available/000-default-le-ssl.conf
lrwxrwxrwx 1 root root 33 Jun 4 05:20 eid.rocks.conf -> ../sites-available/eid.rocks.conf
lrwxrwxrwx 1 root root 50 Jun 4 05:38 eid.rocks-le-ssl.conf -> /etc/apache2/sites-available/eid.rocks-le-ssl.conf
lrwxrwxrwx 1 root root 44 Jun 4 05:30 goodbookorganics.com.conf -> ../sites-available/goodbookorganics.com.conf
lrwxrwxrwx 1 root root 61 Jun 4 05:31 goodbookorganics.com-le-ssl.conf -> /etc/apache2/sites-available/goodbookorganics.com-le-ssl.conf
lrwxrwxrwx 1 root root 36 Jun 1 00:25 imammarc.com.conf -> ../sites-available/imammarc.com.conf
lrwxrwxrwx 1 root root 53 Jun 1 01:10 imammarc.com-le-ssl.conf -> /etc/apache2/sites-available/imammarc.com-le-ssl.conf
lrwxrwxrwx 1 root root 36 Jun 4 05:43 islaam.rocks.conf -> ../sites-available/islaam.rocks.conf
lrwxrwxrwx 1 root root 53 Jun 4 06:44 islaam.rocks-le-ssl.conf -> /etc/apache2/sites-available/islaam.rocks-le-ssl.conf
lrwxrwxrwx 1 root root 38 Jun 1 02:13 marcmanley.dev.conf -> ../sites-available/marcmanley.dev.conf
lrwxrwxrwx 1 root root 38 Jun 1 02:02 marcmanley.dev.old.conf -> ../sites-available/marcmanley.dev.conf
lrwxrwxrwx 1 root root 37 Jun 4 17:46 marcmanley.me.conf -> ../sites-available/marcmanley.me.conf
lrwxrwxrwx 1 root root 54 Jun 4 20:19 marcmanley.me-le-ssl.conf -> /etc/apache2/sites-available/marcmanley.me-le-ssl.conf
lrwxrwxrwx 1 root root 35 Jun 1 04:00 mynew.faith.conf -> ../sites-available/mynew.faith.conf
lrwxrwxrwx 1 root root 52 Jun 1 04:25 mynew.faith-le-ssl.conf -> /etc/apache2/sites-available/mynew.faith-le-ssl.conf
lrwxrwxrwx 1 root root 38 Jun 1 05:54 ramadaan.rocks.conf -> ../sites-available/ramadaan.rocks.conf
lrwxrwxrwx 1 root root 55 Jun 1 06:57 ramadaan.rocks-le-ssl.conf -> /etc/apache2/sites-available/ramadaan.rocks-le-ssl.conf
lrwxrwxrwx 1 root root 38 Jun 4 05:51 shaykhchef.com.conf -> ../sites-available/shaykhchef.com.conf
lrwxrwxrwx 1 root root 55 Jun 4 05:51 shaykhchef.com-le-ssl.conf -> /etc/apache2/sites-available/shaykhchef.com-le-ssl.conf