Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Using a temporary DocumentRoot without modifying apache configuration  (Read 1876 times)

0 Members and 1 Guest are viewing this topic.

rohitj

  • Guest
Using a temporary DocumentRoot without modifying apache configuration


If you want to test the working of a website without modifying the httpd.conf file and  original files under the default DocumentRoot, do the following.

Take a copy of your original DocumentRoot directory (/var/www/html) to a new temporary DocumentRoot directory (/var/www/html_debug). Make all your changes under this temporary DocumentRoot directory (/var/www/html_debug) and start the Apache with this temporary directory as shown below using option -c.

httpd -k start -c "DocumentRoot /var/www/html_debug/"

If you want to go back to original configuration using the default DocumentRoot (/var/www/html), simply restart the Apache as shown below.

# httpd -k stop
# apachectl start


Done...  :)