问题
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