如何將我的默認xampp本地主機c:xampp/htdoc
更改爲另一個文件夾,即c:/alan
?當我使用IP地址時,我應該能夠在C:/alan
中查看我的網站文件。如何將xampp localhost更改爲另一個文件夾(xampp文件夾外部)?
感謝您的幫助。
如何將我的默認xampp本地主機c:xampp/htdoc
更改爲另一個文件夾,即c:/alan
?當我使用IP地址時,我應該能夠在C:/alan
中查看我的網站文件。如何將xampp localhost更改爲另一個文件夾(xampp文件夾外部)?
感謝您的幫助。
編輯的httpd.conf文件並替換線的DocumentRoot 「/ home/user中/ WWW」到您喜歡的一個。
默認DocumentRoot對於windows [以上是linux],路徑將有所不同。
請按照@ Sourav的建議。
如果重新啓動服務器後出現錯誤,則可能還需要設置目錄選項。這在httpd.conf中的<Directory>
標記中完成。確保最終的配置是這樣的:
DocumentRoot "C:\alan"
<Directory "C:\alan">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
感謝您的快速回放..im讚賞它..你可以告訴我哪一行我需要改變它。? – enrekan2011 2012-01-13 08:29:41
對不起,幫不了你。只需在你的php.ini中搜索「DocumentRoot」。 '
對我來說這是對管線183,但您重新啓動計算機後,它纔會起作用。我希望有一種方法可以在不必每次重新啓動的情況下快速更改它,但現在這是我知道如何做的唯一方法。
要使更改生效,您需要重新啓動apache服務。 – inf1ux 2013-03-15 23:41:41
以防萬一有人查找此,路徑是在linux Sourav答案(httpd.conf文件),該文件是/opt/lampp/etc/httpd.conf
@Hooman:實際上是與Xampp的最新版本不需要知道配置或日誌文件的位置;在控制面板中,您可以爲每個工具(php,mysql,tomcat ...)提供日誌和配置按鈕,並單擊它們以打開所有相關文件(甚至可以使用頂部的常規配置按鈕更改默認編輯應用程序對)。爲設計它的人做好了!
它可以分兩步來完成的Ubuntu 14.04與Xampp 1.8.3-5
第1步: -變化DocumentRoot
和/opt/lampp/etc/httpd.conf
到 DocumentRoot "/home/user/Desktop/js"
Directory
路徑從
DocumentRoot "/opt/lampp/htdocs"
和
和Directory "/home/user/Desktop/js"
第二步: - 更改文件夾(和它的父文件夾到777路) 例如,通過
sudo chmod -R 777 /home/user/Desktop/js
我有權利更改都httpd.conf中和的httpd-SSL .conf文件DocumentRoot屬性來獲取相關鏈接(即href =「/ index.html」)和favicon.ico鏈接正常工作。
最新的Xampp控制面板使這非常容易。
從控制面板,第一行應該有Apache。如果它已經開始,請停止它。然後點擊config並打開httpd.conf文件並搜索htdocs或documentRoot。改變你喜歡的路徑。對httpd-ssl.conf執行相同的操作。這些應該是Config下拉列表中排名前2的文件。
然後再次啓動服務器。
希望這可以幫助別人。乾杯。
步驟:
更換
DocumentRoot "C:/xampp/htdocs"
<Directory "C:/xampp/htdocs">
那兩條線
| C:/ xampp/htdocs ==根目錄的當前位置
|將C:/ xampp/htdocs更改爲您想要的任何位置|
DONE: 啓動apache並轉到動作本地主機見[watch video click here]
Thnaks。這個視頻鏈接對於理解這個解決方案非常明確。 – Faisal 2016-02-11 08:46:10
在Linux薄荷(基於Debian)去/opt/lampp/etc/httpd.conf
找到YOUR_OWN_FILES_LOCATION爲當然你的文件位置。
DocumentRoot "YOUR_OWN_FILES_LOCATION"
<Directory "YOUR_OWN_FILES_LOCATION">
#
# 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/trunk/mod/core.html#options
# for more information.
#
#Options Indexes FollowSymLinks
# XAMPP
Options Indexes FollowSymLinks ExecCGI Includes
#
# 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
# since XAMPP 1.4:
AllowOverride All
#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>
感謝您的快速回復並回答我的問題。你能告訴我哪一行我想改變嗎?因爲我改變了它,但它不適合我。 – enrekan2011 2012-01-13 08:31:47
嘗試重新啓動Apache服務器 – user1006274 2014-05-23 17:53:12
你最好使備份配置文件與其他名稱,爲可以恢復配置的情況下,錯誤的設置 – 2017-02-22 18:10:25