Changing Default Webroot for an Apache 2.0 server on Linux Redhat

Hi i'm currently running a webserver (Apache 2.0) on Linux redhat and right now it's configured so that when i type in http://myipaddress the local directory that it "points" to is /usr/local/apache/htdocs how do i change it so it points to another directory, eg /var/www/html?

thanks.
SenbonzakuraAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
psychic_zeroConnect With a Mentor Commented:
Find httpd.conf file in your Apache web server directory, usually at /usr/local/apache/conf/ . Open the file using any text editor and find:

DocumentRoot "/usr/local/apache/htdocs"
and
<Directory "/usr/local/apache/htdocs">

Change both directory to the new webroot

DocumentRoot "/var/www/html"
and
<Directory "/var/www/html">

Save the httpd.conf file and restart the web server.
0
All Courses

From novice to tech pro — start learning today.