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

(0)

相关推荐

  • 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

  • 使用SpringBoot设置虚拟路径映射绝对路径

    目录 SpringBoot 设置虚拟路径映射绝对路径 下面我们就来代码实现下 springboot打war包图片的虚拟路径映射 在html图片的路径如图 然后要映射到阿里云Linux服务器上路径 映射方法 在Host节点加上下面的 这里顺便放上后台接收上传头像的代码 SpringBoot 设置虚拟路径映射绝对路径 上传图片到本地路径,得到的是一个绝对路径例如:D:\picpath\O48681516429132485.png 但是前台需要的数据是这样的 :http://localhost:808

  • FTP服务器设置虚拟目录(Serv-u与FileZilla Server)

    serv_u 服务器别名设置方法: Serv-u 设置虚拟目录 (版本6.3) 1. 点击"域" ,"设置", "虚拟路径","虚拟路径映射" 2. 添加"物理路径(需要映射的目录)",-> "映射物理路径到(设置的用户主目录或系统变量例如%home%)" ,->"映射的路径名称(虚拟目录的文件夹名,可随意取)". 3, 点击 "用户"

  • Windows下PHP开发环境搭建教程(Apache+PHP+MySQL)

    由于换电脑或重装系统后常需要重新搭建PHP环境,此次简单记录一下Windows下搭建PHP环境的过程,具体步骤可以参照网上资料 准备工作: Windows下手工搭建PHP环境需要先下载相应的软件,需要注意的是Apache与PHP的版本必须保持一致(均为32位或64位),如果版本不一致将导致整合Apache与PHP不成功,即修改配置文件后启动Apache报如下图所示的错误: 其实在http://windows.php.net/download/上有很详细的描述,读者可以根据自己的需要选择相应的版本

  • 阿里云CentOS7搭建Apache+PHP+MySQL环境

    最近要搭建一个阿里云的LMAP环境,选了CentOS7来做搭建. 1.Apache Centos7默认已经安装httpd服务,只是没有启动. 如果你需要全新安装,可以yum install -y httpd 启动服务:systemctl start httpd.service 设置开机自动启动:systemctl enable httpd.service Apache配置文件:/etc/httpd/conf/httpd.conf 项目默认存放目录为/var/www/html 你可以用vi来编辑或

  • linux(center OS7)安装JDK、tomcat、mysql 搭建java web项目运行环境

    一.安装JDK 1.卸载旧版本或者系统自带的JDK (1)列出所有已安装的JDK rpm -qa | grep jdk (2)卸载不需要的JDK yum -y remove 安装包名称 2.下载并解压JDK (1)下载安装包 进入到/usr/local目录下新建java目录 mkdir java ,在Java目录下使用wget指令下载安装包,如 wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2

  • CentOS 6.4安装配置LAMP服务器(Apache+PHP5+MySQL)

    准备篇: 1.配置防火墙,开启80端口.3306端口vi /etc/sysconfig/iptables-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT #允许80端口通过防火墙-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT #允许3306端口通过防火墙 备注:很多网友把这两条规则添加到防火墙配置的最后一行,导致防火墙启动失败, 正

  • linux下安装apache与php;Apache+PHP+MySQL配置攻略

    1.apache  在如下页面下载apache的for Linux 的源码包   http://www.apache.org/dist/httpd/;  存至/home/xx目录,xx是自建文件夹,我建了一个wj的文件夹. 命令列表:   cd /home/wj  tar -zxvf httpd-2.0.54.tar.gz mv httpd-2.0.54 apache  cd apache  ./configure --prefix=/usr/local/apache2 --enable-mod

  • windows8.1下Apache+Php+MySQL配置步骤

    软件版本: apache:Apache 2.4.6 Win64   PHP:PHP 5.5 VC11 x64 Non Thread Safe   MySql:5.5 win64 Mysql安装: 双击运行,设置用户名.密码.编码(utf8). PHP配置: 1.解压下载的zip文件到一个目录,本教程中为:D:\server\php 2.复制文件php.ini-development并改名为php.ini: 3.在php.ini文件中搜索关键字php_mysqli.dll,去掉该行前面的";&qu

  • apache php mysql开发环境安装教程

    apache php mysql开发环境搭建教程,分享给大家,供大家参考 0.资源链接: 360云盘:https://yunpan.cn/c6wpzYwbfmLJY (提取码:0190) 1.首先安装编译器环境 即如下文件: 2.安装apache+php+mysql 即如下文件: 2.1.安装apache 2.1.1安装 只说关键几点 2.1.1.1 2.1.1.2 2.1.1.3 2.1.1.4.在浏览器地址栏输入:localhost ,若出现以下页面,说明您已成功安装apache 2.1.2

随机推荐