码迷,mamicode.com
首页 > Web开发 > 详细

lamp-----5 apache虚拟主机实现,发布多个独立站点

时间:2017-02-05 18:21:35      阅读:267      评论:0      收藏:0      [点我收藏+]

标签:端口   测试   bin   ted   amp   system   多个   httpd   emc   

1.。。基于ip

vi /etc/httpd/conf/httpd.conf

<VirtualHost 192.168.1.142:80>
ServerName 192.168.1.142:80
DocumentRoot /web/upload

<Directory "/web/upload">
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>

ErrorLog /var/log/httpd/142error.log
CustomLog /var/log/httpd/142access.log combined
</VirtualHost>

 

 

<VirtualHost 192.168.1.143:80>
ServerName 192.168.1.143:80
DocumentRoot /var/www/html/upload

<Directory "/var/www/html/upload">
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>

ErrorLog /var/log/httpd/143error.log
CustomLog /var/log/httpd/143access.log combined
</VirtualHost>

 

技术分享

 

systemctl restart httpd.service

 

测试

技术分享

 

技术分享

 

 

2.。。基于端口

vi /etc/httpd/conf/httpd.conf

 

<VirtualHost 192.168.1.142:80>
ServerName 192.168.1.142:80
DocumentRoot /web/upload

<Directory "/web/upload">
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>

ErrorLog /var/log/httpd/142error.log
CustomLog /var/log/httpd/142access.log combined
</VirtualHost>

<VirtualHost 192.168.1.142:8091>
ServerName 192.168.1.142:8091
DocumentRoot /var/www/html/upload

<Directory "/var/www/html/upload">
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>

ErrorLog /var/log/httpd/143error.log
CustomLog /var/log/httpd/143access.log combined
</VirtualHost>

技术分享

 

 

测试

技术分享

 

技术分享

 

 

完成。。

 

lamp-----5 apache虚拟主机实现,发布多个独立站点

标签:端口   测试   bin   ted   amp   system   多个   httpd   emc   

原文地址:http://www.cnblogs.com/han1094/p/6368080.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!