Skip to content

2. Apache Webserver Installation and Configuration

Dominik edited this page Jul 13, 2014 · 1 revision

Apache + php Installation

Our application is based on an Apache Webserver, which is used for hosting the website. To provide a working and configured infrastructure you need to fulfill the following steps.

  1. Download and install Apache including the used extensions like php and database support via apt-get: sudo apt-get install apache2 apache2-doc apache2-utils libapache2-mod-php5 php5 php5-common php5-pgsql libapache2-mod-fcgid
  2. Open the php.ini file: sudo nano /etc/php5/apache2 php.ini
  3. Until now, the Webser can not handle database support. To solve this problem, you need to modify the php.ini file, which can be found in the root-folder of your php5 installtion. Insert the following lines at the button of file: extension=php_pgsql.dll, extension=php_pdo_pgsql.dll. Additionally put the line extension=php_pdo.dll and extension=php_sqlite.dll to support the usage of mbtiles.
  4. Restart Apache to load the pgsql and sqlite modules by typing: sudo service apache2 restart.

To check the php configuration, create a new file info.php with the following content and put it in the var/www folder of Apache instance. Access it via your webbrowser.

<?php
phpinfo();
?>

Firewall Settings

Please note that Apache communicates through the in the setup defined port (which is by default port 80), which have to be opened by creating a Firewall exception to work properly. To define a new Firewall Rule, follow the steps below:

  1. Enable the ufw-firewall: ufw allow
  2. Type ufw allow 80/tcp to open the port 80.
  3. To save the changes type ufw reload