Search for:
Installing LLMP (Linux, Lighttpd, MariaDB, PHP5/PhpMyAdmin) in Ubuntu 14.04

Installing LLMP (Linux, Lighttpd, MariaDB, PHP5/PhpMyAdmin) in Ubuntu 14.04 &-8211; this Article or News was published on this date:2019-05-28 19:03:24 kindly share it with friends if you find it helpful

Lighttpd is an open-source webserver for Linux machines, very fast and very small in size, it doesn’t require a lot of memory and CPU usage which makes it one of the best servers for any project that needs speed in deploying web pages.

Install Lighttpd on Ubuntu 14.04Install Lighttpd on Ubuntu 14.04

Install LLMP on Ubuntu 14.04

Lighttpd Features

  1. Support for FastCGI, SCGI, CGI interfaces.
  2. Support for using chroot.
  3. Support for mod_rewrite.
  4. Support for TLS/SSL using OpenSSL.
  5. A Very small size: 1MB.
  6. Low CPU and RAM usage.
  7. Licensed under BSD license.

This article explains how to install Lighttpd, MariaDB, PHP5 with PhpMyAdmin on Ubuntu 14.04.

Step 1: Installing Lighttpd

Fortunately, Lighttpd is available to install from the official Ubuntu repositories, So if you want to install Lighttpd, you only have to run this command.

$ sudo apt-get install lighttpd
Install Lighttpd on Ubuntu 14.04Install Lighttpd in Ubuntu

Install Lighttpd in Ubuntu

Once, Lighttpd installed, you can go to your website or IP address and you will see this page which confirm the installation of Lighttpd on your machine.

Install Lighttpd on Ubuntu 14.04Verify Lighttpd Page

Verify Lighttpd Page

Before, heading up for the further installation, I would like to tell you that following are the important things of Lighttpd you should know before continuing.

  1. /var/www/ – is the default root folder for Lighttpd.
  2. /etc/lighttpd/ – is the default folder for Lighttpd configuration files.

Step 2: Installing PHP5 and Modules

Lighttpd webserver won’t be usable without PHP FastCI support. Additionally, you also need to install the ‘php5-mysql’ package to enable MySQL support.

- sudo apt-get install php5-cgi php5-mysql

Now to enable PHP module, run the following commands in the terminal.

$ sudo lighty-enable-mod fastcgi 
$ sudo lighty-enable-mod fastcgi-php

After enabling modules, reload the Lighttpd server configuration by running the below command.

$ sudo service lighttpd force-reload

Now to test if PHP is working or not, let’s create a ‘test.php‘ file in /var/www/test.php.

$ sudo vi /var/www/test.php

Press the “i” button to start editing, and add the following line to it.

?php phpinfo(); ?>

Press ESC key, and write 😡 and press Enter key to save the file.

Now go to your domain or IP address and call test.php file, like http://127.0.0.1/test.php. You will see this page which means that PHP is installed successfully.

Install Lighttpd on Ubuntu 14.04Install PHP in Ubuntu

Verify PHP Installation

Step 3: Installing MariaDB

MariaDB is a fork from MySQL, it is also a good database server to use with Lighttpd, to install it on Ubuntu 14.04 run these series of commands in the terminal.

$ sudo apt-get install software-properties-common
$ sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
$ sudo add-apt-repository 'deb ftp://ftp.ulak.net.tr/pub/MariaDB/repo/10.1/ubuntu trusty main'
$ sudo apt-get update
$ sudo apt-get install mariadb-server

During installation, you will be asked to enter the MySQL password you want to use with the “root” user, write the password you want, press the “Tab” button and hit Enter.

Install Lighttpd on Ubuntu 14.04Set MySQL Password in Ubuntu

Set MariaDB Password

Retype the password again.

Install Lighttpd on Ubuntu 14.04Repeat MariaDB Password

Repeat MariaDB Password

Installing PhpMyAdmin

PhpMyAdmin is a powerful web interface to manage databases online, almost every system admin use it because it is very easy to manage databases using it. To install it on Ubuntu 14.04, run the below command.

$ sudo apt-get install phpmyadmin

During installation, it will show you the below dialog, choose .NO‘.

Install Lighttpd on Ubuntu 14.04Install Phpmyadmin in Ubuntu

Install Phpmyadmin

Now choose ‘Lighttpd‘.

Install Lighttpd on Ubuntu 14.04Choose Lighttpd Webserver

Choose Lighttpd Webserver

We are almost done here, just run this simple command to create a symlink in /var/www/ to the phpmyadmin folder in /usr/share/.

$ sudo ln -s /usr/share/phpmyadmin/ /var/www

Now go to http://localhost/phpmyadmin and it will ask you to enter root password, that you’ve set above during mariadb installation.

Install Lighttpd on Ubuntu 14.04PhpMyAdmin Web Access

PhpMyAdmin Web Access

That’s it, all of your server components are up and running now, You can start deploying your web projects.

How to Install Latest MySQL 8.0 on RHEL/CentOS and Fedora

How to Install Latest MySQL 8.0 on RHEL/CentOS and Fedora &-8211; this Article or News was published on this date:2019-05-28 16:12:00 kindly share it with friends if you find it helpful

MySQL is an open source free relational database management system (RDBMS) released under GNU (General Public License). It is used to run multiple databases on any single server by providing multi-user access to each created database.

This article will walk through you the process of installing and updating latest MySQL 8.0 version on RHEL/CentOS 7/6/ and Fedora 28-26 using MySQL Yum repository via YUM utility.

Step 1: Adding the MySQL Yum Repository

1. We will use official MySQL Yum software repository, which will provides RPM packages for installing the latest version of MySQL server, client, MySQL Utilities, MySQL Workbench, Connector/ODBC, and Connector/Python for the RHEL/CentOS 7/6/ and Fedora 28-26.

Important: These instructions only works on fresh installation of MySQL on the server, if there is already a MySQL installed using a third-party-distributed RPM package, then I recommend you to upgrade or replace the installed MySQL package using the MySQL Yum Repository”.

Before Upgrading or Replacing old MySQL package, don’t forget to take all important databases backup and configuration files.

2. Now download and add the following MySQL Yum repository to your respective Linux distribution system’s repository list to install the latest version of MySQL (i.e. 8.0 released on 27 July 2018).

--------------- On RHEL/CentOS 7 ---------------
- wget https://repo.mysql.com/mysql80-community-release-el7-1.noarch.rpm
--------------- On RHEL/CentOS 6 ---------------
- wget https://dev.mysql.com/get/mysql80-community-release-el6-1.noarch.rpm
--------------- On Fedora 28 ---------------
- wget https://dev.mysql.com/get/mysql80-community-release-fc28-1.noarch.rpm
--------------- On Fedora 27 ---------------
- wget https://dev.mysql.com/get/mysql80-community-release-fc27-1.noarch.rpm
--------------- On Fedora 26 ---------------
- wget https://dev.mysql.com/get/mysql80-community-release-fc26-1.noarch.rpm

3. After downloading the package for your Linux platform, now install the downloaded package with the following command.

--------------- On RHEL/CentOS 7 ---------------
- yum localinstall mysql80-community-release-el7-1.noarch.rpm
--------------- On RHEL/CentOS 6 ---------------
- yum localinstall mysql80-community-release-el6-1.noarch.rpm
--------------- On Fedora 28 ---------------
- dnf localinstall mysql80-community-release-fc28-1.noarch.rpm
--------------- On Fedora 27 ---------------
- dnf localinstall mysql80-community-release-fc27-1.noarch.rpm
--------------- On Fedora 26 ---------------
- yum localinstall mysql80-community-release-fc26-1.noarch.rpm

The above installation command adds the MySQL Yum repository to system’s repository list and downloads the GnuPG key to verify the integrity of the packages.

4. You can verify that the MySQL Yum repository has been added successfully by using following command.

- yum repolist enabled | grep "mysql.*-community.*"
- dnf repolist enabled | grep "mysql.*-community.*"      [On Fedora versions]
Verify MySQL Yum RepositoryVerify MySQL Yum Repository

Verify MySQL Yum Repository

Step 2: Installing Latest MySQL Version

5. Install latest version of MySQL (currently 8.0) using the following command.

- yum install mysql-community-server
- dnf install mysql-community-server      [On Fedora versions]

The above command installs all the needed packages for MySQL server mysql-community-server, mysql-community-client, mysql-community-common and mysql-community-libs.

Step 3: Installing MySQL Release Series

6. You can also install different MySQL version using different sub-repositories of MySQL Community Server. The sub-repository for the recent MySQL series (currently MySQL 8.0) is activated by default, and the sub-repositories for all other versions (for example, the MySQL 5.x series) are deactivated by default.

To install specific version from specific sub-repository, you can use --enable or --disable options using yum-config-manager or dnf config-manager as shown:

- yum-config-manager --disable mysql57-community
- yum-config-manager --enable mysql56-community
------------------ Fedora Versions ------------------
- dnf config-manager --disable mysql57-community
- dnf config-manager --enable mysql56-community

Step 4: Starting the MySQL Server

7. After successful installation of MySQL, it’s time to start the MySQL server with the following command:

- service mysqld start

You can verify the status of the MySQL server with the help of following command.

- service mysqld status

This is the sample output of running MySQL under my CentOS 7 box.

Redirecting to /bin/systemctl status  mysqld.service
mysqld.service - MySQL Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled)
   Active: active (running) since Thu 2015-10-29 05:15:19 EDT; 4min 5s ago
  Process: 5314 ExecStart=/usr/sbin/mysqld --daemonize $MYSQLD_OPTS (code=exited, status=0/SUCCESS)
  Process: 5298 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
 Main PID: 5317 (mysqld)
   CGroup: /system.slice/mysqld.service
           └─5317 /usr/sbin/mysqld --daemonize

Oct 29 05:15:19 localhost.localdomain systemd[1]: Started MySQL Server.
Verify MySQL Yum RepositoryCheck Mysql Status

Check Mysql Status

8. Now finally verify the installed MySQL version using following command.

- mysql --version

mysql  Ver 8.0.12 for Linux on x86_64 (MySQL Community Server - GPL)
Verify MySQL Yum RepositoryCheck MySQL Installed Version

Check MySQL Installed Version

Step 5: Securing the MySQL Installation

9. The command mysql_secure_installation allows you to secure your MySQL installation by performing important settings like setting the root password, removing anonymous users, removing root login, and so on.

Note: MySQL version 8.0 or higher generates a temporary random password in /var/log/mysqld.log after installation.

Use below command to see the password before running mysql secure command.

- grep 'temporary password' /var/log/mysqld.log

Once you know the password you can now run following command to secure your MySQL installation.

- mysql_secure_installation

Note: Enter new Root password means your temporary password from file /var/log/mysqld.log.

Now follow the onscreen instructions carefully, for reference see the output of the above command below.

Sample Output
Securing the MySQL server deployment.

Enter password for user root: Enter New Root Password

VALIDATE PASSWORD PLUGIN can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?

Press y|Y for Yes, any other key for No: y

There are three levels of password validation policy:

LOW    Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary                  file

Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2
Using existing password for root.

Estimated strength of the password: 50 
Change the password for root ? ((Press y|Y for Yes, any other key for No) : y

New password: Set New MySQL Password

Re-enter new password: Re-enter New MySQL Password

Estimated strength of the password: 100 
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.


Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Success.

By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.

Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
 - Dropping test database...
Success.

 - Removing privileges on test database...
Success.

Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.

All done! 

Step 6: Connecting to MySQL Server

10. Connecting to newly installed MySQL server by providing username and password.

- mysql -u root -p

Sample Output:

Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 19
Server version: 8.0.1 MySQL Community Server (GPL)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
mysql>

Step 7: Updating MySQL with Yum

11. Besides fresh installation, you can also do updates for MySQL products and components with the help of following command.

- yum update mysql-server
- dnf update mysql-server       [On Fedora versions]
Verify MySQL Yum RepositoryUpdate MySQL Version

Update MySQL Version

When new updates are available for MySQL, it will auto install them, if not you will get a message saying NO packages marked for updates.

That’s it, you’ve successfully installed MySQL 8.0 on your system. If you’re having any trouble installing feel free to use our comment section for solutions.