安装wamp集成开发环境,将apache的端口号改为8080,wamp菜单下localhost可以直接访问wampserver的说明界面 按照慕课网上的教程建立本地站点test01和test02
修改httpd-vhosts.conf如下
<VirtualHost *:80>
DocumentRoot "D:\PHP_Projects\test01"
ServerName test01.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "D:\PHP_Projects\test02"
ServerName test02.com
</VirtualHost>
修改hosts如下
127.0.0.1 test01.com
127.0.0.1 test02.com
直接在浏览器地址栏输入test01.com报404错误
httpd.conf修改如下
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
# Deny from all
Allow from all
#允许所有访问
Satisfy all
</Directory>
# onlineoffline tag - don't remove
Order Allow,Deny
Allow from all
php的配置文件httpd.conf。 在原有的位置文件中找到配置节 <Directory /> Options FollowSymLinks AllowOverride None Order deny,allow Deny from all Satisfy all </Directory> 修改成 <Directory /> Options FollowSymLinks AllowOverride None Order deny,allow # Deny from all Allow from all #允许所有访问 Satisfy all </Directory> 还有 <Directory "D:/Wamp5/www"> # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.2/mod/core.html#options # for more information. # Options Indexes FollowSymLinks # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride all # # Controls who can get stuff fromthis server. # # onlineoffline tag - don't remove Order Deny,Allow Deny from all Allow from 127.0.0.1 </Directory> 修改成 <Directory "D:/Wamp5/www"> # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.2/mod/core.html#options # for more information. # Options Indexes FollowSymLinks # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride all # # Controls who can get stuff fromthis server. # # onlineoffline tag - don't remove Order Deny,Allow # Deny from all # Allow from 127.0.0.1 Allow from all </Directory>
不好意思好久没有看这个 但是还是试了一下的 还是不行 貌似因为修改过apache的localhost 然后没办法在系统的hosts文件中使用127.0.0.1作为最先解析的域名 晚上的教程说是要修改系统盘下的hosts文件才可以访问自定义的域名
问题解决了吗?
还没有解决 不过我把原本的tomcat7.0给卸载了 现在80端口空出来了 不过这个最近没有在测试 等之后测试之后看一下127.0.0.1可不可以解析自定义域名再告诉你吧