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

admin3年前服务器71

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

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

相关文章

Apache2与PHP5 for WinXP简单配置技巧

一.php的安装与调试        由于php是一个zip文件(非install版),安装较为简单,解压就行。把解压的...

linux下要怎样安装php环境(linux怎么安装php环境)

本文将介绍如何在Linux系统中安装PHP环境。在Ubuntu系统中,使用以下命令安装Apache:```sudo apt-get updatesudo apt-get install apache2...

Apache下怎么提高服务器的安全性

Apache下提高服务器安全性的方法:1、建立一个.htaccess文件,输入相关代码提高服务器的安全性,这种方法主要适用于没有服务器管理权限;2、修改apache配置文件,在配置中增加相关代码,这种...

Apache怎么在本地建立泛域名虚拟主机

Apache在本地建立泛域名虚拟主机的方法:1、修改apache安装目录下的conf/httpd.conf文件;2、修改完成后保存,然后重启apache;3、打开c:\windows\system32...

Apache源码安装和虚拟主机配置的教程详解

源码安装Apache 1.上传Apache源码安装所需软件包2.安装:安装顺序apr—>apr-util—>pcre—>httpd安装编...

Apache,IIS下Discuz x1.5伪静态设置方法

1.如是Apache服务器,操作如下:建立.htaccess文件,在该文件里面写入如下伪静态规则:复制代码 代码如下:# 将 RewriteEngine 模式打开RewriteEngine On# 修...