APACHE同一IP配置多个域名,做web开发的应该非常熟悉了,不过还是总结一下防止以后搞忘了!
下面直接说该如何操作吧:
1.在windows2003下安装APACHE配置虚拟目录和UNIN下基本是一样的,就是修改httpd.conf文件(Apache2\conf\httpd.conf).
2.打开http.conf文件,在其最下发输入
NameVirtualHost 218.17.19.19 #服务器IP地址 <VirtualHost 218.17.19.19> #域名所指向的IP DocumentRoot "E:/webroot/phpernote" #域名所指向的目录,注意""不可少 ServerName www.phpernote.com #网站域名 DirectoryIndex index.php index.html default.php index.html.var </VirtualHost> <VirtualHost 218.17.19.19> #第二个网站域名所指向的IP DocumentRoot "E:/webroot/example" #www.example.com要指向的目录 ServerName www.example.com DirectoryIndex index.php index.htm index.html default.php index.html.var </VirtualHost>
更多个虚拟主机(域名配置)依次类推。
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号