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

 更新时间:2009年12月11日 16:26:20   作者:  
Apache为mysql以及自己的项目设置虚拟路径
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
# http://httpd.apache.org/docs/2.2/mod/core.html#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
# http://httpd.apache.org/docs/2.2/mod/core.html#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.在浏览器中输入:
http://mysql/index.php //查看数据库设置是否成功
http://test/index.php //查看项目路径设置是否成功

相关文章

  • linux安装git的方法步骤

    linux安装git的方法步骤

    这篇文章主要介绍了linux安装git的方法步骤,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
    2018-12-12
  • 详解Linux 主机网络接入配置

    详解Linux 主机网络接入配置

    这篇文章主要介绍了详解Linux 主机网络接入配置的相关资料,希望通过本文能帮助到大家,让大家实现网络接入配置的功能,需要的朋友可以参考下
    2017-10-10
  • Linux下浅谈crond与crontab的命令用法

    Linux下浅谈crond与crontab的命令用法

    本篇文章主要介绍了Linux下浅谈crond与crontab的用法,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
    2017-06-06
  • windows apache多端口虚拟主机配置方法

    windows apache多端口虚拟主机配置方法

    有很多朋友喜欢在windows下使用apache作为web服务器,有时候想用非80端口提供服务,因为未备案域名都是封了80端口,提供下载的时候可以用别的端口了,这里简单分享下,方便需要的朋友
    2013-03-03
  • 浅谈Linux下免密码切换到root用户当注意的问题

    浅谈Linux下免密码切换到root用户当注意的问题

    下面小编就为大家带来一篇浅谈Linux下免密码切换到root用户当注意的问题。小编觉得挺不错的。现在就分享给大家。也给大家做个参考。一起跟随小编过来看看吧
    2016-12-12
  • Apache Web服务器的完全安装指南

    Apache Web服务器的完全安装指南

    本文讨论如何安装支持mod_perl、mod_ssl及php的apache web服务器,并安装webalizer实现对web访进行日志分析。手把手引导初学者编辑一个安全、功能完备的web服务器系统。
    2010-12-12
  • vsftp上传553 Could not create file错误解决

    vsftp上传553 Could not create file错误解决

    本篇文章给大家分享了在vsftp上传文件的时候出现了553 Could not create file错误,针对这个错误我们给出了解决办法,一起学习下。
    2017-12-12
  • 基于 Apache 的 httpd 文件服务器详解

    基于 Apache 的 httpd 文件服务器详解

    httpd HTTP Daemon,超文本传输协议守护进程的简称,运行于网页服务器后台,等待传入服务器请求的软件,这篇文章主要介绍了基于 Apache 的 httpd 文件服务器,需要的朋友可以参考下
    2024-07-07
  • Linux系统下Tomcat使用80端口的方法

    Linux系统下Tomcat使用80端口的方法

    这篇文章主要给大家介绍了关于Linux系统下Tomcat使用80端口的相关资料,文中通过示例代码介绍的非常详细,对大家学习或者使用Tomcat具有一定的参考学习价值,需要的朋友们下面来一起学习学习吧
    2019-12-12
  • XShell免费版的安装配置教程及使用保姆级教程

    XShell免费版的安装配置教程及使用保姆级教程

    XShell 是一种流行且简单的网络程序,旨在模拟虚拟终端,这篇文章主要介绍了XShell免费版的安装配置教程以及使用教程,需要的朋友可以参考下
    2022-08-08

最新评论