In a previous post, we set up our Olinuxino Lime with Debian. Now let’s set up more services in our server, two basics: web server with PHP support and MySQL. The goal is to run WordPress in it. Let’s go to the mess ;):
The web server is already set up (nginx) from the previous post. In order to install php, we only need a command:
$ sudo apt-get install php5-fpm php5-mysql mysql-server
Why fpm?, because the performance will be better in our small server. Also we will install a few extensions and the other services as web server. After a while installing all the packages, everything will be ready. During set up, will appear a wizard to set up mysql (will ask for passwords, etc..) If it doesn’t appear, we can call directly:
$ sudo mysql_secure_installation
In this wizard, just leave default options and configure a root password. Once we have php and mysql working, let’s install phpmyadmin to administrate easily the database:
$ sudo apt-get install phpmyadmin
During installation it will ask for the root passowrd that we configured in mysql the last step. Everything else should be accepted as it comes. After finishing, let’s tell nginx where is located phpmyadmin:
$ sudo ln -s /usr/share/phpmyadmin /var/www/gestionarbbdd
To have a bit more security, we change the default access /phpmyadmin/ to another one (/gestionarbbdd/), can be anything, but we should remember it. If we open a browser and point it to http://lime-ip/gestionarbbdd/ phpmyadmin should appear and ask for an user/password. We should be able to access with the root user.
In case it doesn’t work, let’s make sure that all services are up and running, and also that mcrypt module is enabled:
$ sudo service nginx start $ sudo php5enmod mcrypt $ sudo service php5-fpm restart $ sudo service mysql start
At this point we can now install WordPress or any PHP+MySQL application. Let’s install WordPress, change to www directory, download wordpress and decompress:
$ cd /var/www/ $ wget https://wordpress.org/latest.tar.gz $ tar xzvf latest.tar.gz
Now we can access to WordPress autoinstaller in the url http://lime-ip/wordpress/. The autoinstaller will ask for the administrator password of MySQL. Just follow the steps in the wizard and we will have the site online in less than half a minute.