wamp 的安装 设置虚拟目录

来源:互联网 发布:办公室软件培训心得 编辑:程序博客网 时间:2024/05/28 11:50

在apache的httpd.conf 文件下,修改 documentroot到指定的目录 如下:

  • 默认如下:
DocumentRoot "${INSTALL_DIR}/www"<Directory "${INSTALL_DIR}/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.4/mod/core.html#options    # for more information.    #    Options +Indexes +FollowSymLinks +Multiviews    #    # AllowOverride controls what directives may be placed in .htaccess files.    # It can be "All", "None", or any combination of the keywords:    #   AllowOverride FileInfo AuthConfig Limit    #    AllowOverride all    #    # Controls who can get stuff from this server.    ##   onlineoffline tag - don't remove    Require local</Directory>
  • 修改如下:
DocumentRoot "E:/phpws/web/"<Directory "E:/phpws/web/">    #    # 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.4/mod/core.html#options    # for more information.    #    Options +Indexes +FollowSymLinks +Multiviews    #    # AllowOverride controls what directives may be placed in .htaccess files.    # It can be "All", "None", or any combination of the keywords:    #   AllowOverride FileInfo AuthConfig Limit    #    AllowOverride all    #    # Controls who can get stuff from this server.    ##   onlineoffline tag - don't remove#   Require local#  设置访问权限    Order Deny,Allow    Deny from all    Allow from all</Directory>
  • 然后修改 httpd-vhosts.conf 文件如下:
# Virtual Hosts#<VirtualHost *:80>    ServerName localhost    ServerAlias localhost    DocumentRoot E:/phpws/web    <Directory  "E:/phpws/web">        Options +Indexes +Includes +FollowSymLinks +MultiViews        AllowOverride All        Require local    </Directory></VirtualHost>

这时在浏览器中输入localhost就可以看见更改的虚拟目录了,

  • 下面修改首页:在httpd.conf 文件下搜索directoryindex
## DirectoryIndex: sets the file that Apache will serve if a directory# is requested.#可以自己添加默认查找首页<IfModule dir_module>    DirectoryIndex index.php index.php3 index.html index.htm</IfModule>
  • 修改监听的端口:在httpd.conf 文件下搜索Listen
#Listen 12.34.56.78:80Listen 0.0.0.0:80Listen [::0]:80
  • DNS 解析,就是把域名解析成网址
在C:\Windows\System32\drivers\etc 目录下:#   127.0.0.1       localhost#   ::1             localhost127.0.0.1           www.php.com
0 0
原创粉丝点击