Apache為mysql以及自己的項(xiàng)目設(shè)置虛擬路徑
更新時(shí)間:2009年12月11日 16:26:20 作者:
Apache為mysql以及自己的項(xiàng)目設(shè)置虛擬路徑
1.Apache2.2\conf\httpd.conf中釋放:
Include conf/extra/httpd-vhosts.conf(去掉前面的#)
2.httpd.conf中增加
<Directory "E:/work/test"> #項(xiàng)目文件夾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> #放在第一個(gè)
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 //查看數(shù)據(jù)庫(kù)設(shè)置是否成功
http://test/index.php //查看項(xiàng)目路徑設(shè)置是否成功
Include conf/extra/httpd-vhosts.conf(去掉前面的#)
2.httpd.conf中增加
<Directory "E:/work/test"> #項(xiàng)目文件夾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中增加:
復(fù)制代碼 代碼如下:
<VirtualHost *:80> #放在第一個(gè)
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 //查看數(shù)據(jù)庫(kù)設(shè)置是否成功
http://test/index.php //查看項(xiàng)目路徑設(shè)置是否成功
相關(guān)文章
詳解Linux 主機(jī)網(wǎng)絡(luò)接入配置
這篇文章主要介紹了詳解Linux 主機(jī)網(wǎng)絡(luò)接入配置的相關(guān)資料,希望通過(guò)本文能幫助到大家,讓大家實(shí)現(xiàn)網(wǎng)絡(luò)接入配置的功能,需要的朋友可以參考下2017-10-10
淺談Linux下免密碼切換到root用戶當(dāng)注意的問(wèn)題
下面小編就為大家?guī)?lái)一篇淺談Linux下免密碼切換到root用戶當(dāng)注意的問(wèn)題。小編覺得挺不錯(cuò)的。現(xiàn)在就分享給大家。也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2016-12-12
vsftp上傳553 Could not create file錯(cuò)誤解決
本篇文章給大家分享了在vsftp上傳文件的時(shí)候出現(xiàn)了553 Could not create file錯(cuò)誤,針對(duì)這個(gè)錯(cuò)誤我們給出了解決辦法,一起學(xué)習(xí)下。2017-12-12
XShell免費(fèi)版的安裝配置教程及使用保姆級(jí)教程
XShell?是一種流行且簡(jiǎn)單的網(wǎng)絡(luò)程序,旨在模擬虛擬終端,這篇文章主要介紹了XShell免費(fèi)版的安裝配置教程以及使用教程,需要的朋友可以參考下2022-08-08

