基于端口配置Apache虚拟机方法
apache配置虚拟机的方式一共有三种方式,今天介绍如何在基于端口的情况下配置虚拟机。
第一步:将监听端口添加到主配置文件:
[root@localhost conf]# vim /etc/httpd/conf/httpd.conf 在原有行Listen 80行的基础上, 在添加一行 Listen 8080
第二步:将8080端口的虚拟配置添加好:
[root@localhost conf.d]# cat virtualhost.conf <VirtualHost 192.168.137.200:80> DocumentRoot "/var/www/test200" ServerName www.test200.com </VirtualHost> <VirtualHost 192.168.137.201:80> DocumentRoot "/var/www/test201" ServerName www.test201.com </VirtualHost> #下面的内容是在上面的配置的基础上添加的。 <VirtualHost 192.168.137.201:8080> DocumentRoot "/var/www/test201-8080" ServerName www.test201-8080.com </VirtualHost> [root@localhost conf.d]# cd /var/www/ #切换目录 [root@localhost www]# mkdir test201-8080 #创建目录 [root@localhost www]# echo "test201-8080" >>./test201-8080/index.html #创建主页
第三步:检测
[root@localhost www]# service httpd restart Stopping httpd: [ OK ] Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName [ OK ] [root@localhost conf]# elinks -source 192.168.137.201:80 test201 [root@localhost conf]# elinks -source 192.168.137.201 test201 [root@localhost conf]# elinks -source 192.168.137.201:8080
原文出处:iis7 -> http://www.iis7.com/a/nr/084865.html
本站所发布的一切资源仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。如果侵犯你的利益,请发送邮箱到 [email protected],我们会很快的为您处理。
超哥软件库 » 基于端口配置Apache虚拟机方法
超哥软件库 » 基于端口配置Apache虚拟机方法