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

admin3年前服务器54

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

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

相关文章

为什么选择广东服务器托管,广东服务器托管的优势

1.什么是广东服务器托管?广东服务器托管是指将服务器机器放在广东的数据中心进行存储和管理,由专业的运维人员负责维护、管理、优化服务器,保证服务器的稳定运行。2.广东服务器托管的优势稳定性高广东作为最信...

Nginx vs Apache两大web服务器比较

互联网从90年代开始席卷全球,现如今基本上所有业务都可以在互联网上完成,互联网已经成为我们生活中不可或缺的一部分。那么互联网web协议是怎样的呢?可以概括为访问者从给定的Web站点请求文档,而DNS和...

什么是便宜域名注册,你需要知道的事情

1.便宜域名注册便宜域名注册是指在域名注册商处注册域名,以极低的价格获取域名的过程。很多域名注册商在促销或者节日等特定时间会推出一些超级优惠活动,如新用户注册、打折和优惠券等,让用户在获取域名的过程中...

哪个云服务器好,最几款最的云服务器

云服务器是一种互联网技术,允许用户使用远程服务器托管自己的应用程序和数据。随着云计算技术的发展,越来越多的企业和个人选择使用云服务器。那么,哪个云服务器好呢?这个问题没有固定的答案,因为用户的需求不同...

为什么越来越多的人选择使用cn域名,cn域名成为我国主流域名的原因

1.什么是cn域名?cn域名是中国最最域名(ccTLD),是中国的互联网标志。cn域名是由最信息产业部、中国互联网络信息中心(CNNIC)授权管理。2.cn域名的使用情况截至目前,cn域名已成为我国主...

为什么要购买虚拟主机,选择虚拟主机购买的5个优点

1.什么是虚拟主机?虚拟主机是指通过将一台服务器划分成多个部分,每个部分都可以作为一个独立的主机,使多个网站共享一台服务器的资源而达到低成本的一种托管方式。2.虚拟主机购买的5个优点成本低购买虚拟主机...