• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

I need to change my document root in RH 7.2

Bateluer

Lifer
Silly RH made the partition for the WWW docs a mere 250 megs. I need to change the document root in the httpd.conf file to another directory, in my user's home directory.
However, I cannot edit the httpd.conf file as my user, so I logged into root (dangerous I know) to edit it. Below is the default.

# Documents
DocumentRoot /var/www/html
UserDir public_html
IndexOptions FancyIndexing

I want to change it to point to /home/Bateluer/HTML

After editting it in root it looked like this

# Documents
DocumentRoot /home/Bateluer/HTML
UserDir public_html
IndexOptions FancyIndexing

However, it still did not point to the that directory. How can i make it look in /home/Bateluer/HTML for the files?

 
You need to tell Apache to reload its config file.

You can either completely restart httpd, or just send SIGHUP to the daemon process.
 


<< You need to tell Apache to reload its config file.

You can either completely restart httpd, or just send SIGHUP to the daemon process.
>>



Restarting gave an error message. I am missing something in the config file, I am certain. How can I make it look in my user's home directory for all the web files?
 


<<
Restarting gave an error message. I am missing something in the config file, I am certain. How can I make it look in my user's home directory for all the web files?
>>



Well, you should debug the error message.

I haven't played with Apache in a little while, but that seems to be the correct directive.

These days I'm into J2EE, and most J2EE servers have a capable HTTP server built-in. Apache is extremely robust though.

Are you sure you want to change the document root for Apache?

Are you familiar with this type of URL: http://localhost/~bateluer

If the option is enabled in httpd.conf, that notation maps the request to a directory named public_html within the user bateluer's home directory, i.e.

/home/bateluer/public_html

Since you own the server, I can see why you want to alter the document root. However, this alternative feature also provides a similar end result.
 
I almost always change my document root from /var/whatever to /home/net/www , mostly because home has more space and I'm just used to that structure. Anyway, there were several addresses I needed to change, I just searched through the file and replaced anything resembling the old root with the new one.

Also, I use a "www" group instead of "apache" and add my user account to it by modifying the /etc/group file. It looks something like:
www:200:blahblahblah:apache,MYUSERNAME,SOMEOTHERNAME
and then I just chown -R the whole document root to apache.www . This way, Apache is happy and I can modify the files there without putting it in my own directory or making it chmod 777.
 
Back
Top