Apache為mysql以及自己的專案設定虛擬路徑

2021-05-25 23:25:38 字數 2844 閱讀 5442

include conf/extra/httpd-vhosts.conf(去掉前面的#)

2.httpd.conf中增加

#專案資料夾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

# # 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

#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

# # 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

3.在檔案apache2.2/conf/extra/httpd-vhosts.conf中增加:

複製** **如下:

#放在第乙個

serveradmin [email protected]

documentroot "d:/work/test"

servername test

errorlog "logs/dummy-host2.ies.inventec-error.log"

customlog "logs/dummy-host2.ies.inventec-access.log" common

serveradmin [email protected]

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

serveradmin [email protected]

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

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 //檢視專案路徑設定是否成功 

MySQL 設定 新增主鍵以及自增問題

1 學習mysql時我遇到過建立成功後,未對相關表設定主鍵的問題。現在找到解決方法與大家一起分享。不分大小寫 2 首先對於直接在建立表時設定主鍵 3 建立表後,將某列 col 或者將某屬性設定為主鍵 4 設定遞增,增長的屬性 alter table table name modify id int ...

MySQL 自聯結 自連線

例如想於下方表中找出與在 愛藝奇 公司的客戶同名的顧客。第一步 找出在 愛藝奇 的客戶的姓名,第二步 從全表中去查詢姓名與第一步查詢出來一樣的客戶 where cust name in in 不能寫成 不然容易報錯。因為子查詢有可能返回的是多條記錄。這跟子查詢只能返回單列無關,單列與單行。子查詢 s...

mysql自連線例項 Mysql自連線查詢例項詳解

自連線查詢 假想以下場景 某一電商 想要對站內產品做層級分類,乙個類別下面有若干子類,子類下面也會有別的子類。例如數碼產品這個類別下面有筆記本,台式電腦,智慧型手機等 筆記本,台式電腦,智慧型手機又可以按照品牌分類 品牌又可以按照 分類,等等。也許這些分類會達到乙個很深的層次,呈現一種樹狀的結構。那...