bw logo

Chapter 6. Configuring Apache

The default web integration implementation uses at its core an Apache http server. The binary for the server is called httpd, and it is generally run as a daemon. The binary package and the installation instructions for it can be found at http://apache.org.

Before the server can be accessed, Apache must be told where to find the appropriate server files. This involves putting a symbolic link to the appropriate directory in Apache's DocumentRoot, for example /var/www/html/. For example, in FantasyDemo, the path to the server files might be /home/mf/fantasydemo/src/web/php/, so in order for Apache to be able to find these files, a symbolic link to that path must be placed in /var/www/html/. To do this for FantasyDemo, run the following as root:

# ln -s /home/mf/fantasydemo/src/web/php/ /var/www/html/fantasydemo

The name of the link will be used as the URL segment after the server address, for example, if the link is called fantasydemo, as in the command above, then the URL for the server will be <machine address>/fantasydemo.

Make sure that the Apache configuration directive FollowSymlinks is on for the directory containing the symlink, and that the web server user has full read access to the target directory, for example /home/mf/fantasydemo/src/web/php, and all individual directories in its absolute path. This is likely to require modification only at the top level: the server user's home directory. To grant read access, run the following as root:

# chmod o+rx /home/<server-user>

SELinux can prevent access to an Apache server if its setting is too strict. To modify the SELinux setting, run the following as root:

# system-config-securitylevel

From here, set the SELinux level to be no higher than Permissive. That is, the setting must not be Enforcing.

Restart the Apache server by running the following as root:

# /etc/init.d/httpd restart