Google Answers Logo
View Question
 
Q: OS X 10.1httpd.conf file Opening / configuring & saving permissions problem ( Answered,   0 Comments )
Question  
Subject: OS X 10.1httpd.conf file Opening / configuring & saving permissions problem
Category: Computers > Programming
Asked by: cupidswedding-ga
List Price: $15.00
Posted: 22 Feb 2003 16:52 PST
Expires: 24 Mar 2003 16:52 PST
Question ID: 165762
I have opened my /etc/httpd/httpd.conf file in OS X 10.1 ( I opened
with Text Edit. I uncommented a few lines and tried to save via the
file menu (desktop). It would not let me save the file. I am thinking
it is a file permission problem and dont know how to solve it.

Request for Question Clarification by cerebrate-ga on 22 Feb 2003 17:09 PST
Dear cupidswedding-ga,

What user are you logged on to the machine as whe you try to edit the
file, and is that user allowed to administer the computer (the "Allow
user to administer this computer" checkbox ticked in "System
Preferences"/"Accounts"?

Thanks,

cerebrate-ga
Answer  
Subject: Re: OS X 10.1httpd.conf file Opening / configuring & saving permissions problem
Answered By: maniac-ga on 24 Feb 2003 16:53 PST
 
Hello Cupidswedding,

You most likely have a permissions problem as you noted. Checking
briefly on my system I get
  -rw-r--r--  1 root  wheel  37309 Jan 16 02:16 /etc/httpd/httpd.conf
as output from
  ls -l /etc/httpd/httpd.conf
If you are not familiar with the format for the output of ls, you read
this as...
  user has read/write access, the group and others have read access
  the user is "root", the group is "wheel"
  the file size is 37309 bytes long, created on January 16th.
So, you must act as the user named root to modify this file.

There are at least two different ways to solve this problem:
 - login as root. Note I do *not* recommend doing this because you are
able to damage your system inadvertently. I have been managing Unix
systems for over 20 years and I still limit the time I log in as root.
 - use either "su" or "sudo" to modify the file (acting as the user
root). This is what I recommend and is what I describe below. You can
copy / paste the command lines if that would help.

Step 1 - edit the httpd.conf file and save it in your home directory

Step 2 - run the terminal application
  If you don't know where this is, the default location for it is
  MacHD:Applications:Utilities:Terminal
To help recognize its icon, it looks like a black screen with a large
">" sign at the upper left.

You will get a white window with something like
  Last login: Thu Feb 20 20:43:44 on ttyp1
  Welcome to Darwin!
  [Mark-Johnsons-Computer:~] maniac% 
which indicates that I last logged in on February 20 and the prompt
indicates the name of my computer, current directory, and user name.
The percent sign also indicates I am running as a "normal user" and
not as root.

Step 3 - save the existing httpd.conf file
  sudo mv /etc/httpd/httpd.conf /etc/httpd/httpd.conf.orig
you will be prompted for the password of the root user. This will
rename the current copy of the file (in case you have problems). Do
this once - don't repeat after you have replaced the original file.

Step 4 - replace the file with your copy
  sudo cp ~/httpd.conf /etc/httpd/httpd.conf
This will copy your version (you did save it in your home directory)
to the directory used by the web server. Replace the first file name
(~/httpd.conf) with the real file name if you gave it a different name
or put it into a different location. The second sudo will not ask for
a password as long as you do it shortly after the first command.

Step 5 - restart the server

I assume you already know how to stop & start the server. If not, I
can suggest a few methods but would need to know how you have
activated the server.

At this point, your changes should be active. If it does not work -
try restoring the original file
  sudo cp /etc/httpd/httpd.conf.orig /etc/httpd/httpd.conf
and make sure that works - then make your changes in a step by step
basis. Use steps 4 and 5 as needed to effect the changes.

Good luck.

  --Maniac
Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy