After publishing the previous note on setting up my development environment, I find myself spending more time in the CLI (usually via SSH from host). Then I find myself not needing all the GUI apps in a standard Ubuntu desktop environment so I went ahead and set up a new environment based on Ubuntu Quantal server edition beta-1. For some reason my network stopped working and didn’t really want to spend time finding out the cause, so I reinstalled everything again today using the final installer, as well as the updated Virtualbox 4.2.6.
Setting up Ubuntu Server
This is the continuation of the previous guide, so first thing first a complete installation of Ubuntu server is needed. In order to install Ubuntu-desktop without other addons, with just Unity, issue the following command:
sudo apt-get install ubuntu-desktop --no-install-recommends
Just to check everything works properly, start the desktop environment with this command.
I needed the virtual machine to not boot to lightdm, therefore I issue this command to stop it from loaded automatically on boot according to this guide.
echo "manual" | sudo tee -a /etc/init/lightdm.override
Dash may not be functioning and wouldn’t able to launch any application, to fix that, issue the following command (I am lazy, so I installed all the available lens).
sudo apt-get install unity-lens-*
For some reason, the virtual machine is suffering some graphical glitches despite Virtualbox 4.2.6 claimed to fix this problem already. However, it doesn’t seem to work in my case even after installing the Guest Additions. So I installed CCSM
sudo apt-get install compizconfig-settings-manager
and followed the suggestion here to disable an option named “Framebuffer object” in the OpenGL plugin and everything seems to work properly now.
There are still some missing applets, and I installed this package to enable the global menu according to this QnA answer.
sudo apt-get install indicator-appmenu
After knowing how great PHP would be with fastcgi, I followed this guide to get it working. I made some changes here and there for experimental purpose (for example, using event mpm instead of worker mpm), as follows.
Firstly, replace apache’s mpm module
sudo apt-get install apache2-mpm-event
Then install PHP5-FPM and fastcgi module (assuming you already have basic LAMP stack installed)
sudo apt-get install php5-fpm libapache2-mod-fastcgi sudo a2enmod actions fastcgi alias sudo service apache2 restart
As I am using userdir module (not too interested in setting up apache properly, not really interested in sysadmin magic here), so I pasted these settings in my /etc/apache2/mods-enabled/userdir.conf within
<IfModule mod_userdir.c> as mentioned in the previous guide
<IfModule mod_fastcgi.c> AddHandler php5-fcgi .php Action php5-fcgi /php5-fcgi Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /var/run/php5-fpm.sock -pass-header Authorization </IfModule>
Create a script in
~/public_html and run it in a browser, and FPM/FastCGI should show up in Server API field. And that’s it, my part-2 of the set up of development environment. This installation feels a lot more lighter and my computer fan doesn’t seem to be spinning at full speed all the time.