首页 新闻 会员 周边

将apache端口号改为8080之后,怎么在本地建立站点

0
悬赏园豆:20 [已关闭问题] 关闭于 2015-10-30 20:22

安装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

小kk06的主页 小kk06 | 初学一级 | 园豆:56
提问于:2015-09-21 20:38
< >
分享
所有回答(2)
0
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>
CodeHsu | 园豆:5468 (大侠五级) | 2015-09-22 20:18

 不好意思好久没有看这个 但是还是试了一下的 还是不行 貌似因为修改过apache的localhost 然后没办法在系统的hosts文件中使用127.0.0.1作为最先解析的域名 晚上的教程说是要修改系统盘下的hosts文件才可以访问自定义的域名

支持(0) 反对(0) 小kk06 | 园豆:56 (初学一级) | 2015-10-30 20:18
0

问题解决了吗?

clearbug | 园豆:268 (菜鸟二级) | 2015-09-24 10:34

还没有解决 不过我把原本的tomcat7.0给卸载了 现在80端口空出来了 不过这个最近没有在测试 等之后测试之后看一下127.0.0.1可不可以解析自定义域名再告诉你吧

支持(0) 反对(0) 小kk06 | 园豆:56 (初学一级) | 2015-10-30 20:19
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册