Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I log into a new server as root. Once I log in I su username which allows me to choose test or production.

When I choose test I run httpd -v from the bash prompt and get the apache version

What confuses me is when i run server httpd restart I get httpd server not found.

How can it recognize httpd -v and not a restart. Ohh fyi, this is a new server with no sites on it.

share|improve this question
can you please share the log output of /var/log/messages and /var/log/secure. also share the error. Anshul – Anshul Creative Dec 18 '12 at 13:04
ok, it will take me a little bit to get the log messages...not very good at this stuff. – Vibration Of Life Dec 18 '12 at 13:11
up vote 2 down vote accepted

you can just open three simultaneously windows and perform below tasks:

  1. tail -f /var/log/messages
  2. tail -f /var/log/secure
  3. start the apache server

send the result and logs with error while restarting the apache server.

share|improve this answer
Last message in the messages and secure logs was from Dec 16th. It's not recording my bash commands. When performing "server httpd restart" the error message is "server: command is not found" – Vibration Of Life Dec 18 '12 at 15:28
try "service httpd restart" – Anshul Creative Dec 18 '12 at 16:28

BY default the service cannot be start or stop by non-root user because of security risk. but you can run Apache as any user by allocating proper resources

The standard http port 80 (which is priviledged) you will have to setup, as root a redirection to your real Apache server. The easiest way is probably using iptables. For example if your Apache server is listening on port 8080:

iptables -t nat -A PREROUTING -p tcp --dport 80 --syn -j REDIRECT --to-port 8080

If you can not configure the server like this. the same can be configured to a non privileged port and access it using an URL that looks like http://www.localdomain:8080/

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.