PDA

View Full Version : editing httpd.conf



rsnow
18th July 2007, 10:30 PM
The instructions I was given were to "search for the line containing ServerName www.example.com:80 and uncomment it. Then change it to read 192.168.x.xxx:80.

When I make the changes using Kwrite and try to save it says it can't save because it was not possible to write to file and check to see if I have access.

When I try to access the file via # /etc/httpd/conf/httpd.conf I get permission denied.

So, if I can't access the file as su and I can't edit the file otherwise, how do I make the change?

markkuk
19th July 2007, 12:18 AM
When I try to access the file via # /etc/httpd/conf/httpd.conf I get permission denied.

It's not an executable file, it's a plain text configuration file. Start your favorite editor from the command prompt where you gave the "su -" command and give the filename as a parameter, e.g.

# emacs /etc/httpd/conf/httpd.conf

rsnow
19th July 2007, 04:24 AM
Well now that seems pretty obvious. I guess after so many hours of reading and experimenting I just got brain lock. Tomorrow, when I am fresh again, I'll just pop up that ole terminal and give her a try. Thanks

Zotter
19th July 2007, 07:13 AM
httpd.conf is a system file.

You'll need to be root or at least use sudo to get root privileges to write changes to that file.

rsnow
19th July 2007, 05:25 PM
OK, the # su emacs worked...thank you. Now my problem is:

After making ServerName change and changing root@localhost to my email address, the next instructions says "Start the httpd server. As root user, type the following: # service httpd start

I type and I get 'Command not found'

rsnow
19th July 2007, 05:27 PM
OK, the # su emacs worked...thank you. Now my problem is:

After making ServerName change and changing root@localhost to my email address, the next instructions says "Start the httpd server. As root user, type the following: # service httpd start"

I type and I get 'Command not found' oops! I hit the wrong button....sorry.

pete_1967
19th July 2007, 07:53 PM
When you login as root with 'su', the root's $PATH is not loaded, 'service' is in /sbin so in this case you need to type `/sbin/service httpd start`

If you want root's $PATH to be loaded, use 'su -' (note the hyphen). Done that and you can just type `service httpd start`

If system command is not found when you've used 'su' to login, just add '/sbin/' in front of it and you should find it.

You can also use `locate [string]` in terminal to find those elusive commands.

rsnow
19th July 2007, 08:45 PM
Again - Thanks

The author whose instructions I have been trying to follow failed to mention that little thing like including the (-) hyphen.