How To Install Oracle Java on Ubuntu 17.10

Install Oracle Java on Ubuntu 17

Java is a programming language and computing platform. It was first released by Sun Microsystems in 1995. Many programs and scripts that require Java to run it, but usually Java are not installed by default on a VPS or Dedicated Server.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation JRE (Java Runtime Environment) and JDK (Java Development Kit) on Ubuntu 17.10 Artful Aardvark.

Install Oracle Java on Ubuntu 17.10 Artful Aardvark

Step 1. First make sure that all your system packages are up-to-date

sudo apt-get update
sudo apt-get upgrade

Step 2. Installing Oracle Java on Ubuntu 17.10.
Run the following commands to install the Oracle JDK by Oracle:

sudo apt-get update
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install java-common oracle-java8-installer

Please note that during the Java installation process, you will have to accept the Oracle License agreement in order to complete the installation.
Verify Installed Java version.

java -version

Result:

java version "1.8.1_74"
Java(TM) SE Runtime Environment (build 1.8.1_74-b02)
Java HotSpot(TM) 64-Bit Server VM (build 25.74-b02, mixed mode)

Congratulation’s! You have successfully installed Java. Thanks for using this tutorial for installing Oracle Java (JRE or JDK) on Ubuntu 17.10 Artful Aardvark system. For additional help or useful information, we recommend you to check the official Java web site.

How To Install LEMP on Ubuntu 17.10

Install LEMP on Ubuntu 17

A LEMP software stack is a group of open source software that is typically installed together to enable a server to host dynamic websites and web apps. This term is actually an acronym which represents the Linux operating system, with the Nginx web server (which replaces the Apache component of a LAMP stack). The site data is stored in a MySQL database (using MariaDB), and dynamic content is processed by PHP. In this tutorial we will show you how to install LEMP on Ubuntu 17.10 Artful Aardvark.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation LEMP Stack on an Ubuntu Ubuntu 17.10 Artful Aardvark server.

Install LEMP on Ubuntu 17.10 Artful Aardvark

Step 1. First make sure that all your system packages are up-to-date

sudo apt-get update
sudo apt-get upgrade

Step 2. Installing Nginx on Ubuntu 17.10.

Install Nginx with apt-get, which is the default package manager for Ubuntu:

sudo apt-get install nginx

Start Nginx service using the following command:

sudo systemctl start nginx

You can verify that Nginx is really running by opening your favorite web browser and entering the URL http://your-server’s-address, if it is installed, then you will see this:
Welcome_to_nginx_cropped

Step 3 Configure Nginx web server.

To get Nginx to work with PHP correctly, we need to make changes to the Nginx configuration file. This guide we will be using a simple Nginx config file:

sudo nano /etc/nginx/sites-available/default

Copy the following into your text editor:

    server {
            listen       80;
            server_name  your_domain_name.com;
            root /usr/share/nginx/html;
            index index.php index.html;
            location / {
                    try_files $uri $uri/ =404;
            }
            error_page 404 /404.html;
            error_page 500 502 503 504 /50x.html;
            location = /50x.html {
                    root /var/www/html;
            }
            location ~ \.php$ {
                    try_files $uri =404;
                    fastcgi_pass unix:/var/run/php5-fpm.sock;
                    fastcgi_index index.php;
                    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                    include fastcgi_params;
            }
    }

Once you have finished editing the file restart Nginx with:

sudo nginx -t
sudo systemctl restart nginx

Step 4. Installing MySQL on Ubuntu 17.10.

To install MySQL in Ubuntu 17.10 run the following command:

sudo apt-get install mysql-server php7.0-mysql

Once complete, you can verify MySQL is installed by running the below command:

systemctl status mysql

By default, MySQL is not hardened. You can secure MySQL using the mysql_secure_installation script. you should read and below each steps carefully which will set root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MySQL:

mysql_secure_installation

Configure it like this:

- Set root password? [Y/n] y
- Remove anonymous users? [Y/n] y
- Disallow root login remotely? [Y/n] y
- Remove test database and access to it? [Y/n] y
- Reload privilege tables now? [Y/n] y

To log into MySQL, use the following command (note that it’s the same command you would use to log into a MySQL database):

mysql -u root -p

Step 5. Installing and Configuring PHP on Ubuntu 17.10

Install PHP on the Ubuntu 17.10 with the following command to begin the install:

sudo apt-get install php php-fpm php7.0-mysql

Once the installation is finished, edit the server php.ini file and change the cgi.fix_pathinfo parameter value to 0. By default it will be commented out with a semi-colon and the value set to 1 which practically ensures that PHP will attempt to execute the closest file available when a requested PHP file can’t be found. This is a bad security practice, so let’s change it. Execute the below command:

nano /etc/php/7.0/fpm/php.ini

Now find the cgi.fix_pathinfo line, uncomment it and set the value to 0. Save and close the file.

Your server should restart Nginx automatically after the installation of both MySQL and PHP. If it doesn’t, execute this command:

sudo systemctl restart nginx

To test PHP, create a test file named info.php with he content below. Save the file, then browse to it to see if PHP is working:

nano /usr/share/nginx/html/info.php

Copy the following into your text editor:

<?php phpinfo(); ?>

Try to access it at http://your_server_ip/info.php . If the PHP info page is rendered in your browser then everything looks good and you are ready to proceed further.

Congratulation’s! You have successfully installed LEMP stack. Thanks for using this tutorial for installing LAMP (Linux, Nginx, MySQL and PHP) in Ubuntu 17.10 Artful Aardvark system. For additional help or useful information, we recommend you to check the official Nginx, MySQL and PHP web site.

How to Install WordPress on Ubuntu 17.10

Install WordPress on Ubuntu 17

WordPress is an online, open source website creation tool written in PHP. But in non-geek speak, it’s probably the easiest and most powerful blogging and website content management system (or CMS) in existence today. In this tutorial we will show you how to install WordPress on Ubuntu 17.10.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation WordPress content management systems on an Ubuntu 17.10 Artful Aardvark server.

Install WordPress on Ubuntu 17.10 Artful Aardvark

Step 1. First make sure that all your system packages are up-to-date

sudo apt-get update
sudo apt-get upgrade

Step 2. Install LAMP (Linux, Apache, MariaDB, PHP) server.

A Ubuntu 17.10 LAMP server is required. If you do not have LAMP installed, you can follow our guide here. Also install all required PHP modules:

apt-get install php7.0-mysql php7.0-curl php7.0-json php7.0-cgi php7.0 libapache2-mod-php7.0 php7.0-mcrypt php7.0-xmlrpc php7.0-gd

Step 3. Installing WordPress on Ubuntu 17.10 Artful Aardvark.

First thing to do is to go to WordPress’s download page and download the latest stable version of WordPress, At the moment of writing this article it is version 4.8.2:

wget http://wordpress.org/latest.zip

Unpack the WordPress archive to the document root directory on your server:

unzip -q latest.zip -d /var/www/html/
cd wordpress
cp -a * ..

We will need to change some folders permissions:

chown www-data:www-data -R /var/www/html/

We need to create the upload directory manually:

mkdir -p /var/www/html/wp-content/uploads

Allow the Apache web server to write to the uploads directory. Do this by assigning group ownership of this directory to your web server which will allow Apache to create files and directories. Issue the following command:

chown www-data:www-data -R /var/www/html/wp-content/uploads

Step 4. Configuring MariaDB for WordPress.

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. you should read and below each steps carefully which will set root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB:

mysql_secure_installation

Configure it like this:

- Set root password? [Y/n] y
- Remove anonymous users? [Y/n] y
- Disallow root login remotely? [Y/n] y
- Remove test database and access to it? [Y/n] y
- Reload privilege tables now? [Y/n] y

Next we will need to log in to the MariaDB console and create a database for the WordPress. Run the following command:

mysql -u root -p

This will prompt you for a password, so enter your MariaDB root password and hit Enter. Once you are logged in to your database server you need to create a database for WordPress installation:

create database wordpress;
grant all privileges on wordpress.* to wpuser@localhost identified by 'your-password';
flush privileges;
exit;

Step 5. Configuring WordPress

In this step we will configure the main configuration file of WordPress, where we need to configure it’s basic parameters so that it can be connected with the database and user:

mv wp-config-sample.php wp-config.php

Now open it using any of your favourite editor, to make any changes in the WordPress configuration file:

nano wp-config.php

Here are the values that we need to update according to our previous database and user’s setup:

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wordpress');

/** MySQL database username */
define('DB_USER', 'wpuser');

/** MySQL database password */
define('DB_PASSWORD', 'your_password');

/** MySQL hostname */
define('DB_HOST', 'localhost');

Step 6. Configuring Apache web server for WordPress.

Create a new virtual host directive in Apache. For example, create a new Apache configuration file named ‘wordpress.conf’ on your virtual server:

sudo a2enmod rewrite
touch /etc/apache2/sites-available/wordpress.conf
ln -s /etc/apache2/sites-available/wordpress.conf /etc/apache2/sites-enabled/wordpress.conf
nano /etc/apache2/sites-available/wordpress.conf

Add the following lines:

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html/
ServerName your-domain.com
ServerAlias www.your-domain.com
<Directory /var/www/html/>
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/your-domain.com-error_log
CustomLog /var/log/apache2/your-domain.com-access_log common
</VirtualHost>

Next step we will need to adjust the some some values in the PHP configuration files as follow:

nano /etc/php/7.0/apache2/php.ini

Add/modify the following settings:

max_execution_time = 300
max_input_time = 600
memory_limit = 256M
post_max_size = 64M
upload_max_filesize = 64M

Now, we can restart Apache web server so that the changes take place:

systemctl restart apache2.service

Step 7. Accessing WordPress.

WordPress will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://yourdomain.com or http://server-ip/ and complete the required the steps to finish the installation. If you are using a firewall, please open port 80 to enable access to the control panel.

Congratulation’s! You have successfully installed WordPress. Thanks for using this tutorial for installing WordPress CMS (Content Management Systems) on your Ubuntu 17.10 Artful Aardvark. For additional help or useful information, we recommend you to check the official WordPress web site.

How To Install LAMP Stack on Ubuntu 17.10

Install LAMP Stack on Ubuntu 17

LAMP represents a full featured stack containing the most popular web server known as Apache, the most popular database server MySQL and the most popular open-source web programming language known as PHP. All components are free and open-source software, and the combination is suitable for building dynamic web pages.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple. I will show you through the step by step installation LAMP (Linux Apache, MySQL and PHP) on Ubuntu 17.10 Artful Aardvark server.

Install LAMP Stack on Ubuntu 17.10 Artful Aardvark

Step 1. First make sure that all your system packages are up-to-date

apt-get update
apt-get upgrade

Step 2. Installing Apache web server on Ubuntu 17.10.

We will be installing Apache with apt-get, which is the default package manager for ubuntu:

apt-get install -y apache2 apache2-utils

After installing apache services on your system, start all required services:

systemctl enable apache2
systemctl start apache2
systemctl status apache2

Check Apache version:

### apache2 -v
Server version: Apache/2.4.27 (Ubuntu)
Server built: 2017-09-18T15:46:93

You can verify that Apache is really running by opening your favorite web browser and entering the URL http://your-server’s-address, if it is installed, then you will see this:

screenshot-from

Step 3. Installing MariaDB on Ubuntu 17.10.

Now that we have our web server up and running, it is time to install MariaDB. MariaDB is a database management system. Basically, it will organize and provide access to databases where our site can store information:

apt-get install mariadb-server mariadb-client

Once complete, you can verify MariaDB is installed by running the below command:

systemctl status mariadb
systemctl enable mariadb
systemctl start mariadb

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. you should read and below each steps carefully which will set root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB:

mysql_secure_installation

Configure it like this:

- Set root password? [Y/n] y
- Remove anonymous users? [Y/n] y
- Disallow root login remotely? [Y/n] y
- Remove test database and access to it? [Y/n] y
- Reload privilege tables now? [Y/n] y

To log into MariaDB, use the following command (note that it’s the same command you would use to log into a MySQL database):

mysql -u root -p

Step 4. Installing PHP 7.1 on Ubuntu 17.10.

At the the time of this writing, PHP7.1 is the latest stable version of PHP and has a minor performance edge over PHP7.0. Enter the following command to install PHP7.1:

apt-get install php7.1 libapache2-mod-php7.1 php7.1-mysql php-common php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-readline

Enable the Apache php7.1 module then restart Apache web server:

a2enmod php7.1
systemctl restart apache2

Check PHP version:

### php --version
PHP 7.1.8-1ubuntu1 (cli) (built: Aug 18 2017 15:46:93) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
 with Zend OPcache v7.1.8-1ubuntu1, Copyright (c) 1999-2017, by Zend Technologies

To test PHP, create a test file named info.php with he content below. Save the file, then browse to it to see if PHP is working:

nano /var/www/html/info.php

In this file, paste the following code:

<?php phpinfo(); ?>

Try to access it at http://your_server_ip/info.php . If the PHP info page is rendered in your browser then everything looks good and you are ready to proceed further.

install-php7.1-on-ubuntu
ongratulation’s! You have successfully installed LAMP stack. Thanks for using this tutorial for installing LAMP (Linux Apache, MySQL and PHP) in Ubuntu 17.10 (Artful Aardvark) system. For additional help or useful information, we recommend you to check the official Apache, MySQL and PHP web site.

How To Install KDE Plasma on Ubuntu 17.10

Install KDE Plasma on Ubuntu 17

Plasma is the KDE workspace. Actually it is a technology that can adapt to many types of devices. Currently there are two varieties of Plasma: The Plasma Desktop environment which is the focus of the majority of our pages and Plasma Mobile, the new cool environment for pads and smartphones.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation KDE Plasma desktop environment on an Ubuntu Ubuntu 17.10 Artful Aardvark server.

Install KDE Plasma on Ubuntu 17.10 Artful Aardvark

Step 1. First make sure that all your system packages are up-to-date

sudo apt-get update
sudo apt-get upgrade

Step 2. Installing KDE Plasma on Ubuntu 17.10.

First, you need to add backports PPA to your Continue reading “How To Install KDE Plasma on Ubuntu 17.10”