Apache为mysql以及自己的项目设置虚拟路径

Apache为mysql以及自己的项目设置虚拟路径
1.Apache2.2\conf\httpd.conf中释放:
Include conf/extra/httpd-vhosts.conf(去掉前面的#)
2.httpd.conf中增加
<Directory "E:/work/test"> #项目文件夹DWM目录,注意不要使用中文定义目录与文件夹
#
# 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 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 None
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
<Directory "C:/phpMyAdmin"> #phpMyAdmin的安装路径
#
#
# 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 None
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
3.在文件Apache2.2\conf\extra\httpd-vhosts.conf中增加:

<VirtualHost *:80> #放在第一个
ServerAdmin webmaster@dummy-host2.ies.inventec
DocumentRoot "D:\work\test"
ServerName test
ErrorLog "logs/dummy-host2.ies.inventec-error.log"
CustomLog "logs/dummy-host2.ies.inventec-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.ies.inventec
DocumentRoot "C:\Program Files\phpMyAdmin-2.11.4"
ServerName mysql
ErrorLog "logs/dummy-host2.ies.inventec-error.log"
CustomLog "logs/dummy-host2.ies.inventec-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.ies.inventec
DocumentRoot "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs"
ServerName localhost
ErrorLog "logs/dummy-host2.ies.inventec-error.log"
CustomLog "logs/dummy-host2.ies.inventec-access.log" common
</VirtualHost>

4.在windows\system32\drivers\etc\hosts檔中增加:(是hosts檔,不是hosts.msn之类的)
127.0.0.1 test
127.0.0.1 mysql
5.在浏览器中输入:
http://mysql/index.php //查看数据库设置是否成功
http://test/index.php //查看项目路径设置是否成功
本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

安装 Apache 出现 OS 10013 以一种访问权限不允许的方式做了一个访问套接字的尝试 如下截图: 提示: make_sock: could not bind to address 0.0.0.0:80 这个问题有由于计算机上安装了IIS7,80端口已占用。 打开Apache 的配置文件 Apache安装目录下的conf/htt
apache web服务器的站点,下载pptx,docx,xlsx文件,却被浏览器当作zip文件保存。 这不是浏览器的问题,而是apache不认docx,pptx,,xlsx等Microsoft Office 2007+的文件格式,而这些文件本身是zip压缩文件,所以被apache当作zip压缩文件发给浏览器了。 做个形
网站目录文件权限的设置对网站的安全至关重要,下面简单介绍网站目录文件权限的基本设定。 我们假设http服务器运行的用户和用户组是www,网站用户为centos,网站根目录是/home/centos/web。 我们首先设定网站目录和文件的所有者和所有组为centos,www,如下
Apache mod_ssl 配置多个虚拟主机支持SSL子站,以下配置适用于httpd 2.4+,对于不支持define指令的低版本Apache httpd Web Server,把SSLROOT换成所定义的路径即可。配置中的${WROOT}是httpd.conf中通过define指令定义的一个变量,值为D:/Web/www/ 在httpd.c
在apache的配置文件http.conf中最下面加入了这句,把这段注销掉或者去掉再重启apache就可以启动了! #Begin SafeDogSite-ApacheFilter edits - remove only on uninstall Include d:/wamp/bin/apache/apache2.4.4/conf/SafeDogSiteApacheFilter.Conf #End Sa
在windows和RH都碰到过,只要把主目录指到其他地方后就出现权限不够的403提示,郁闷了好久。