linux Apache 多端口配置项目

1:安装完成LAMP环境

具体可查看我的另一篇文章 https://blog.csdn.net/qq_29099209/article/details/79206170

2:进入 /etc/httpd/conf 目录

打开http.conf 文件 

在Listen 80下面添加你所需要监听的端口

在末尾添加

Include conf/extra/httpd-vhosts.conf

3:创建extram目录

mkdir extra

4:创建http-vhosts.conf文件

vi httpd-vhosts.conf

在文件中添加

<Directory "/var/www/html/xxxxx">
    AllowOverride All
</Directory>


<VirtualHost *:10002>
    DocumentRoot /var/www/html/xxxxx
    ServerName localhost:10002
</VirtualHost>

5:重启Apache服务

service httpd restart
按照上述步骤 即可完成多端口配置  快来试试吧!


猜你喜欢

转载自blog.csdn.net/qq_29099209/article/details/79785369
今日推荐