LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-07-2012, 01:22 AM   #1
Abhishek47
LQ Newbie
 
Registered: Sep 2012
Posts: 2

Rep: Reputation: Disabled
Permissions for directory in Linux


Hi All,

I am a newbie to Linux and am trying to configure Apache 2 (Web Server), but I was not able to access the document root path with my user. After checking I was getting 403 forbidden error in my browser.
Also accidentally I changed the permissions of /etc after which I am facing INIT: cannot execute "/etc/X11/prefdm" message during start up.

Please help in this matter.

Thanks in advance.

Abhishek
 
Old 09-07-2012, 01:37 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
what did you do *exactly* here? If you've *recursively* changed /etc then that can be a seriously horrible ting to recover from.

FYI, here are the permissions you'd usually have on the path to prefdm, but you'll most likely have this issue again and again...

[chris@thinkpad ~]$ ls -ld /etc/
drwxr-xr-x. 167 root root 12288 Sep 7 03:27 /etc/

[chris@thinkpad ~]$ ls -ld /etc/X11/
drwxr-xr-x. 6 root root 4096 Jan 24 2012 /etc/X11/

[chris@thinkpad ~]$ ls -l /etc/X11/
total 28
drwxr-xr-x. 2 root root 4096 May 18 2011 applnk
drwxr-xr-x. 2 root root 4096 Oct 3 2011 fontpath.d
-rwxr-xr-x 1 root root 1350 Oct 12 2011 prefdm
drwxr-xr-x. 5 root root 4096 Jan 24 2012 xinit
-rw-r--r-- 1 root root 547 Feb 8 2011 Xmodmap
drwxr-xr-x. 2 root root 4096 Sep 7 2011 xorg.conf.d
-rw-r--r-- 1 root root 493 Feb 8 2011 Xresources
 
1 members found this post helpful.
Old 09-07-2012, 03:37 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,357

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
Can you tell us what distro+ver you have
Code:
cat /etc/*release*
If its an rpm based system eg RHEL/Centos etc, then this may help http://www.cyberciti.biz/tips/reset-...ermission.html
 
1 members found this post helpful.
Old 09-10-2012, 12:05 AM   #4
Abhishek47
LQ Newbie
 
Registered: Sep 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
Hi acid_kewpie,

Thank You for your help.
Below are the output:

ls -ld /etc/
drwxrwxrwx 107 root root 12288 Sep 10 10:07 /etc

ls -ld /etc/X11/
drwxrwxrwx 8 root root 4096 Jan 17 2011 /etc/X11/

ls -l /etc/X11
drwxrwxrwx 2 root root 4096 Aug 8 2008 applnk
drwxrwxrwx 2 root root 4096 Jan 17 2011 fs
-rwxrwxrwx 1 root root 947 Jul 13 2009 prefdm
drwxrwxrwx 2 root root 4096 Aug 8 2008 serverconfig
drwxrwxrwx 2 root root 4096 Aug 8 2008 sysconfig
drwxrwxrwx 2 root root 4096 Jan 17 2011 twm
drwxrwxrwx 5 root root 4096 Jan 17 2011 xinit
-rwxrwxrwx 1 root root 547 Nov 14 2007 Xmodmap
-rwxrwxrwx 1 root root 568 Jan 17 2011 xorg.conf
-rwxrwxrwx 1 root root 492 Nov 14 2007 Xresources

Hi Chris,

Thank You for your advise.Below is the output:
cat /etc/*release*

cat: /etc/lsb-release.d: Is a directory
Red Hat Enterprise Linux Server release 5.4 (Tikanga)

Thanks
Abhishek
 
Old 09-10-2012, 03:35 AM   #5
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,090

Rep: Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474
Quote:
Also accidentally I changed the permissions of /etc
from the output you gave i am guessing you did this
--- only a guess ??? ---

Code:
su -
--- root password when asked ---
chmod -R 777 /etc
if so

do you have a FULL week 12 hours a day to fix

fixable but it WILL take a huge amount of time

reinstall is faster
30 Min. VS days and days

also RHEL5.4
you ARE paying red hat to KEEP it at this level ?? right ????
or did you never buy the required support contract 3 years ago ( 5.4 came out in Sep. 2009 )


as to Apache
it is like the game "GO" 3 weeks to learn and a lifetime to MASTER
there is a LOT to learn so your first stop is the documents
read them
http://httpd.apache.org/docs/
but rhel5 shipped with a OLD version
http://httpd.apache.org/docs/2.0/
you might need to build a current version from source
the current Apache 2.4 docs
http://httpd.apache.org/docs/2.4/
 
1 members found this post helpful.
Old 09-10-2012, 03:59 AM   #6
Mr. Alex
Senior Member
 
Registered: May 2010
Distribution: No more Linux. Done with it.
Posts: 1,238

Rep: Reputation: Disabled
Quote:
Originally Posted by Abhishek47 View Post
but I was not able to access the document root path with my user. After checking I was getting 403 forbidden error in my browser.
That's because apache uses it's own user "nodoby" (I believe that's how the user is called) who needs read and executable permissions all the way from first dir to last. If any dir in between lacks those, "nobody" will not be allowed to read webpage files.
 
Old 09-10-2012, 04:01 AM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
the apache daemon is usually run my the httpd user on rhel, not nobody.
 
1 members found this post helpful.
Old 09-10-2012, 04:11 AM   #8
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,090

Rep: Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474
on red hat /var/www/http/ is owned by the apache user " httpd" all lowercase
 
1 members found this post helpful.
Old 09-10-2012, 07:55 PM   #9
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,357

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
See my link in post #3; that should enable you to fix ownerships/perms
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
File permissions v. directory permissions Completely Clueless Linux - Newbie 7 07-09-2009 08:33 AM
getting a directory's permissions and creating a new one with the same permissions newbie1000101 Programming 1 04-10-2004 12:52 PM
write permissions for directory - not accidently move/deleted the directory linuxgamer Linux - Newbie 10 12-02-2003 03:04 AM
Linux directory permissions anorman Linux - General 2 11-26-2003 12:39 PM


All times are GMT -5. The time now is 02:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration