Ubuntu 16.04 configuration.
WARNING: These instructions to not work as of now. Everything is configured correctly but I can't seem to login to the FOG site. There has to be something I'm missing. This configuration is close, very close since the login page appears.
- Change to the root user
sudo su -
- Install the apache fast cgi module
apt-get -y install libapache2-mod-fastcgi
- Enable the apache fast cgi module
a2enmod proxy_fcgi
- Edit the php configuration file.
vi /etc/apache2/mods-available/php7.1.conf
- Comment out the following line
#SetHandler application/x-httpd-php
- Insert the following line just below the commented out line
SetHandler "proxy:fcgi://127.0.0.1:9000"
- Save and exit the php-fpm.conf file
- Change to the php-fpm pool directory
cd /etc/php/7.1/fpm/pool.d
- Remove the default www.conf in the pool.d directory (this file is created by the fog installer and not used in this setup)
rm /etc/php/7.1/fpm/pool.d/www.conf
- Create a new file called fog.conf
vi /etc/php/7.1/fpm/pool.d/fog.conf
- Paste in the following
[fog]
user = www-data
group = www-data
listen = 127.0.0.1:9000
;listen.owner = www-data
;listen.group = www-data
;listen.mode = 0660
;listen.acl_users = apache
;listen.acl_groups =
listen.allowed_clients = 127.0.0.1
pm = dynamic
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 35
;pm.process_idle_timeout = 10s;
pm.max_requests = 500
;pm.status_path = /status
;ping.path = /ping
;ping.response = pong
access.log = /var/log/php-fpm/$pool.access.log
;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
slowlog = /var/log/php-fpm/$pool-slow.log
;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
;php_flag[display_errors] = off
php_admin_value[error_log] = /var/log/php-fpm/fog-error.log
php_admin_flag[log_errors] = on
;php_admin_value[memory_limit] = 128M
php_value[session.save_handler] = files
php_value[session.save_path] = /var/lib/php/sessions
; we will use these settings when memcache (d) is configured.
;php_value[session.save_handler] = memcached
;php_value[session.save_path] = "127.0.0.1:11211"
php_value[soap.wsdl_cache_dir] = /var/lib/php/wsdlcache
- Save and exit fog.conf
- Create the php-fpm log directory
mkdir /var/log/php-fpm
- Create a php information page in the fog web root
vi /var/www/html/fog/info.php
- Paste in the following
<html>
<body>
<?php
phpinfo();
?>
</body>
</html>
- Save and exit info.php page.
- Change the owner of that page to apache
chown www-data:www-data /var/www/html/fog/info.php
- From a web browser call the info page with http://<fog_server_ip>/fog/info.php. The page should look similar to below
<insert_info_page_image>
- Now lets restart both apache2 and php-fpm
systemctl restart php7.1-fpm apache2
- Give it a few seconds for both services to initialize.
- Now call the same info.php page. The page should look similar to below. NOTE: that the Server API variable is now ‘FPM/FastCGI’
<insert_info_page_image>
- Now access the FOG management page console
- Access a few of the managment pages, you will note that after a few page clicks the pages will respond faster to your page selections.
- To confirm that php-fpm is working you can inspect the logs files being created in /var/log/php-fpm directory. The php errors will now be listed there instead of the default apache error log (because php-fpm is now handling the php code).
- You may remove the info.php page in the fog web root directory. Its no longer needed.
- Done