need root to start apache?

LogicMan

Registered
do i need to be root to start apache? can i start it as an admin?
however i get this error:

fopen: Permission denied
httpd: could not open error log file /private/var/log/httpd/error_log.
/usr/sbin/apachectl graceful: httpd could not be started


thanks in advance....also how do i eneble php?
 
might want to check out the UN*X part of our forums. You -can- enable Apache simply by turning it on in the 'Sharing' preference pane. There is, however, a nice package called 'MAMP' (Macintosh Apache MySQL PHP) that I've mentioned on macnews.net.tc - http://macintosh.fryke.com/cgi-bin/macnews2.cgi/2004/10/20#20041020_mamp - recently. It basically installs the MAMP environment in a way that doesn't 'hurt' Apple's own Apache and PHP etc. installations/config files.
 
I just noticed how I was thinking about mentioning that the package is available for free. Guess times _have_ changed and open source software _has_ had an impact. Nowadays, it's special if you have to mention a price for software. In the 'old' days, it was rather special if something was free. ;)
 
Since Apache uses port 80, and root is required to bind to 80, it has to be started as root, along with other reasons dealing with how Apache needs to operate.
 
As rbb said, you need to start httpd as root since it uses a privilaged port (a port lower than 1025). Do this with sudo apachectl start.

Being an "administrator" user doesn't grant you root privilages automatically (thankfully) but it DOES add you to /etc/sudoers which lets you issue commands as root, or to su root if root is enabled in NetInfo Manager.
 
Back
Top