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