xampp 配置多虚拟主机 详细步骤
2016-08-02 10:22
375 查看
一、修改httpd.conf
文件目录 xampp => apach e=>httpd.conf1.在文件内搜索 关键字“httpd-vhosts.conf”,找到如下字段
# Virtual hosts Include conf/extra/httpd-vhosts.conf//确保此段开头没有#
2.在文件内搜索关键字“AllowOverride All”,找到如下字段
<Directory "D:/xampp/cgi-bin"> AllowOverride All Options None Require all granted </Directory> //修改为 <Directory "D:/xampp/cgi-bin"> Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Order allow,deny Allow from all </Directory>
3.搜索字段“DocumentRoot”,如下
DocumentRoot "D:/xampp/htdocs"//确保此处路径是你要访问的项目的根路径
4.如果想自定义配置端口,搜索字段“Listen 80”,找到如下
Listen 80 //在此添加你想监听的端口,如 Listen 80 Listen 8080 Listen 8099 ....
二、修改httpd-vhosts.conf
文件目录 xampp => apache =>conf => extra => httpd-vhosts.conf文件最后面可看到如下
##<VirtualHost *:80> ##ServerAdmin webmaster@dummy-host2.example.com ##DocumentRoot "D:/xampp/htdocs/dummy-host2.example.com" ##ServerName dummy-host2.example.com ##ErrorLog "logs/dummy-host2.example.com-error.log" ##CustomLog "logs/dummy-host2.example.com-access.log" common ##</VirtualHost>
1.用ip访问
<VirtualHost 127.0.0.5:80>//设置访问的ip ##ServerAdmin webmaster@dummy-host2.example.com DocumentRoot "D:/xampp/htdocs"//你的项目文件目录 ServerName testname.dev//此项目的名称 ##ErrorLog "logs/dummy-host2.example.com-error.log" ##CustomLog "logs/dummy-host2.example.com-access.log" common </VirtualHost>
2.用ServerName访问
<VirtualHost *:80> ##ServerAdmin webmaster@dummy-host2.example.com DocumentRoot "D:/xampp/htdocs"//你的项目文件目录 ServerName testname.dev//此项目的名称,通过此名称来访问项目,还需配置hosts文件 ##ErrorLog "logs/dummy-host2.example.com-error.log" ##CustomLog "logs/dummy-host2.example.com-access.log" common </VirtualHost>
3.配置hosts文件
文件目录 C:\Windows\System32\drivers\etc\hosts 在文件中加入 127.0.0.1 testname.dev
三、修改完记得重启aphache在进行访问
相关文章推荐
- xampp 配置多虚拟主机 详细步骤
- mac os下xampp配置基于域名的虚拟主机
- Ubuntu Linux下配置虚拟主机及其配置文件详细说明
- php中MVC zend framework框架在apache上的配置方法以及创建步骤,配置虚拟主机
- XAMPP虚拟主机VirtualHost配置小贴士
- mac 下 xampp 多域名 多站点 多虚拟主机 配置
- mac 下 xampp 多域名 多站点 多虚拟主机 配置
- apache 虚拟主机详细配置:http.conf配置详解
- xampp配置多域名泛域名虚拟主机For linux xampp wampp 多域名设置只有第一个生效的解决办法
- XAMPP下使用顶级域名绑定虚拟主机的配置方法和示例
- Linux下的XAMPP基本配置技巧(设置虚拟主机、添加FTP账户等)
- xampp 配置多虚拟主机 实例
- Linux下的XAMPP基本配置技巧(设置虚拟主机、添加FTP账户等)
- 虚拟主机完全安全的配置方法,详细!
- mac 下 xampp 多域名 多站点 多虚拟主机 配置
- ubuntu下xampp配置虚拟主机
- windows下kangle虚拟主机-easypanel配置iis 6.0插件开asp,asp.net空间详细教程
- xampp for mac 配置虚拟主机及安装memcache 扩展
- ubuntu下xampp配置虚拟主机
- 步骤清晰四步在win7下配置Apache虚拟主机