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

Posted on 2006-05-09
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
    LVL 27

    Expert Comment

    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

    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

    not sure if this helps, but try using this to stop and start your apache server instead:
        apachectl stop
        apachectl start

    LVL 27

    Accepted Solution

    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

    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

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


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
    Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now