team470 发表于 2018-11-25 08:57:18

apache同一ip多端口的配置

1:apache同一ip同一端口多域名的配置

修改host文件


    ServerName localhost
    DocumentRoot "D:/WebSite_PHP/"
         ErrorLog logs/localhost-error.log
         CustomLog logs/localhost-access.log common
   
      Options Indexes FollowSymLinks
      AllowOverride All
      Order allow,deny
      Allow from all
   





    ServerName disease.local
    DocumentRoot "D:/WebSite_PHP/disease/www/"
         ErrorLog logs/disease-error.log
         CustomLog logs/disease-access.log common
   
      Options Indexes FollowSymLinks
      AllowOverride All
      Order allow,deny
      Allow from all
   




2:apache同一ip多端口的配置

修改apache的配置文件http-vhost.conf:

加入以下虚拟主机配置(括号里是注释):
Listen 80
Listen 88
NameVirtualHost *:80
NameVirtualHost *:88   (这里配置你要的端口,注意不要和别的端口冲突了)

DocumentRoot /var/www/html

         (跟前面NameVirtualHost里写的端口要一致)
DocumentRoot /var/www/html/vh(指定虚拟主机的目录)




页: [1]
查看完整版本: apache同一ip多端口的配置