当前位置: 移动技术网 > 网络运营>服务器>Linux > Apache为mysql以及自己的项目设置虚拟路径

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

2019年05月07日  | 移动技术网网络运营  | 我要评论
1.apache2.2\conf\httpd.conf中释放: include conf/extra/httpd-vhosts.conf(去掉前面的#) 2.httpd.c
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 //查看项目路径设置是否成功

如您对本文有疑问或者有任何想说的,请 点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网