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

admin3年前服务器59

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

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

相关文章

Apache虚拟主机的配置和泛域名解析实现代码

虚拟主机的配置  基于IP地址的虚拟主机配置  Listen 80  DocumentRoot /www/zz  ServerName zz  DocumentRoot /www/zz2  Serve...

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

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

传说中的反向代理,Nginx+Apache软件配置Web服务器

前言nginx和apache是互联网时代最为流行的两种Web服务器软件。nginx高并发性能出众,占用系统资源少,成为了很多企业web服务器的首选。但是由于nginx对于处理php等动态页面的处理十分...

Ubuntu16.04搭建WordPress的方法(ubuntu部署wordpress)

Ubuntu16.04搭建WordPress的方法及ubuntu部署wordpressWordPress是一款非常流行的开源博客系统,它拥有丰富的插件和主题资源,可以满足不同用户的需求。而Ubuntu...

使用Apache&amp;花生壳架设Web服务器

这里讲的是IIS服务器,其实花生壳在Apache下也能正常使用,这一点我在以前的帖子中已经讲过,现在专门把Apache的配置作一详细说明:首先:当然是下载Apache啦,Apache目前最新的Wind...

Windows环境开发PHP完整配置教程Apache+Mysql+PHP

软件准备:主要讲解Apache,Mysql,PHP,以及PhpMyAdmin的安装配置。开发工具自备。Apache的安装:注:本例只截取需要注意的截图,其它默认则不显示。1.服务器信息可以按照默认配置...