centos 8 中 apache/httpd 中的多站点:三个站点中,两个站点指向同一文件夹

centos 8 中 apache/httpd 中的多站点:三个站点中,两个站点指向同一文件夹

我正在尝试在 Apache 服务器 Digital Ocean 中配置 centos 8 中的多站点,该服务器也称为 centos 的 httpd。我正在关注本教程.但跳过了权限和 SELniux 部分。

我拥有的三个网站:

  1. donordrop.com
  2. 戈贝绍纳新闻
  3. neomtech.xyz

其中: gobeshona.news运行正常。但donatedrop.comneomtech.xyz指向donatedrop.com文件夹的 html 文件的方式相同。

donatedrop.com.conf

<VirtualHost *:80>
    DocumentRoot /var/www/html/donatedrop.com/
    ServerName www.donatedrop.com
    ServerAlias donatedrop.com
    ErrorLog /var/www/html/donatedrop.com/logs/donatedrop-error_log
    CustomLog /var/www/html/donatedrop.com/logs/donatedrop-common_log common
</VirtualHost>

gobeshona.news.conf

<VirtualHost *:80>
    DocumentRoot /var/www/html/gobeshona.news/
    ServerName www.gobeshona.gobeshonaws
    ServerAlias gobeshona.news
    ErrorLog /var/www/html/gobeshona.news/logs/gobeshona-error_log
    CustomLog /var/www/html/gobeshona.news/logs/gobeshona-common_log common
    ErrorDocument 404 /index.html
</VirtualHost>

neomtech.xyz.conf

<VirtualHost *:80>
    DocumentRoot /var/www/html/neomtech.xyz/
    ServerName www.neomtech.xyz
    ServerAlias neomtech.com
    ErrorLog /var/www/html/neomtech.xyz/logs/neomtech-error_log
    CustomLog /var/www/html/neomtech.xyz/logs/neomtech-common_log common
</VirtualHost>

我已经重新启动了服务器并且还使用一些其他浏览器进行了检查。

我已经检查了配置。

[root@neomtech ~]# ls -lZ /var/www/html/donatedrop.com/logs
total 20
-rw-r--r-- 1 root root ? 15832 Nov 13 23:41 donatedrop-common_log
-rw-r--r-- 1 root root ?   187 Nov 13 14:30 donatedrop-error_log
[root@neomtech ~]# ls -lZ /var/www/html/neomtech.xyz/logs

该文件夹是我保存 html 文件的地方。

[root@neomtech ~]# ls -l /var/www/html/ -a
total 8
drwxr-xr-x 5 root root   70 Nov 13 05:41 .
drwxr-xr-x 4 root root   33 Nov 13 01:47 ..
drwxr-xr-x 3 root root   36 Nov 13 06:03 donatedrop.com
drwxr-xr-x 3 root root 4096 Nov 13 12:22 gobeshona.news
drwxr-xr-x 3 root root 4096 Nov 14 00:21 neomtech.xyz

httpd -S

[root@neomtech ~]# httpd -S
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, usi                                                                                                   ng fe80::b894:ccff:fe8a:8baa. Set the 'ServerName' directive globally to suppress this mes                                                                                                   sage
VirtualHost configuration:
*:80                   is a NameVirtualHost
         default server www.donatedrop.com (/etc/httpd/sites-enabled/donatedrop.com.conf:1                                                                                                   )
         port 80 namevhost www.donatedrop.com (/etc/httpd/sites-enabled/donatedrop.com.con                                                                                                   f:1)
                 alias donatedrop.com
         port 80 namevhost www.gobeshona.gobeshonaws (/etc/httpd/sites-enabled/gobeshona.n                                                                                                   ews.conf:1)
                 alias gobeshona.news
         port 80 namevhost www.neomtech.xyz (/etc/httpd/sites-enabled/neomtech.xyz.conf:1)
                 alias neomtech.com
ServerRoot: "/etc/httpd"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/etc/httpd/logs/error_log"
Mutex default: dir="/etc/httpd/run/" mechanism=default
Mutex cache-socache: using_defaults
Mutex authdigest-opaque: using_defaults
Mutex watchdog-callback: using_defaults
Mutex proxy-balancer-shm: using_defaults
Mutex rewrite-map: using_defaults
Mutex authdigest-client: using_defaults
Mutex lua-ivm-shm: using_defaults
Mutex proxy: using_defaults
Mutex authn-socache: using_defaults
PidFile: "/etc/httpd/run/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="apache" id=48
Group: name="apache" id=48

相关内容