How to install Apache, PHP and MySQL on Linux: Part 2 | laffers.net
Setup access privileges
Don’t forget to setup Apache access privileges to your www directories:
1 | chown -R apache2:www <em>/foo/path_to_your_www_documents_root</em> |
2 | chmod -R 750 <em>/foo/path_to_your_www_documents_root</em> |
“apache2″ and “www” are the user and user group I have previously created (see Prerequisites)
Start and stop apache server
After everything is set up, start Apache:
1 | /usr/ local /apache2/bin/apachectl start |
Similarly, if you wish to stop Apache, type:
1 | /usr/ local /apache2/bin/apachectl stop |
Automatic startup
It’s a good idea to let your Apache server start automatically after each system reboot. To setup Apache automatic startup, do:
1 | cp /usr/ local /apache2/bin/apachectl /etc/init.d |
2 | chmod 755 /etc/init.d/apachectl |
3 | chkconfig --add apachectl |
4 | chkconfig --level 35 apachectl on |