Apache & PHP

Gentoo HOWTO & Notes

11/07/2009


Installation

Add apache2 to the global USE flags in /etc/make.conf, as we really want other applications to also make use of Apache in providing nice web interfaces. Also add the Apache specific configuration flags to /etc/make.conf:

gentoo ~ # nano -w /etc/make.conf

APACHE2_MODULES="actions alias asis auth_basic auth_digest authn_default authz_host autoindex deflate dir env expires filter headers imagemap include info log_config logio mime mime_magic negotiation rewrite setenvif speling status substitute userdir usertrack version" APACHE2_MPMS="worker"

Also add Apache and PHP to /etc/portage/package.use:

gentoo ~ # nano -w /etc/portage/package.use

dev-lang/php ctype exif ftp gd hash mysqli tokenizer xml zip www-servers/apache doc

Note: If you did not add mysql to your global USE flags after the installation of MySQL, then it needs to be added to those of PHP above.

And let ’er rip:

gentoo ~ # emerge www-servers/apache php

USE Flags

Apache requires authz_host.

PHP requires tokenizer.

Configuration

Start the Apache server and check /var/log/messages for any errors. If everything seems OK, add Apache to the default runlevel.

gentoo ~ # /etc/init.d/apache2 start

gentoo ~ # rc-update add apache2 default