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

admin3年前服务器49

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 //查看项目路径设置是否成功

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

相关文章

最服务器租用的优势在哪里,探索最服务器租用的市场前景

最服务器租用是指将最游戏平台上线所需要的服务器资源租赁给第三方服务商的一种模式。随着最游戏市场的迅速发展,最服务器租用市场也愈发繁荣。目前中国境内以及国外最游戏厂商、运营商均纷纷加入了该市场,使得最服...

为什么要选择magento主机,magento主机的优点

1.什么是magento主机?magento是一款开源的电商平台软件,为用户提供一个强大的在线商城平台。但是,要构建一个具有完整功能和可扩展性的商城网站,需要更多的支持和服务。这就是magento主机...

Windows服务器中IIS返回的网页错误代码大汇总及原因解

Windows服务器中IIS返回的网页错误代码大汇总及原因解析,这里还有关于Windows服务器IIS错误代码的教程,希望您能够喜欢并学到东西提升自己的知识与技能,下面是内容详细阅读:400 无法解析...

网址域名注册的流程是什么,网址域名注册的重要性与方法

1.什么是网址域名注册?网址域名注册是指通过国际最域名最构(简称“注册商”)注册一个最的域名作为网站的访问地址。2.为什么网址域名注册很重要?网址域名是网站访问的重要组成部分,好的网址域名可以增加网站...

Apache 配置详解(最好的APACHE配置教程)

Apache的配置Apache的配置由httpd.conf文件配置,因此下面的配置指令都是在httpd.conf文件中修改。 主站点的配置(基本配置)(1) 基本配置:ServerRoot...

电信主机托管是什么,选择最佳的托管方案

电信主机托管是指将服务器等计算机设备交由电信运营商进行管理、维护、监控等服务的一种方式。其特点是维护成本低、服务质量高、网络安全可靠。托管方案包括机柜托管、服务器托管、云托管等多种形式,在选择方案时需...