I need to change my document root in RH 7.2

Bateluer

Lifer
Jun 23, 2001
27,730
8
0
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?

 

manly

Lifer
Jan 25, 2000
11,337
2,355
136
You need to tell Apache to reload its config file.

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

Bateluer

Lifer
Jun 23, 2001
27,730
8
0


<< 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?
 

manly

Lifer
Jan 25, 2000
11,337
2,355
136


<<
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.
 

Kadesh

Member
Apr 27, 2001
78
0
0
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.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |