PHP 配置虚拟域名访问
2017-09-14 16:11
204 查看
本内容分以下几个步骤:
1、首页我们得找到host文件、这个文件在c盘中WINDOWS\system32\drivers\etc\hosts
在该文件中插入:
[php]
view plain
copy
print?
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
127.0.0.1 localhost
127.0.0.2 www.emswxh.com
127.0.0.3 www.xiu.com
2、然后咱们得去找httpd.conf文件、这个文件相应位置在您服务器安装的目录下/\apache\conf\httpd.conf
, 找到 “Include conf/extra/httpd-vhosts.conf 如果前面有# 则需要把它删掉
3、找到httpd-vhosts.conf文件
然后添加以下内容
[php]
view plain
copy
print?
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "E:/m1905/ems" //这个为您的项目目录
ServerName www.emswxh.com //这个为您在host中配置
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
然后重启服务器就可以了
1、首页我们得找到host文件、这个文件在c盘中WINDOWS\system32\drivers\etc\hosts
在该文件中插入:
[php]
view plain
copy
print?
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
127.0.0.1 localhost
127.0.0.2 www.emswxh.com
127.0.0.3 www.xiu.com
2、然后咱们得去找httpd.conf文件、这个文件相应位置在您服务器安装的目录下/\apache\conf\httpd.conf
, 找到 “Include conf/extra/httpd-vhosts.conf 如果前面有# 则需要把它删掉
3、找到httpd-vhosts.conf文件
然后添加以下内容
[php]
view plain
copy
print?
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "E:/m1905/ems" //这个为您的项目目录
ServerName www.emswxh.com //这个为您在host中配置
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
然后重启服务器就可以了
相关文章推荐
- PHP 配置虚拟域名访问
- PHP本地实现虚拟域名访问:Apache虚拟主机配置
- apache 设置IP访问、配置apache虚拟域名、Apache 配置二级域名、php 配置 curl
- 阿里云tomcat配置虚拟路径和域名访问
- PHP的Thinkphp5的apache服务器开发过程中的虚拟域名简化以及路由配置
- Apache虚拟主机的配置多地址,多网站,域名访问
- Apache Tomcat配置虚拟主机的方法(不同域名绑定同一IP访问不同网站)
- weblogic 10.x 配置虚拟目录(实现直接ip或者域名访问,去掉项目名)
- apache配置虚拟主机,为什么总是第一个VirtualHost起效 apache基于域名虚拟主机,只访问第一个的问题
- linux下Apache2.2.4 + tomcat5.5+php 一个IP配置多域名,虚拟主机
- php虚拟主机配置、访问权限配置、分布式文件配置
- PHP学习笔记:APACHE配置虚拟目录、一个站点使用多域名配置方式
- apache本机环境配置虚拟访问域名
- apache配置虚拟主机,为什么总是第一个VirtualHost起效 apache基于域名虚拟主机,只访问第一个的问题
- Apache配置虚拟主机、不同端口和域名、认证访问
- 源码编译安装LAMP环境及配置基于域名访问的多虚拟主机
- apache 配置虚拟目录访问和域名访问的两种方式
- winserver2008上用wamp配置虚拟主机,用外网域名访问
- PHP 虚拟目录 虚拟主机 域名配置
- phpstydy在本地配置域名访问