LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 05-22-2007, 06:43 AM   #1
riganta
Member
 
Registered: May 2007
Location: Cork (Ireland)
Distribution: FreeBSD 9.1
Posts: 154

Rep: Reputation: 25
Directory Permission


Hi all,

I have a problems trying to understand Directory permission. I have downloaded apache on my Red Hat E/S v 5 Distro. I was trying to get the httpd.conf file in a terminal and it said to me that I didn't have permission to open, right in it, or even move it. I downloaded Apache under my user account and as well under root but the same thing happened. I used the command "chmod a+x file-name" to get around the problem and everything was fine.
Why is this happening? How this command ("chmod a+x file-name") can circumvent the problem?
Again, thank you all for your support.

Riganta

Last edited by riganta; 05-22-2007 at 06:45 AM.
 
Old 05-22-2007, 07:15 AM   #2
Brad.Scalio@noaa.gov
Member
 
Registered: Jan 2007
Location: Washington DC
Distribution: RedHat & spins ... Fedora, CentOS, Mandriva
Posts: 82

Rep: Reputation: 15
Quote:
Originally Posted by riganta
I used the command "chmod a+x file-name" to get around the
Riganta
All that will do is make the file executable by all users.

you should always check /var/log/messages to see if there are any errors before playing with things...if there is nothing telling you what's going on in there...then try:

httpd.conf should need only be 644 permissions, or -rw-r--r-- (read by all, but writeable only by the owner, whcih should be root).

Do the following:
Code:
# cd /etc/httpd/conf
# ls -ltr
you should see:
Code:
-rw-r--r--  1  root root  33677 Sep 11 httpd.conf
is this what is says?

if so, and you still can't write to it try this in the same directory:
Code:
# getfacl httpd.conf
you should see that the owner and group are set to root, and user::rw- group::r-- other::r--

if that is correct, and you still can't write to it do you have SELinux enabled? If so, check the security context of the file, shouldn't cause issues with writing it though.

if all this looks good, finally check
Code:
# cat /proc/mounts | grep root
this should return with a rw flag in the line
 
Old 05-22-2007, 04:21 PM   #3
riganta
Member
 
Registered: May 2007
Location: Cork (Ireland)
Distribution: FreeBSD 9.1
Posts: 154

Original Poster
Rep: Reputation: 25
Hi Brad,

Thanks a lot for your help

Following your steps, this is what I got:

# cd /etc/httpd/conf
# ls -ltr

total 60
-rw-r--r-- l root root 12958 nov 29 12:34 magic
-rw-r--r-- l root root 33677 nov 29 12:34 httpd.conf


# getfacl httpd.conf

# file: httpd.conf
# owner: root
# group: root
user::rw-
group::r--
other::r--


Still couldn't writte to it or nothing for that matter

# cat /proc/mounts | grep root

rootfs / rootfs rw 0 0
/dev/root / ext3 rw,data=ordered 0 0


Still can't do nothing with the directory and I cannot run apache.

Cheers for all Brad

Riganta
 
Old 05-22-2007, 04:58 PM   #4
Brad.Scalio@noaa.gov
Member
 
Registered: Jan 2007
Location: Washington DC
Distribution: RedHat & spins ... Fedora, CentOS, Mandriva
Posts: 82

Rep: Reputation: 15
Can you not edit the file, or you can start apache?

That is two different problems...if you can't start apache, try:

# service httpd configtest

This will show you if you have any errors with the httpd.conf file ... http out of the box is pretty easy ... you really don't need to do anything but start httpd, and they if you go to http://localhost you will see a test page from your OS provider

What is it you want to do, and what problems are you having, be as specific as possible.

brad
 
Old 05-22-2007, 07:30 PM   #5
riganta
Member
 
Registered: May 2007
Location: Cork (Ireland)
Distribution: FreeBSD 9.1
Posts: 154

Original Poster
Rep: Reputation: 25
You are right. I have two problems. The first is the one that we have been talking about. I cannot access to the httpd.conf file to configurate apache because a refusal access by Red Hat. The second is that i cannot start apache anymore. When I ran the command "httpd configtest" i got the answer "Syntax OK". See I don't know if apache works fine because when i check on http://localhost I have a connection problem Basically, is says "no connection possible"

Cheers
 
Old 05-22-2007, 07:52 PM   #6
Brad.Scalio@noaa.gov
Member
 
Registered: Jan 2007
Location: Washington DC
Distribution: RedHat & spins ... Fedora, CentOS, Mandriva
Posts: 82

Rep: Reputation: 15
I didn't think I had to ask this question, but hey, you know what they say when you assume ;-)

What user are you when you try to edit the httpd.conf?
What text editor are you using?

What are the permissions on the /etc/httpd/conf directory?
 
Old 05-24-2007, 06:20 AM   #7
riganta
Member
 
Registered: May 2007
Location: Cork (Ireland)
Distribution: FreeBSD 9.1
Posts: 154

Original Poster
Rep: Reputation: 25
Hi,


What user are you when you try to edit the httpd.conf?

I have tried both. Being myself as riganta and then root. The result is the same. It's being difficult as I have tried to find a way around it.

What text editor are you using?

There you have to be more precise. I think, if I understood, I am using the preinstalled text editor in Red Hat E/S v 5

What are the permissions on the /etc/httpd/conf directory?

The directory belongs to root. Which is something that I don't understand because I have installed apache under riganta. Am I doing something wrong here?

Cheers Brad
 
  


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
directory permission leprkhn Linux - Newbie 6 05-02-2007 08:30 PM
permission of home directory binish Linux - Server 0 10-12-2006 12:58 AM
directory permission Drunkalot Linux - General 1 07-05-2005 02:05 AM
cant change directory permission? dwarf007 Linux - General 1 09-24-2004 10:35 AM
Permission for directory absolut Linux - Newbie 2 01-19-2004 05:38 AM


All times are GMT -5. The time now is 10:38 AM.

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