简体   繁体   中英

Apache new DocumentRoot

I used to have my apache server loading it's files from:

Library/Webserver/CGI-Executables/Location1

My new website is at a different location:

Library/Webserver/CGI-Executables/Location2

I changed all the paths in httpd.conf that linked to location1 to location2. Then i restarted the apache server. So first i killed the current running server:

sudo apachectl stop

Then checked my logs using:

ps -ef | grep "httpd"

This showed me that i successfully stopped the process. My next step was to start it again:

sudo apachectl start

Checked the logs again and it had the new processes on there. When i go onto localhost/index.html (which is the index file for location 2), it doesn't work. However if I enter in localhost/index.php (index file for location 1), the webpage works, which means that the apache server is still running from location 1.

When i check httpd.conf again, the location is still set to location 2, so this is where i'm getting a little overwhelmed. Logically, it looks like this should work, but for some reason it is still directing to the old path rather than the new path.

Is there some vital step i missed?

Check for 'Alias'.... May be you have the location1 path directing to some Alias path which is getting picked as you are checking for the location1 path but not Alias. Mostly in httpd.conf cgi script path has Alias by default.... But then this is an guess solution as normally the steps you have followed are correct and should have worked. Check 'ScriptAlias' directive also for your location1 path pointing to any Alias.....

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM