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

admin3年前服务器88

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
# httpd.apache.org/docs/2.2/mod/core#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
# httpd.apache.org/docs/2.2/mod/core#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.在浏览器中输入:
mysql/index.php //查看数据库设置是否成功
test/index.php //查看项目路径设置是否成功

免责声明:本文内容来自用户上传并发布,站点仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。请核实广告和内容真实性,谨慎使用。

相关文章

WDCP控制面板升级mysql为5.7.11的方法

1、下载解压下载地址为:dev.mysql/get/Downloads/MySQL-5.7/mysql-5.7.12-linux-glibc2.5-x86_64.tar.gztar -xvf mysq...

sqlite和mysql哪个快?SQLite和MySQL数据库的区别和选择建议

sqlite和mysql哪个快?我们在选择WordPress程序建站的时候,一般大家都会用mysql数据库,但是其实还是支持sqlite数据库的。测试数据时候,sqlite确实是快于mysql,但是s...

腾讯云:数据库最新优惠活动,mysql数据库低至1.1折首年仅需186元

腾讯云数据库最新优惠活动开始了!腾讯云首单秒杀活动不仅仅对云服务器进行优惠,其实还有很多云数据库一样享受很大的优惠,腾讯云数据库的价格跟数据库类型、规格、配置和优惠活动有关。目前腾讯云数据库最新优惠活...

MongoDB和MySQL哪个好?MongoDB和MySQL的区别

MongoDB和mysql哪个好?我们在搭建网站时需要选择合适的数据库来存储数据,以便后期用户轻松创建、访问、搜索和复制网站的数据内容。MongoDB和mysql是目前比较流行的开源数据库管理系统,那...

WampServer下安装多个版本的PHP、mysql、apache

今天,我在调试一套php程序的时候,该程序中使用的某些函数在低版本中无法使用,所以只能在搞个高版本的php。作为web开发人员,在机器上安装不同版本的php,apache和mysql有时是很有必要的。...

windows下jsp+mysql网站环境配置方法

数据库采用mysql(配置过程如有问题可以重启tomcat试一下)一、下载软件.J2SEjava.sun/j2se/.4.2/download2.Tomcat服务器tomcat.apache.org/...