First lets install Bitnami Lamp stack
Step-1: Download Bitnami Lamp stack for Linux.
Assume the filename is called some-app.run and is in the folder /home/user/Downloads. You will need to modify these instructions to fit your situation.
- Open a terminal (Applications->Accessories->Terminal).
- enter cd /home/user/Downloads
- enter chmod +x some-app.run
- enter ./some-app.run
This will open the installation window where you will install Bitnami Lampstack.
Image-1: Demonstrates the installation commands
Note: if step 4 fails with a message including ‘permission denied’, try entering sudo ./some-app.run (you will need to enter your password for this).
Step-2: Restarting Bitnami Lamp-stack Server
Run this command to restart the lamp server on Bitnami -> sudo /opt/lampstack/ctlscript.sh restart apache
once done open http://localhost:88 and you see the bitnami page as shown below.
Once you are done with installing Bitnami Lampstack.
Lets find out how to add a Faveo on top of the Bitnami LAMP/MAMP/WAMP Stack.
- How to create a basic application structure?
- How to Deploy Faveo on Bitnami?
- How to enable PHP-FPM on your server?
How to create the basic application structure?
Your Bitnami Lampstack application will be installed in the /opt directory by default. You can name the installation folder as ‘bitnami’ or ‘lampstack’. It can be anything of your choice. In my case i have named it as ‘lampstack’ so the installed directory is /opt/lampstack
This is the basic directory structure:
apps/faveo |- htdocs |- conf
The important files and directories are described below:
apps: This is the folder where all PHP applications are stored (for example, phpMyAdmin is in apps/phpmyadmin, WordPress is in apps/wordpress, etc). Assuming that your app will live in the myapp/ folder, you should create the directory structure above:
Hence, in our case we name myapp as Faveo. So we are going to create a directory called Faveo under apps.
Follow the steps below for creating a directory structure..
How to Deploy Faveo on Bitnami?
apps/faveo/htdocs: This folder should contain Faveo application’s files.
composer update (from applications directory)
Now we need to create a couple of config files. In order to do so run the following command:
Alias /faveo/ "/opt/lampstack/apps/faveo/htdocs/" Alias /faveo "/opt/lampstack/apps/faveo/htdocs" Include "/opt/lampstack/apps/faveo/conf/httpd-app.conf"
apps/myapp/conf/httpd-app.conf: This is the main configuration file for Faveo. It should contain the following.
|Note: Once you save the file you need to restart the apache server for changes to take effect.|
Once you have created the files and directories above, add the following line to the end of the main Apache configuration file, as shown below
Restart the Apache server and you should be able to access your application at localhost:88/faveo/public
Image: Showing the faveo installation page on Bitnami Lampstack
Follow the instructions and complete the installation process.
For installation process you can refer this link
You can refer docs/ folder in the installed directory /opt/lampstack for more imformation of demo application and its structure.
How to enable PHP-FPM in your custom application?
The first thing you need to do is to enable PHP-FPM in your Apache server. \You can follow the steps in this wiki entry.
Once it is done, you need to configure Faveo to use PHP-FPM. You have to modify some files
Insert the following lines at the beginning
<IfDefine USE_PHP_FPM> <Proxy "unix://opt/lampstack/php/var/run/faveo.sock|fcgi://faveo-fpm" timeout=300> </Proxy> </IfDefine>
And then these ones inside the Directory
<Directory "/opt/lampstack/apps/faveo/htdocs"> .... <IfDefine USE_PHP_FPM> <FilesMatch \.php$> SetHandler "proxy:fcgi://faveo-fpm/" </FilesMatch> </IfDefine> </Directory
Now, create the folder php-fpm inside the conf directory, so that the structure is like this
apps/faveo |- htdocs |- conf |- php-fpm
and create a file called pool.conf inside with the following content
[myapp] listen=/opt/lampstack/php/var/run/faevo.sock include=/opt/lampstack/php/etc/common-dynamic.conf include=/opt/lampstack/apps/faveo/conf/php-fpm/php-settings.conf include=/opt/lampstack/php/etc/environment.conf pm=dynamic
Now you need to include the following line in the php-fpm.conf conf
Finally restart Apache
/opt/lampstack/ctlscript.sh restart apache
\In Linux, you need to give read permissions to the the apache user or group. In these installations apache is running as the daemon user.
sudo chgrp daemon /opt/lampstack/apps/faveo/htdocs