开启虚拟机子 确保伪静态开启(集成环境phpstudy)
在apache 的配置里面文件夹http.conf里面找绿色的部分
1. #LoadModule rewrite_module modules/mod_rewrite.so
去掉前面的 “# ” 号 为开启伪静态的重写
2.监听端口listen 8080
可在phpsudy里 -->其他选项菜单-->phpstudy设置-->端口常规设置(apache 端口设置修改) 点击应用
3.开启相关的设置
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
去掉前面的 “# ” 号 为开启
# "c:/Apache4/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "C:/phpStudy/Apache/cgi-bin">
AllowOverride on
Options None
Require all granted
</Directory>
将红色的 on 改为 all
#Include conf/extra/httpd-vhosts.conf
去掉前面的 “#” 号 开启代理
4.httpd-vhosts
D:\phpStudy\Apache\conf\extra(路径地址)
添加如下:
<VirtualHost *:801>
DocumentRoot "d:/WWW/zhongc"
ServerName www.zhongc.com
DirectoryIndex news.html index.html index.htm index.php
<Directory />
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
ServerName:可直接改为解析的域名 则跳过本地的
127.0.0.1 www.***.com