Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Servers & Networking
FedoraForum Search

Forgot Password? Join Us!

Servers & Networking Discuss any Fedora server problems and Networking issues such as dhcp, IP numbers, wlan, modems, etc.

Reply
 
Thread Tools Search this Thread Display Modes
  #31  
Old 25th November 2008, 03:39 PM
biggsk's Avatar
biggsk Offline
Registered User
 
Join Date: Aug 2007
Location: The Bay, Florida
Age: 31
Posts: 194
Does the line DocumentRoot look like this:

Code:
DocumentRoot "/home/chris/Public/www"
?
__________________
Dell Inspirion 1520
Intel® Pentium® Dual-Core Mobile Processor T2370
4GB, DDR2, 667MHz
250GB 5400RPM SATA Hard Drive
Intel Integrated Graphics Media Accelerator 3100
Dell Wireless 1395 802.11g Mini Card

My tech blog(s):
http://blog.biggsenterprises.net

:eek:
Reply With Quote
  #32  
Old 25th November 2008, 04:13 PM
chrisk Offline
Registered User
 
Join Date: Nov 2008
Location: Surrey, BC
Posts: 33
pasted from my http.conf file: DocumentRoot "/home/chris/Public/www"

Jordanlw: I removed the / from <Directory />

[root@webserver ~]# /sbin/service httpd restart
Stopping httpd: [FAILED]
Starting httpd: httpd: Syntax error on line 341 of /etc/httpd/conf/httpd.conf: </Directory> without matching <Directory> section
[FAILED]
[root@webserver ~]#

There may be a problem somewhere else, pasting a large section of the http.conf file:

#<Directory "/var/www/html">
#<Directory "/home/chris/Public/www">

<Directory>
Options FollowSymLinks
AllowOverride None
</Directory>

#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
#I'll add opening <Directory> here, seems to be missing from the default http.conf file
Options Indexes FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None

#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all

</Directory>

It looks like the above line may be causing a problem, no matching <Directory>



I added the opening <Directory>

[root@webserver ~]# /sbin/service httpd restart
Stopping httpd: [FAILED]
Starting httpd: Syntax error on line 281 of /etc/httpd/conf/httpd.conf:
DocumentRoot must be a directory
[FAILED]
[root@webserver ~]#


Back to the earlier error.
Reply With Quote
  #33  
Old 25th November 2008, 04:58 PM
chrisk Offline
Registered User
 
Join Date: Nov 2008
Location: Surrey, BC
Posts: 33
Guys,

who should own my www directory, currently Apache owns it, is that the way it should be?

Chris
Reply With Quote
  #34  
Old 25th November 2008, 05:29 PM
marcrblevins's Avatar
marcrblevins Offline
Registered User
 
Join Date: Jun 2006
Location: Texas
Age: 42
Posts: 4,168
My directions when using /home/marc/public_html:
Code:
chmod 711 /home/marc
chmod 755 /home/marc/public_html
setsebool -P httpd_enable_homedirs 1
Can you show us:
Code:
ls -Z /home/chris/Public

Last edited by marcrblevins; 25th November 2008 at 05:35 PM.
Reply With Quote
  #35  
Old 25th November 2008, 05:35 PM
marcrblevins's Avatar
marcrblevins Offline
Registered User
 
Join Date: Jun 2006
Location: Texas
Age: 42
Posts: 4,168
Sorry was on page one when posted.
apache should not own your own /home files period. It was just a trial/error to see if it works.

Change it back.
Code:
su -
chown -r chris:chris /home/chris
Reply With Quote
  #36  
Old 25th November 2008, 05:37 PM
chrisk Offline
Registered User
 
Join Date: Nov 2008
Location: Surrey, BC
Posts: 33
[root@webserver ~]# ls -Z /home/Chris/Public
ls: cannot access /home/Chris/Public: No such file or directory

[root@webserver ~]# ls -Z /home/chris/Public
drwxr-xr-x apache apache unconfined_u:object_r:user_home_t:s0 www
[root@webserver ~]#
Reply With Quote
  #37  
Old 25th November 2008, 05:46 PM
marcrblevins's Avatar
marcrblevins Offline
Registered User
 
Join Date: Jun 2006
Location: Texas
Age: 42
Posts: 4,168
From 'man httpd_selinux':
Code:
       httpd  by default is not allowed to access users home directories.  If you want to allow access to users home directories you
       need to set the httpd_enable_homedirs boolean and change the context of the files that you want people to access off the home
       dir.

       setsebool -P httpd_enable_homedirs 1
       chcon -R -t httpd_sys_content_t ~user/public_html
Reply With Quote
  #38  
Old 25th November 2008, 06:08 PM
chrisk Offline
Registered User
 
Join Date: Nov 2008
Location: Surrey, BC
Posts: 33
[root@webserver ~]# setsebool -P httpd_enable_homedirs 1
[root@webserver ~]# chcon -R -t httpd_sys_content_t ~user/public_html
chcon: cannot access `~user/public_html': No such file or directory

[root@webserver ~]# chcon -R -t httpd_sys_content_t /home/chris/Public/www
[root@webserver ~]# /sbin/service httpd restart
Stopping httpd: [FAILED]
Starting httpd: Syntax error on line 281 of /etc/httpd/conf/httpd.conf:
DocumentRoot must be a directory
[FAILED]
[root@webserver ~]#
Reply With Quote
  #39  
Old 25th November 2008, 06:11 PM
marcrblevins's Avatar
marcrblevins Offline
Registered User
 
Join Date: Jun 2006
Location: Texas
Age: 42
Posts: 4,168
Fix this part:
Starting httpd: Syntax error on line 281 of /etc/httpd/conf/httpd.conf:
DocumentRoot must be a directory
[FAILED]
What is it set to now?
Can you attach that httpd.conf somewhere so I can compare to the original?
Reply With Quote
  #40  
Old 25th November 2008, 06:31 PM
chrisk Offline
Registered User
 
Join Date: Nov 2008
Location: Surrey, BC
Posts: 33
posted http.conf to my domain
Reply With Quote
  #41  
Old 25th November 2008, 07:34 PM
marcrblevins's Avatar
marcrblevins Offline
Registered User
 
Join Date: Jun 2006
Location: Texas
Age: 42
Posts: 4,168
Chris,
Open up that httpd.conf file and remove in RED.

Partial of your httpd.conf below:
Code:
#
# This should be changed to whatever you set DocumentRoot to.
#
#<Directory "/var/www/html">

#<Directory "/home/chris/Public/www">

<Directory>
    Options FollowSymLinks
    AllowOverride None
</Directory>

#
# Possible values for the Options directive are "None", "All",
# or any combination of:
#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important.  Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
And then do:
Code:
service httpd restart
Reply With Quote
  #42  
Old 25th November 2008, 07:35 PM
marcrblevins's Avatar
marcrblevins Offline
Registered User
 
Join Date: Jun 2006
Location: Texas
Age: 42
Posts: 4,168
Note:
You had duplicate of this:
Code:
<Directory>
    Options FollowSymLinks
    AllowOverride None
</Directory>
Therefore that is why I'm telling you to delete that ONE specific spot. Hope it goes well.
Reply With Quote
  #43  
Old 25th November 2008, 08:05 PM
chrisk Offline
Registered User
 
Join Date: Nov 2008
Location: Surrey, BC
Posts: 33
Quote:
Note:
You had duplicate of this:
Code:

<Directory>
Options FollowSymLinks
AllowOverride None
</Directory>
Just followed directions given earlier.

Changed:
Code:
#<Directory "/home/chris/Public/www">
<Directory>
    Options FollowSymLinks
    AllowOverride None
</Directory>
Back to:
Code:
#
DocumentRoot "/home/chris/Public/www"
#
[root@webserver ~]# /sbin/service httpd restart
Stopping httpd: [FAILED]
Starting httpd: Syntax error on line 282 of /etc/httpd/conf/httpd.conf:
DocumentRoot must be a directory
[FAILED]
[root@webserver ~]#

Thought I would try this
Code:
<Directory>
DocumentRoot "/home/chris/Public/www"
</Directory>
[root@webserver ~]# /sbin/service httpd restart
Stopping httpd: [FAILED]
Starting httpd: Syntax error on line 281 of /etc/httpd/conf/httpd.conf:
<Directory> directive requires additional arguments
[FAILED]
[root@webserver ~]#

At least that changed the nature of the error....
Reply With Quote
  #44  
Old 25th November 2008, 11:38 PM
biggsk's Avatar
biggsk Offline
Registered User
 
Join Date: Aug 2007
Location: The Bay, Florida
Age: 31
Posts: 194
Ok. Do this:
Restore your original httpd.conf
Then modify only the DocmentRoot line to:
Code:
DocumentRoot "/home/chris/Public/www"
Then restart the httpd service.

I just tested it here on my box and it worked.
__________________
Dell Inspirion 1520
Intel® Pentium® Dual-Core Mobile Processor T2370
4GB, DDR2, 667MHz
250GB 5400RPM SATA Hard Drive
Intel Integrated Graphics Media Accelerator 3100
Dell Wireless 1395 802.11g Mini Card

My tech blog(s):
http://blog.biggsenterprises.net

:eek:
Reply With Quote
  #45  
Old 26th November 2008, 12:05 AM
chrisk Offline
Registered User
 
Join Date: Nov 2008
Location: Surrey, BC
Posts: 33
This time I got

[root@webserver ~]# /sbin/service httpd restart
Stopping httpd: [FAILED]
Starting httpd: httpd: Syntax error on line 309 of /etc/httpd/conf/httpd.conf: /etc/httpd/conf/httpd.conf:309: <Directory> was not closed.

So I closed the directory:
<Directory "/home/chris/Public/www">
</Directory>

Right back where we started:

[root@webserver ~]# /sbin/service httpd restart
Stopping httpd: [FAILED]
Starting httpd: Syntax error on line 282 of /etc/httpd/conf/httpd.conf:
DocumentRoot must be a directory
Reply With Quote
Reply

Tags
apache, configuration

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SELinux/Apache Configuration Madeye Servers & Networking 1 23rd February 2011 10:48 PM
SSL and Apache configuration problem rawand Servers & Networking 2 2nd September 2009 09:05 AM
cgi-perl and apache configuration venu Programming & Packaging 2 14th November 2008 12:51 PM
Apache configuration question leaded Servers & Networking 2 30th August 2006 08:05 PM


Current GMT-time: 12:34 (Saturday, 18-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat