Apache: cannot edit httpd.config

Hi, I am running an ibook g4 mac osx 2 users, I am admin. took me 3 hours to actually find the file on my computer and now I discover that after editing the file in textedit it will not save? my mac is working against me here. I simply want to enable server side includes which took me 10 mins on the pc. why so difficult on my mac. please help????

iBook G4 12.1", Mac OS X (10.4.6)

Posted on Apr 13, 2006 5:14 PM

Reply
8 replies

Apr 13, 2006 5:46 PM in response to Pynestar

1) Do not edit the file in TextEdit. If you want to use a GUI editor, download an install TextWranger -- when prompted, answer Yes to installing the command line utilities.

2a) If you downloaded/installed TextWrangler, open a Terminal window and type "sudo edit /etc/httpd/httpd.conf" and enter your password. Sometimes that is not enough to make the file writeable in TextWrangler -- there is a little icon in the upper-left corner of TextWrangler's toolbar letting you know if the file is currently writable. If there is a line through it, just click it and authenticate if necessary.

2b) If you don't want to or can't install TextWrangler, on the command line type "sudo vi /etc/httpd/httpd.conf" or "sudo pico /etc/httpd/httpd.conf". Pico is simpler to use, but I have found that sometimes it can add line breaks to long lines, which is particularly undesirable in this case, so use VI if you're going to do it this way.

Apr 13, 2006 6:02 PM in response to Wesley Furgiuele

Thanks but I actually managed to change the permissions so that I could edit the file, and did so in text editor.

"Now I need to know how to restart apache so that my changes will take effect!"

I have the instructions for windows so have changed the file correctly as I did in windows. If after restarting apache my changes don't work I will try the instructions you gave. thanks.

Apr 13, 2006 9:36 PM in response to Pynestar

"Now I need to know how to restart apache so that my changes will take effect!"


Via the command-line utility apachectl which needs to be run via sudo/as root:

sudo apachectl graceful


You can also use the 'restart' command instead of 'graceful', but 'restart' forces a restart of the server, whereas 'graceful' will allow existing, in-progress connections to complete.

In any case I would still change the permissions of the httpd.conf file back. It's a potential security issue.

Apr 14, 2006 3:20 AM in response to Camelot

ok, I have followed the instructions I have used for the pc (I assume they are the same) I have restarted apache but still cannot get server side includes to work?
please somebody help. I will replace the httpd.conf with httpd.confdefault so it's back to square one.
can somebody tell me how to activate server side includes in apache for the mac?????

Apr 14, 2006 4:55 AM in response to Pynestar

Ok, I started again. I added "Includes" to the options line, removed the comments from
#AddType text/html .shtml
#AddHandler server-parsed .shtml
and have ensured the "AddModule mod_include.c" is present and uncommented.
I have saved the file. restarted apache and now where I used to just get the html on the screen in safari I get
"[an error occurred while processing this directive]"
obviously I have done something for this to change but I wouldn't call it progress. Please Help!

Apr 14, 2006 4:31 PM in response to Pynestar

Actually, it does sound like you're making progress. Apache, in it's default config, writes it's error messages to /var/log/httpd/error_log . Rely on error_log for helpful information, the browsers tend to "pretty" things so much that the info is fairly useless.

It sounds like your shtml file was read by the server, but had an error in the SSI line. As finicky as SSI syntax is, that's not too big a surprise. If you copied the SSI, it's very likely that any path in it is different on OSX.

Roger

Apr 14, 2006 6:13 PM in response to Community User

have now discovered that perhaps the problem was I hadn't edited my 'user.config' file and that was overiding the config.file that I had edited. However, after putting 'Includes' into my user.config options ssi still isn't working?
2 days literally 16hours I have been doing this for now. can nobody please take me through the process of enabling server side includes step by step?

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Apache: cannot edit httpd.config

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.