九图设计库logo

网络常见问题

当前位置: 首页 > 技术文章 > 网络常见问题 > apache配置多端口

apache配置多端口

发布: 提交时间:2018-07-24 12:44:33 浏览量:1214

在这个目录:/apache/conf/  里面,找到  httpd.conf
1:找到#Include conf/extra/httpd-vhosts.conf  前面的#去掉
2:找到DocumentRoot "/rj/apache//htdocs" 注释掉
#DocumentRoot "/apache//htdocs"
3:找到
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>
注释掉(这样我们可以在httpd-vhosts.conf里自己配置了)
#<Directory />
   # Options FollowSymLinks
    #AllowOverride None
    #Order deny,allow
    #Deny from all
#</Directory>
——————————————————————————————————
在这里个目录:/apache/conf/extra/  找到: httpd-vhosts.conf
1:找到NameVirtualHost *:80
下面添加Listen 90
2:注释掉原来的80
<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.localhost
    DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host.localhost"
    ServerName dummy-host.localhost
    ServerAlias www.dummy-host.localhost
    ErrorLog "logs/dummy-host.localhost-error.log"
    CustomLog "logs/dummy-host.localhost-access.log" common
</VirtualHost>
<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host2.localhost
    DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.localhost"
    ServerName dummy-host2.localhost
    ErrorLog "logs/dummy-host2.localhost-error.log"
    CustomLog "logs/dummy-host2.localhost-access.log" common
</VirtualHost>
3:添加以下代码
端口80指向wwwroot  90指向wwwroot2
<VirtualHost *:80>
    DocumentRoot "F:\ComsenzEXP\wwwroot"
    ServerName localhost
    ServerAlias localhost
    ErrorLog "logs/dummy-host.localhost-error.log"
    CustomLog "logs/dummy-host.localhost-access.log" common
</VirtualHost>
<VirtualHost *:80>
    DocumentRoot "F:\ComsenzEXP\wwwroot"
    ServerName localhost
    ErrorLog "logs/dummy-host2.localhost-error.log"
    CustomLog "logs/dummy-host2.localhost-access.log" common
</VirtualHost>
<VirtualHost *:90>
    DocumentRoot "F:\ComsenzEXP\wwwroot2"
    ServerName localhost
    ServerAlias localhost
    ErrorLog "logs/dummy-host.localhost-error.log"
    CustomLog "logs/dummy-host.localhost-access.log" common
</VirtualHost>
<VirtualHost *:90>
    DocumentRoot "F:\ComsenzEXP\wwwroot2"
    ServerName localhost
    ErrorLog "logs/dummy-host2.localhost-error.log"
    CustomLog "logs/dummy-host2.localhost-access.log" common
</VirtualHost>

加载中

积分不足,下载失败!
充 值 积 分 取 消