How To Change DocumentRoot in Apache2 on Gentoo!

Is your first time on TechnoSNACK? Subscribe our feeds!  


After about an hour of trying to change the DocumentRoot on Apache2 I finally found it. Instead of having Apache run /var/www/localhost/ I wanted it to point to my /home/clinton/projects/ directory so it was more convenient for testing purposes.

Everyone says, go to the etc/apache2/httpd.conf I added the DocumentRoot code and the "Directory ..." but after restarting the server multiple times, it still pointed to the /var/www/localhost directory.

I was like, HELL!!!


Then I found this file in the /etc/apache2/vhosts.d/ directory named default_vhosts.include

I went # nano /etc/apache2/vhosts.d/default_vhosts.include and behold there it was.

I changed the directory to: DocumentRoot "/home/clinton/projects"
and then Derectory "/home/clinton/projects"..

# /etc/init.d/apache2 restart

Refreshed it in FireFox: http://localhost/...

[Read more →]

SOURCE: http://crazywebdevelopers.blogspot.com/

Discussion Area - Leave a Comment