PDA

View Full Version : Changing the read-only file attribute


Burritonator
04-01-2005, 11:23 AM
I'm having an inordinate amount of trouble performing what would seem to be a very easy task. What I need to do is to change the file "/etc/httpd/httpd.conf" from read-only to read/write permission. Keep in mind that I am still fairly new to the Macintosh world.

I know how to change this attribute by navigating to a file using Finder, selecting "Get Info" from the menu, and accessing the "Owners & Permissions" option. The problem that I am having is that I can't find the httpd.conf file by using Finder. If I open a terminal window, I can navigate to the directory /etc/httpd/ and see the file httpd.conf there.

I have two questions:

1. Why don't all of the directories under the root directory show up in Finder? For instance, the only folders I see when I select the hard drive in Finder are Applications, Library, System, User Guides, and Users. When I open a terminal window and view the root directory, I see these directories, plus all of the directories related to Linux, such as bin, etc, usr, and var. If I search for the file httpd.conf using Finder, it doesn't find it, even though I know it exists on the drive.

2. How can I change a file from read-only to read/write from within the terminal window? I found a Linux help site which indicated the command "File Attributes httpd.conf -readonly" should accomplish this, but when I execute this command, the system doesn't recognize the -readonly switch. (It actually interpretes each character as a seperate switch and gives a series of error messages such as "File: unknown option -- r", "File: unknown option -- e", etc.)

Thanks in advance for any help that anyone can offer.

hayne
04-01-2005, 11:50 AM
1) The Finder deliberately hides all of the folders that normal users should not be dealing with.

2) If you are using Apache to the extent that you need to edit the httpd.conf file, then you had better have at least a basic knowledge of Unix. The Apache docs assume this.
You might find it useful to read through a Unix tutorial (or two, or three). Here's one: http://www.osxfaq.com/Tutorials/LearningCenter/

3) The reason why the httpd.conf file is showing as read-only is that it is owned by 'root' and only has write permission for the owner. This is as it should be - you should not change this. Instead, you need to edit it with 'root' privileges by using 'sudo' prefacing a Terminal command (e.g. sudo pico /etc/httpd/httpd.conf) or by using an editor (e.g. BBEdit or Text Wrangler) that knows how to ask you to authenticate (giving the admin password) when saving such files.