Linux, Operating Systems, PHP, Ubuntu

Ubuntu 14.10 + Apache 2.4 + PHP-FPM + MariaDB MySQL Server + Composer

Preface

Please understand that this is not a complete how-to guide. There are a lot of things missing from this that you would need to run a site like mine. I just included the bare minimum required to get Apache 2.4, PHP-FPM, MariaDB, and Composer up and running on Ubuntu 14.10. You may find that you need other PHP5 libraries, such as php5-gd, installed as well for this to run your PHP web app of choice. That said, this should be enough to get you started!

Installation

To get started, we will first ensure that we are running the most up to date packages:

sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade

Next, we will install the following dependencies:

sudo apt-get install apache2-mpm-event apache2-utils libapache2-mod-fcgid php5-fpm php5-cli php5-mcrypt php5-mysqlnd curl mariadb-server mariadb-client mariadb-common

Next, install Composer:

curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer

Configuration

We will need to create ourselves a lovely configuration file for PHP-FPM, and save it as php5-fpm.conf:

<FilesMatch .php$>
 SetHandler "proxy:unix:/var/run/php5-fpm.sock|fcgi://localhost/"
</FilesMatch>
<IfModule dir_module>
 DirectoryIndex index.php index.html
</IfModule>

Next we will enable our mods and configurations:

sudo a2enmod fcgid proxy_fcgi
sudo a2enconf php5-fpm
sudo service php5-fpm restart
sudo service apache2 restart
sudo service mysql restart

Testing

Create a file within /var/www/html and call it test.php

<?php
phpinfo();

Navigate to http://localhost/test.php, if you get the output of phpinfo(), then you’ve done everything correctly!

Have fun, and enjoy! Please comments, questions, and corrections below!

Debian, Linux, Operating Systems, Ubuntu

Debian Chooses Systemd

Debian has decided to move from Sysvinit over to systemd as their new init system for the future. With this change, Ubuntu has followed suit. What this means for the interim, as Ubuntu had preemptively chosen upstart as their init system, remains to be seen. This will mean a vast overhaul of core Ubuntu packages, so Canonical may be on shaky ground for the next couple of releases.

I think this is a good move on the part of Debian since, other than Ubuntu and its derivatives or Gentoo with it’s OpenRC, the other distributions that migrated from Sysvinit have all migrated to Systemd as a default rather than Upstart. The only downside that I see for this migration is non-Linux compatibility for *BSD based distributions, since Systemd is very Linux dependent.

On the other hand, the fact that Systemd targeted Linux at such a low level has allowed them to overcome the limitations of their predecessors, providing a level of service and compatibility in the Linux realm that has been previously reserved for proprietary systems. This is a good thing. They asked why the init system should be limited to what is compatible on all UNIX-like systems, BSD included, when it means giving up capabilities that Linux developers have worked so hard to implement into the system as if they weren’t even there. This was a very good question, and I believe that they were right to do so.

As it stands, systems not using Systemd were using shims for Sysvinit or Upstart to allow pre-requisite systemd components operate as if Systemd were installed, in order to make use of the most advanced features available in newer software. Some software packages, such as Gnome, and GDM ( Gnome Display Manager ), require these capabilities in their newest versions to even run. This is why systems based on FreeBSD don’t yet have Gnome 3.x.

In the end, Debian moving over will ultimately prove the igniting force for the last bastions of the older Linux distributions to finally pull up root and move into the future, with exceptions possibly in the realm of embedded systems. Debian has always been a slow moving giant, focused more heavily on stability than currency. I feel that if it’s stable enough for Debian, you would have to be a fool to use anything older, and I’m pretty certain that most, if not all, of the Linux community will agree with me.

Sources:

  1. Losing graciously – Mark Shuttleworth
  2. Call for votes on default Linux init system for jessie ( Debian )
  3. Debate – Init system – Upstart
  4. Debate – Init system – Systemd