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

admin3年前服务器115

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

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

相关文章

什么是linux服务器代维,了解linux服务器代维的重要性

1.什么是linux服务器代维?linux服务器代维是指将linux服务器的管理和维护工作交给专业的服务商,让其负责服务器的配置、升级、补丁安装、监控,以及日常备份和数据恢复等工作。这种方式可以让企业...

免费代理ip好找吗,如何免费获取代理ip

1.免费代理ip解析代理IP是指在代理服务器上运行的一个IP地址,用户通过其与互联网进行通信,从而达到最自己真实IP地址的效果。免费代理IP指无需支付资源费用,即可获取的代理IP地址。2.免费代理ip...

Web服务器识别技术揭秘

[一]用nc查看web服务器返回的HTTP报头语法为 nc zzvips 80[二]根据URL中的元素扩展名采用的技术服务器平台.plPerlCGI脚本各种平台,一般是Unix.asp活动服务器页面M...

简单两步修改Win系统远程桌面端口3389

为了网络安全,为了保护自己的隐私,我们需要将自己的电脑远程桌面端口3389进行修改,防止漏洞被黑客攻击。漏洞的存在危害极大,小到文件被窃取,大到私密文件被曝光,银行账号密码被盗用。下面来详细操作如何修...

什么是秒解服务器,了解秒解服务器及其作用

1.“秒解服务器”的概念“秒解服务器”是指一种特殊的服务器,其功能主要是在一定的时间范围内自动解决所面临的问题,并确保服务的高可用性。这种服务器相对于传统的服务器而言,速度更快、功能更强,能够保障大量...

护卫神主机大师Linux版安装及卸载

护卫神·主机大师Linux支持主流的Linux发行版本(64位):CentOS:6.9/6.10/7.2/7.3/7.4/7.5/7.6/7.7/7.8/8.0/8.1/8.2Ubuntu:14.04...