Thursday, July 5, 2018

How to install wordpress on ubuntu 18.04

There are 3 main components to be installed, before wordpress can be deployed, which are apache2, php and mariadb-server.

Install apache2
$ sudo apt install apache2 libapache2-mod-php 

Install php and its components
$ sudo apt install php php-curl php-gd php-mbstring php-xml php-xmlrpc php-mysql

Install mariadb-server
$ sudo apt install mariadb-server

Create new database
$ mysql -u root
MariaDB [none]> create database mywordpressdb;
MariaDB [none]> grant all on mywordpressdb.* to mywordpressuser@localhost identified by 'password';
MariaDB [none]> flush privileges;


Test the new database using the new user created, you should be able to access the database using the credential created above
$ mysql -u mywordpressuser -p mywordpressdb 
MariaDB [wordpress_db]>


Download wordpress
$ wget -c https://wordpress.org/latest.tar.gz

Extract to /var/www/html
$ tar -xvf latest.tar.gz
$ sudo mv wordpress /var/www/html/mywordpress
$ sudo chown -R www-data /var/www/html/mywordpress


Access your wordpress site using browser, at http://localhost/mywordpress, and follow the onscreen instruction




Tuesday, July 3, 2018

How to install joomla 3.8.10 on ubuntu 18.04

3 main components to make joomla work are nginx, mariadb and php.

Install nginx
$ sudo apt install nginx

Install mariadb
$ sudo apt install mariadb-server

Install php and required components
$ sudo apt install php php-zlib php-xml php-json php-mcrypt 

Download joomla
$ wget -c https://downloads.joomla.org/cms/joomla3/3-8-10/Joomla_3-8-10-Stable-Full_Package.tar.bz2

Extract joomla
$ mkdir joomla
$ tar -xvf Joomla_3-8-10-Stable-Full_Package.tar.bz2 -C joomla


Deploy to DocumentRoot
$ sudo mv joomla /var/www/html/
$ sudo chown www-data -R /var/www/html/joomla


Create database
$ sudo mysql
MariaDB [(none)]> create database joomla;
MariaDB [(none)]> grant all on joomla.* to joomla@localhost identified by 'password';
MariaDB [(none)]> flush privileges;


Edit nginx config as per below:
server {
    listen 80;
    listen [::]:80;
    root /var/www/html/joomla;
    index  index.php index.html index.htm;
    server_name  192.168.10.100;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ \.php$ {
         include snippets/fastcgi-php.conf;
         fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
         include fastcgi_params;
    }

}


Test for syntax error
$ sudo nginx -t

Restart nginx
$ sudo systemctl restart nginx

Browse 192.168.10.100 and follow the joomla installation wizard until finish.