This tutorial guides you in setting up your apache server:

1) Open a konsole/console
2) su –
3) Enter root password
4) emerge sync
5) pico -w /etc/make.conf 6) Ensure that "apache2" and "php" are in the USE="" line 7) emerge apache dev-lang/php
8) pico -w /etc/conf.d/apache2
9) Find the APACHE2_OPTS line and make sure it reads:

APACHE2_OPTS="-D DEFAULT_VHOST -D PHP5" (Note, you must take off any leading # symbol, you may need "-D PHP4" depending on the version you install)

10) Hit ctrl+x, then y, then enter
11) rc-update add apache2 default
12) pico -w /etc/apache2/httpd.conf
13) Change "#ServerName localhost" to "ServerName whatever". Obviously change "whatever" to what you want. Also note that the "#" has been removed from the beginning.
14) mkdir -p /var/log/apache2; mkdir -p /usr/lib/apache2/logs

15) /etc/init.d/apache2 start

There, all done. Now you have an Apache webserver with php support that autoloads and has been started. To push you in the right direction… All files should have .html extensions and “index.html” is the default index file (i.e. autoloaded when you visit the website). All files go in /var/www/localhost/htdocs/ (there will already be some files in there, just delete them all – “rm –rf /var/www/localhost/htdocs/*” then put your own in there!). If you want apache to start automatically after a reboot, run rc-update add apache2 default

This article comes from Gentoox

The URL for this story is: