You are on page 1of 5

Installation guide for homepad on production

Table of contents 1) Installing Apache 2) Installing PHP 3) Installing MySql 4) Configuring php with MySql 5) Configuring homepad application

Installation guide for homepad on production


1) Installing Apache Open up the Terminal Copy/Paste or type the following line of code into Terminal sudo apt-get install apache2

Testing Apache http://localhost 2) Installing PHP Open up the Terminal Copy/Paste or type the following line of code into Terminal sudo apt-get install php5 libapache2-mod-php5

In order for PHP to work and be compatible with Apache we must restart Apache. Type the following code in Terminal to do this sudo /etc/init.d/apache2 restart

Testing PHP Open up the Terminal Copy/Paste or type the following line of code into Terminal sudo gedit /var/www/testphp.php

Copy/Paste the following line into testphp <?php phpinfo(); ?>

Save and close the file Now open you're web browser and type the following into the web address

Installation guide for homepad on production


http://localhost/testphp.php

It will show you the page that has all information about php.

3) Installing MySql Open up the Terminal Copy/Paste or type the following line of code into Terminal sudo apt-get install mysql-server

Type the following into Terminal mysql -u root

copy/paste or type this line mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('yourpassword');

Installing phpMyAdmin which is an easy tool to edit your databases. Copy/paste or type the following line into Terminal. sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin

4) Configuring php with MySql Open up the Terminal Copy/Paste or type the following line of code into Terminal Vi /etc/php5/apache2/php.ini for enabling mysql we need to uncomment mysql by removing semicolon(;)

Installation guide for homepad on production


;extension=mysql.so to extension=mysql.so Restart the Apache using the following sudo /etc/init.d/apache2 restart If we get 404 error upon visiting http://localhost/phpmyadmin. We need to configure apache2.conf to work with Phpmyadmin vi /etc/apache2/apache2.conf Include the following line at the bottom of the file, save and quit. Include /etc/phpmyadmin/apache.conf Restart the apache server Sudo /etc/init.d/apache2 restart

5) Configuring homepad application Open up the Terminal Copy/Paste or type the following line of code into Terminal /etc/apache2/sites-available/default Set AllowOverride from None to All as shown below <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory>

Installation guide for homepad on production


The AllowOverride All option allows URL rewriting, which is required by Zend Framework. We should enable the mod_rewrite apache2 module (by default is disabled) cd /etc/apache2/mods-enabled sudo touch rewrite.load sudo gedit rewrite.load Add the following line to the opened file

LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so Copy homepad application to /var/www/ Set the database url, username, password Finally, restart the apache2 server to enable the new settings Sudo /etc/init.d/apache2 restart