How do I change default directory and index file for Apache (installed via XAMPP) [closed]

北慕城南 提交于 2019-12-22 05:43:07

问题


How do I change default Directory and index File for Apache (installed via XAMPP) so instead of looking for htdocs and index, it looks for myPath and myFile, respectively?


回答1:


The research link you pasted has the first part of the answer to your question, changing the path you want serve but the second part of your question, making it serve "myFile" as the Index is an additional step. See:

http://httpd.apache.org/docs/2.0/mod/mod_dir.html#directoryindex

So you would add this line inside the relevant tags or even loose in the main httpd.conf file (see the Context section of the above link for valid places to use this directive):

DirectoryIndex myFile.ext

Hope this helps.




回答2:


Edit the httpd.conf file - the DocumentRoot directory can be updated to whichever directory you would like (and that the process has permissions to). See:

http://httpd.apache.org/docs/2.0/mod/core.html#documentroot

DocumentRoot /usr/web 


来源:https://stackoverflow.com/questions/6077238/how-do-i-change-default-directory-and-index-file-for-apache-installed-via-xampp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!