How to modify the httpd.conf in FC5 using an editor

Posted on 2006-05-09
Medium Priority
Last Modified: 2010-03-04
I am running Apache on Fedora Core 5.
It was working fine.

Now, I  have installed a new hard disk with  data  on to the machine.
I would like to point  my document root to the new hard disk.

So I tried to edit the /etc/httpd/conf/ httpd.conf . Changed the line
Document root to a new location from /var/www/html to /data3/webdat

However, when I restart the httpd service I get a FAILED error.
I realised that I cannot make any changes to http.conf file.

How could I go about successfully editing the httpd.conf file?  

Question by:asidu
  • 3
  • 2
LVL 27

Expert Comment

ID: 16665151
apachectl -t
to figure out the problem with config file.
You may change httpd.conf file and restart apache as many times as you want.
LVL 12

Author Comment

ID: 16707264
I modified the /etc/httpd/conf/httpd.conf file
and run the command apachectl -t
I only changed one line to point the Document root to another location...and the result is shown below :-

[root@deskpro etc]# apachectl configtest
Syntax OK
[root@deskpro etc]# service httpd start
Starting httpd: [FAILED]

Do I have to worry or take care of any security settings ?

Thank u.

Assisted Solution

lamxing earned 600 total points
ID: 16714115
not sure if this helps, but try using this to stop and start your apache server instead:
    apachectl stop
    apachectl start

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

LVL 27

Accepted Solution

Nopius earned 900 total points
ID: 16714154
Try to start httpd manually in debug mode:
httpd -c "LogLevel debug" -X

then look inside error_log, it's probably in /etc/httpd/logs/
LVL 12

Author Comment

ID: 16716137
Thanks guys for the pointers.
Really the problem was with the SeLinux.

What I did is
[root@deskpro run]# sestatus -v
SELinux status:                 enabled
SELinuxfs mount:                /selinux
Current mode:                   enforcing
Mode from config file:         enforcing
Policy version:                     20
Policy from config file:        targeted

change the Current mode from enforcing to permissive  by
[root@deskpro run]# setenforce 0

[root@deskpro run]# sestatus -v
SELinux status:                 enabled
SELinuxfs mount:                /selinux
Current mode:                   permissive
Mode from config file:          enforcing
Policy version:                 20
Policy from config file:        targeted

After doing that I can restart apache server without problems.

Now able to modify the httpd.conf file without an issue.

Would there be an issue to make the Current mode permissive ?

LVL 12

Author Comment

ID: 16730778
Would like to close the question and award points to all those who responded.


Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Integration Management Part 2
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month16 days, 21 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question