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
  #1  
Old 28th December 2008, 07:25 AM
pushback Offline
Registered User
 
Join Date: Jun 2005
Location: Bay Area, California
Posts: 167
Permission Denied on index.html

Putting up a brand new server and will be virtual hosting several domains. I am getting the following error in my error_log file when I try to access index.html for a virtual server:

==> error_log <==
[Sat Dec 27 23:12:51 2008] [error] [client 64.81.53.147] (13)Permission denied: access to /index.html denied


Permissions on the index.html are currently 755:

ls -l
total 4
-rwxrwxrwx 1 apache apache 15 2008-12-27 21:06 index.html


and the directory is 755

Here's the part of httpd.conf that I changed:

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
#
# NOTE: NameVirtualHost cannot be used without a port specifier
# (e.g. :80) if mod_ssl is being used, due to the nature of the
# SSL protocol.
#

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>

<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /home/jek/www/fred
ServerName fred.com:80
ServerAlias www.fred.com
ErrorLog /var/log/httpd/error_fred_log
CustomLog /var/log/httpd/access_fred_log common
</VirtualHost>
Reply With Quote
  #2  
Old 28th December 2008, 10:00 AM
marcrblevins's Avatar
marcrblevins Offline
Registered User
 
Join Date: Jun 2006
Location: Texas
Age: 42
Posts: 4,168
Code:
su -
chmod 711 /home/jek
chmod 755 /home/jek/www
setsebool -P httpd_enable_homedirs 1
chcon -R -t httpd_sys_content_t /home/jek/www
service httpd restart
Reply With Quote
  #3  
Old 29th December 2008, 12:12 AM
pushback Offline
Registered User
 
Join Date: Jun 2005
Location: Bay Area, California
Posts: 167
Quote:
Originally Posted by marcrblevins View Post
Code:
su -
chmod 711 /home/jek
chmod 755 /home/jek/www
setsebool -P httpd_enable_homedirs 1
chcon -R -t httpd_sys_content_t /home/jek/www
service httpd restart
I don't recall having to do setsebool or chcon on my older servers, but hey--it worked. Thanks for the help.
Reply With Quote
  #4  
Old 29th December 2008, 01:49 AM
JohnVV's Avatar
JohnVV Offline
Registered User
 
Join Date: Aug 2005
Location: Ann Arbor
Age: 45
Posts: 3,907
fedora 9 and 10 that is needed to be done .Fedora 8 ,7 the setbool and chcon was not needed to get it working .
__________________
Running Arch ,OpenSUSE 11.4-64bit & Scientific Linux 6.1-64bit ( fedora 4 to 11)
My Celestia Downloads

http://celestiamotherlode.net/catalo...?creator_id=10
Reply With Quote
  #5  
Old 30th December 2008, 01:28 AM
zackf Offline
Registered User
 
Join Date: Nov 2006
Location: South Carolina
Posts: 798
What do setbool and chcon do?
Reply With Quote
  #6  
Old 30th December 2008, 03:28 AM
JohnVV's Avatar
JohnVV Offline
Registered User
 
Join Date: Aug 2005
Location: Ann Arbor
Age: 45
Posts: 3,907
read
Code:
man setsebool
-- and --
man chcon
__________________
Running Arch ,OpenSUSE 11.4-64bit & Scientific Linux 6.1-64bit ( fedora 4 to 11)
My Celestia Downloads

http://celestiamotherlode.net/catalo...?creator_id=10
Reply With Quote
  #7  
Old 30th December 2008, 04:53 AM
zackf Offline
Registered User
 
Join Date: Nov 2006
Location: South Carolina
Posts: 798
pf thx, man pages aren't really very helpful unless you already know what commands do.
Reply With Quote
  #8  
Old 30th December 2008, 03:25 PM
neogranas Offline
Registered User
 
Join Date: Nov 2006
Location: U.S.A.
Age: 27
Posts: 473
They are commands for SELinux to allow those files or folders to be permitted to be viewed externally. SELinux can cause a lot of headaches, so I recommend either putting it on the list of things to check when something goes wrong, or if you do feel like turning it off and using IPTables or Fail2Ban instead. I do the latter.
__________________
Registered linux user: #475337

Never underestimate someone with source code, a text editor, and the willingness to completely hose their system.
Reply With Quote
  #9  
Old 2nd January 2009, 06:48 PM
marcrblevins's Avatar
marcrblevins Offline
Registered User
 
Join Date: Jun 2006
Location: Texas
Age: 42
Posts: 4,168
Try:
Code:
su -
getsebool -a | grep httpd
Those that are 'off' is helping you to prevent. The 'on' part is the one you let Selinux pass thru.
Reply With Quote
  #10  
Old 3rd January 2009, 11:36 PM
pushback Offline
Registered User
 
Join Date: Jun 2005
Location: Bay Area, California
Posts: 167
Quote:
Originally Posted by marcrblevins View Post
Try:
Code:
su -
getsebool -a | grep httpd
Those that are 'off' is helping you to prevent. The 'on' part is the one you let Selinux pass thru.

Say, which one of these puppies do I turn on if I need an application to write to a file. In this case I am trying to get httpd to write to a gallery (http://gallery.menalto.com/) file. Which one of these to I change and how do I change it?

Thanks!

getsebool -a |grep http
allow_httpd_anon_write --> off
allow_httpd_dbus_avahi --> off
allow_httpd_mod_auth_ntlm_winbind --> off
allow_httpd_mod_auth_pam --> off
allow_httpd_sys_script_anon_write --> off
httpd_builtin_scripting --> on
httpd_can_network_connect --> off
httpd_can_network_connect_db --> off
httpd_can_network_relay --> off
httpd_can_sendmail --> off
httpd_enable_cgi --> on
httpd_enable_ftp_server --> off
httpd_enable_homedirs --> on
httpd_ssi_exec --> off
httpd_tty_comm --> on
httpd_unified --> on
httpd_use_cifs --> off
httpd_use_nfs --> off
Reply With Quote
  #11  
Old 11th January 2009, 09:42 AM
marcrblevins's Avatar
marcrblevins Offline
Registered User
 
Join Date: Jun 2006
Location: Texas
Age: 42
Posts: 4,168
Quote:
Say, which one of these puppies do I turn on if I need an application to write to a file. In this case I am trying to get httpd to write to a gallery (http://gallery.menalto.com/) file. Which one of these to I change and how do I change it?
What was the location of the file you wanted to change? Was it in /var/www/html?
I believe chcon is what you need.

Look at:
Code:
man httpd_selinux
Reply With Quote
  #12  
Old 11th January 2009, 06:37 PM
JohnVV's Avatar
JohnVV Offline
Registered User
 
Join Date: Aug 2005
Location: Ann Arbor
Age: 45
Posts: 3,907
Quote:
Say, which one of these puppies do I turn on if I need an application to write to a file. In this case I am trying to get httpd to write to a gallery...
and you have read the doc page ?
http://codex.gallery2.org/Gallery2:I...SELinux_Server
__________________
Running Arch ,OpenSUSE 11.4-64bit & Scientific Linux 6.1-64bit ( fedora 4 to 11)
My Celestia Downloads

http://celestiamotherlode.net/catalo...?creator_id=10
Reply With Quote
  #13  
Old 11th January 2009, 06:52 PM
domg472 Offline
SELinux Contributor
 
Join Date: May 2008
Posts: 621
Can you shows us AVC denials of the event?

ausearch -m avc -ts today

httpd_sys_content_rw_t is a type that one can assign to a location that httpd_t needs to be able to write to.
__________________
Come join us on #fedora-selinux on irc.freenode.org
http://docs.fedoraproject.org/selinu...ide/f10/en-US/
Reply With Quote
Reply

Tags
denied, indexhtml, permission

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
index.html for webserver help blueboy4 Servers & Networking 3 24th May 2008 09:53 AM
index.html/ .php not being served LeeSpires Servers & Networking 3 22nd March 2007 01:20 AM
Apache Problem: access to /index.html denied prismbiz Servers & Networking 18 30th September 2005 08:58 PM
Apache permission denined index.html error trinimoses Using Fedora 1 5th July 2005 10:40 PM
index.html tejas Using Fedora 7 6th May 2005 10:01 AM


Current GMT-time: 18:52 (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