云计算
本篇内容介绍了“appach服务器怎么让ip绑定多个域名”的有关知识,在实际案例的操作过程中,许多人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!
1.开发好自己的网站放到d盘下
例如d:/new.html
2.打开appcah服务器的httpd.conf文件
例如我的文件保存在d:\\empireserver\\php\\apache2.2\\conf中
(1)找到documentroot
# documents. by default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#注销掉documentroot
#documentroot d:/empireserver/web
#
# each directory to which apache has access can be configured with respect
(2)找到虚拟机配置
# real-time info on requests and configuration
#include conf/extra/httpd-info.conf
# virtual hosts启用虚拟主机配置
include conf/extra/httpd-vhosts.conf
3.打开httpd-vhosts.conf文件(位置在conf/extra/httpd-vhosts.conf)
#你的项目位置
documentroot d:/
#你想取的域名(注意这里会和下面的hosts文件中名字相同)
servername www.myself.com
#你的在浏览器中输入域名第一要打开的文件
directoryindex new.html
options followsymlinks
allowoverride none
order allow,deny
allow from all
4.配置hosts文件(文件位置c:\\windows\\system32\\drivers\\etc\\)
文件最后加上 127.0.0.1 域名
5.在浏览器中输入域名 即可访问d盘下的new.html文件了。
“appach服务器怎么让ip绑定多个域名”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注亿速云网站,小编将为大家输出更多高质量的实用文章!