Hosting a web site on a shared hosting environment is convenient, but it doesn’t offer you the flexibility we sometimes need. This is a case when we need to access the server directly, to change file permissions or run a Python script on the server. In a shared host environment, the user only has access to the File Manager through a cPanel (if available) and that’s all. Moreover the VPS servers are relatively cheaper. A quick Duck Duck Go 🙂 search will provide you with a lot of results starting from only $5/month.
Also a VPS server is, at least in theory, faster than a Shared Hosting Environment. Generally speaking, if you need total freedom, you will find it difficult to stay in a Shared Host. Now that I convinced you let’s go to our tutorial!
I will try to keep the process as quick as possible and avoid approaching it with photos or videos. I suppose the user knows how to use the Terminal and troubleshoot any errors. The process is rather long and my goal is to create a quick guide, with all the small details that might occur (like permission assignment) and that are forgotten sometimes or haven’t been tested on the process. Thus, I have cloned the whole process, but there is a strong possibility you might find some small differences. I will be happy to read your comments and add/correct commands that would work more globally for a bigger variety of systems.
So the scenario is that we have just bought some VPS hosting from some online company and we want to install Joomla! on an absolutely empty linux server.
- Firstly, we need to buy a VPS from some provider. Like I mentioned, this can be really cheap and you can have some options here:
- Next we need to open a terminal (Ctrl+Alt+T) and type
ssh [email protected]_ADRESS_OF_YOUR_VPS
- Install unzip:
apt-get install sudo unzip
- We need to create the user (let’s name it solomon):
useradd -m -s /bin/bash solomon
-m option will create a folder named solomon inside the home directory of your account
-s option will define the default shell to be bash
- We need to change the user password (let’s call it solomon):
- We need to place the user we just created into the SUDO: We type
visudoand then in the edit screen under
#allow memberswe add
ALL=(ALL:ALL) ALLand SAVE
- Prevent the root user from login with SSH:
We need to find the command
PermitRootLogin noand set it to no.
- Save & Exit
- We login again as the new user:
ssh [email protected]_ADRESS_OF_YOUR_VPS
- Enter password
- Now we need to install some useful programmes:
sudo apt-get install apache2 mysql php5
- We will see a window asking for the mySQL Password (Note this down because it is very important)
- Install some more scripts:
sudo apt-get install php5-gd php5-mysql
- Now we are ready to install Joomla!
- We create the necessary directories:
- Get joomla from the website: (You need to go to https://downloads.joomla.org/ and copy link adress with your mouse in order to have the latest version of joomla- for me it is 3-6-5)
sudo mkdir joomla
- We unzip the file
sudo unzip /home/solomon/bin/joomla/joomla_3-6-5-stable-full_package-zip
- Now we have to change the ownership of the folder so www-data owns it:
chown www-data:www-data ./joomla/
- We create the database user, the database and assign the user to the database:
mysql -u -root -p
- -u option:means user
- -p option:means password
- Now we have entered the mySQL terminal – We need to create a user and assign a password:
CREATE USER 'joomla_user'@'localhost' IDENTIFIED BY 'we_define_a_password_here';
- We create the database:
CREATE DATABASE joomla_db;
GRANT ALL PRIVILEGES ON joomla_db.* TO 'joomla_user'@'localhost';
This is the end of the Tutorial. I am positive it contains all the necessary steps to perform the task. Implications might appear for different system Hardware Setups and different Linux Distributions, but it is unlikely. The commands are Standard Linux Network Administration Commands.
The benefit of having this task performed fast and the flexibility to have an easy-to-read-and-execute Walkthrough, has been my main motivation.
Hope you enjoy it and please feel free to comment and suggest!
The top image was downloaded from:https://alpha.wallhaven.cc
Usefull info: https://docs.joomla.org/Creating_A_VPS_Testing_Server