Apache

From gr0x0rd
Revision as of 09:12, 9 May 2011 by Gr0x0rd (talk | contribs) (Created page with "== Installing apache == Apache is the most commonly used web server in the linux world. There are alternatives such as lighttpd and spin-offs such as tomcat; this guide focuses ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Installing apache

Apache is the most commonly used web server in the linux world. There are alternatives such as lighttpd and spin-offs such as tomcat; this guide focuses on plan old apache using php and mySQL, otherwise known as a LAMP server (Linux-Apache-mySQL-php).

Before you begin, check that your /etc/portage/package.use file contains the php and mysql USE flags if they aren't in your /etc/make.conf.

$ sudo emerge -av apache

Once the emerge completes, we'll need to set the ServerName directive before we can start the server successfully.

$ sudo nano -w /etc/apache2/httpd.conf

Make sure the file contains the following directive:

ServerName yourserversname

Let's start apache with the system

$ sudo rc-update add apache2 default

And start the server

$ sudo /etc/init.d/apache2 start

You'll also want to add any user accounts desired to the apache group.

$ sudo usermod -a -G apache username

Apache tips

To restart the apache server after a configuration change without interrupting service, enter the command

$ sudo /etc/init.d/apache2 graceful