Our recommended server configuration is
Ubuntu 16.04 with MySQL 5.5 and Laravel 5.4 (with composer and other dependencies)
Let’s do this. Fire up your SSH client and connect it to the server using the credentials provided.
Setting up Apache on Ubuntu 16.04
Apache is available within Ubuntu's default software repositories, so we will install it using conventional package management tools.
We will begin by updating the local package index to reflect the latest upstream changes. Afterwards, we can install the apache2 package:
Code: Select all
sudo apt-get update
sudo apt-get install apache2
Installing Curl
To install Curl enter the below command
Code: Select all
$ sudo apt-get install curl
Code: Select all
http://Your-ip-or-domain-name
Installing MySQL
Now that we have our web server up and running, it is time to install MySQL. MySQL is a database management system. Basically, it will organize and provide access to databases where our site can store information.
Again, we can use apt to acquire and install our software. This time, we'll also install some other "helper" packages that will assist us in getting our components to communicate with each other:
Code: Select all
$ sudo apt-get install mysql-server
Enter Y to continue. During the installation, your server will ask you to select and confirm a password for the MySQL "root" user.
This is an administrative account in MySQL that has increased privileges. Think of it as being similar to the root account for the server itself (the one you are configuring now is a MySQL-specific account, however).
Make sure this is a strong, unique password, and do not leave it blank. When the installation is complete, we want to run a simple security script that will remove some dangerous defaults and lock down access to our database system a little bit.
Start the interactive script by running:
Code: Select all
$mysql_secure_installation
Answer Y for yes, or anything else to continue without enabling.
You'll be asked to select a level of password validation. Keep in mind that if you enter 2, for the strongest level, you will receive errors when attempting to set any password which does not contain numbers, upper and lowercase letters, and special characters, or which is based on common dictionary words.
If you are happy with your current password, enter n for "no" at the prompt:
For rest of the questions press Y and hit Enter
Installing PHP
To install PHP and it’s dependencies that connect to MYSQL, etc, we run the following command
Code: Select all
$ sudo apt-get install php7.0 libapache2-mod-php php-mcrypt php-mysql
To do this, type this command to open the dir.conf file in a text editor with root privileges:
Code: Select all
$sudo nano /etc/apache2/mods-enabled/dir.conf
It will look like this:
/etc/apache2/mods-enabled/dir.conf >>
Code: Select all
<IfModule mod_dir.c>
DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
</IfModule>
Code: Select all
<IfModule mod_dir.c>
DirectoryIndex index.php index.cgi index.pl index.html index.xhtml index.htm
</IfModule>
After this, we need to restart the Apache web server in order for our changes to be recognized. You can do this by typing this:
Code: Select all
$ sudo systemctl restart apache2
Code: Select all
$sudo apt-get install php-cli php-cgi php-common php-gd php-gmp
In order to test that our system is configured properly for PHP, we can create a very basic PHP script.
We will call this script info.php. In order for Apache to find the file and serve it correctly, it must be saved to a very specific directory, which is called the "web root".
In Ubuntu 16.04, this directory is located at /var/www/html/. We can create the file at that location by typing:
Code: Select all
$sudo nano /var/www/html/info.php
Code: Select all
<?php
phpinfo();
?>
Installing Laravel Composer
The food delivery script requires the Laravel framework to run. To install the laravel & composer make sure you have PHP 7.0 installed.
On the SSH terminal, type the following command:
Code: Select all
$sudo apt-get install php7.0-mbstring php7.0-xml composer unzip
Code: Select all
$ composer install
$ composer update
$ sudo systemctl restart apache2
Next, we would be uploading the script through FTP and then unzipping it before configuring it.