Ubuntu 18.04 – TecAdmin https://tecadmin.net How to guide for System Administrator's and Developers Sun, 22 May 2022 08:26:10 +0000 en-US hourly 1 https://wordpress.org/?v=6.1.1 How To Install and Configure VNC Server on Ubuntu 18.04 https://tecadmin.net/how-to-install-and-configure-vnc-on-ubuntu-18-04/ https://tecadmin.net/how-to-install-and-configure-vnc-on-ubuntu-18-04/#respond Tue, 22 Dec 2020 16:41:08 +0000 https://tecadmin.net/?p=21827 VNC stands for “Virtual Network Computing” is the set of protocols for sharing desktop systems remotely. There are many software available to access Linux based desktop remotely including, TigerVNC, TightVNC, Vino, vnc4server and many more. TigerVNC is a free, open-source and high-performance VNC server used to control or access Linux based desktop systems remotely. It [...]

The post How To Install and Configure VNC Server on Ubuntu 18.04 appeared first on TecAdmin.

]]>
VNC stands for “Virtual Network Computing” is the set of protocols for sharing desktop systems remotely. There are many software available to access Linux based desktop remotely including, TigerVNC, TightVNC, Vino, vnc4server and many more.

TigerVNC is a free, open-source and high-performance VNC server used to control or access Linux based desktop systems remotely. It is a client/server application that allows you to interact with graphical applications on remote machines.

This tutorial described you to how to install and configure VNC server on Ubuntu 18.04 Linux system..

Prerequisites

By default, Ubuntu Server does not include a Desktop Environment. TigerVNC server is designed to controls only desktop systems. So you will need to add a desktop environment in your server.

First, update and upgrade all installed packages with the following command:

sudo apt update && apt upgrade 

Once your system is updated, install the tasksel utility to install a desktop environment:

sudo apt install tasksel -y 

After installing Tasksel, launch the Tasksel utility with the following command:

sudo tasksel 

You should see the following interface:

Tasksel Install Ubuntu Desktop

Use the arrow key to scroll down the list and find Ubuntu desktop. Next, press the Space key to select it then press the Tab key to select OK then hit Enter to install the Ubuntu desktop.

Once all the packages are installed, you will need to set your system boots into the graphical target. You can set it with the following command:

sudo systemctl set-default graphical.target 

Next, restart your system to apply the changes.

Step 2 – Install VNC Server on Ubuntu 18.04

The default Ubuntu 18.04 apt repositories contains TigerVNC server package. You can install it by just running the following command:

sudo apt install tigervnc-standalone-server -y 

After installing TigerVNC, create a new user and set a VNC password for that user.

First, create a new user named tecadmin with the following command:

sudo adduser tecadmin 

Next, switch the user to tecadmin and set a VNC password with the following command:

su - tecadmin
vncpasswd 

Provide your desired password as shown below:

Password:
Verify:
Would you like to enter a view-only password (y/n)? n

Next, start the VNC server using the following command:

vncserver -localhost no 

Once the VNC server is started, you should get the following output:

/usr/bin/xauth:  file /home/tecadmin/.Xauthority does not exist

New 'ubuntu1804:1 (tecadmin)' desktop at :1 on machine ubuntu1804

Starting applications specified in /etc/X11/Xvnc-session
Log file is /home/tecadmin/.vnc/ubuntu1804:1.log

Use xtigervncviewer -SecurityTypes VncAuth,TLSVnc -passwd /home/tecadmin/.vnc/passwd ubuntu1804:1 to connect to the VNC server.

You can verify your running VNC server using the following command:

vncserver -list 

You should get the following output:

TigerVNC server sessions:

X DISPLAY #     PROCESS ID
:1              30982

Step 2 – Installing VNC Client

In this section, we will install the RealVNC VNC client on the remote machine and connect to the VNC server.

You can download the RealVNC client from the RealVNC download page. Make sure to select correct system architecture. Default page downloads 32bit package.

Once the download is completed, install the downloaded package with the following command:

sudo dpkg -i ~/Downloads/VNC-Viewer-6.20.529-Linux-x64.deb  

Next, launch the VNC client from the Gnome application menu. Then, Click on the File menu => New connection to create a new connection. You should see the following screen:

Create New Connection Real VNC

Provide the Name and IP address along with VNC session ID :1 of your VNC server and click on the OK to save the connection. You should see your saved connection in the following screen:

VNC Viewer connections list

Now, double click on your newly created connection. You will be asked to provide your VNC password as shown below:

Connect vnc server

Provide your VNC password and click on the OK. Once connected, you should see your Ubuntu desktop screen:

Setup VNC server on Ubuntu 18.04

Step 3 – Setup VNC for Your Desktop Environment

Before starting, stop the VNC instance using the vncserver command with a -kill option and the server session ID as an argument.

sudo vncserver -kill :1 

You should get the following output:

Killing Xtigervnc process ID 1719… success!

Next, you will need to configure TigerVNC to work with Gnome. You can do it by creating new file xstartup inside .vnc directory:

su - tecadmin 
nano ~/.vnc/xstartup 

Add the following lines:

#!/bin/sh
exec /etc/vnc/xstartup
xrdb $HOME/.Xresources
vncconfig -iconic &
dbus-launch --exit-with-session gnome-session &

Save and close the file when you are finished. The above script will be executed automatically whenever you start or restart the TigerVNC server.

Next, give execute permissions to the ~/.vnc/xstartup file:

chmod u+x  ~/.vnc/xstartup 

Step 5 – Create a Systemd Service File for VNC

Next, you will need to create a systemd file for TigerVNC to manage the VNC service. You can create it with the following command:

sudo vim /etc/systemd/system/vncserver@.service 

Add the following lines:

[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=simple
User=tecadmin
PAMName=login
PIDFile=/home/%u/.vnc/%H%i.pid
ExecStartPre=/usr/bin/vncserver -kill :%i > /dev/null 2>&1 || :
ExecStart=/usr/bin/vncserver :%i -localhost no -geometry 1024x768
ExecStop=/usr/bin/vncserver -kill :%i

[Install]
WantedBy=multi-user.target

Save and close the file then reload the systemd daemon with the following command:

sudo systemctl daemon-reload 

Next, enable the VNC service to start at system reboot with the following command:

sudo systemctl enable vncserver@1.service 

Next, start the VNC service with the following command:

sudo systemctl start vncserver@1.service 

Conclusion

Congratulations! you have successfully installed and setup the VNC server on Ubuntu 18.04 LTS Linux system. You can now connect Ubuntu Desktop from remote system using vnc viewer.

The post How To Install and Configure VNC Server on Ubuntu 18.04 appeared first on TecAdmin.

]]>
https://tecadmin.net/how-to-install-and-configure-vnc-on-ubuntu-18-04/feed/ 0
How to Install Visual Studio Code on Ubuntu 18.04 https://tecadmin.net/install-visual-studio-code-ubuntu-18-04/ https://tecadmin.net/install-visual-studio-code-ubuntu-18-04/#comments Tue, 03 Nov 2020 05:54:34 +0000 https://tecadmin.net/?p=23475 Visual Studio Code is an optimized, feature-rich code editor for building web and cloud applications. It is developed by the Microsoft team. It includes features like embedded Git, supports debugging, syntax highlighting, intelligent code completion, snippets, and code refactoring. The Visual Studio Code is freely available for most modern operating systems like Windows, Linux (RPM [...]

The post How to Install Visual Studio Code on Ubuntu 18.04 appeared first on TecAdmin.

]]>
Visual Studio Code is an optimized, feature-rich code editor for building web and cloud applications. It is developed by the Microsoft team. It includes features like embedded Git, supports debugging, syntax highlighting, intelligent code completion, snippets, and code refactoring.

The Visual Studio Code is freely available for most modern operating systems like Windows, Linux (RPM and Debian installations are also available), and macOS.

This tutorial will help you to install Visual Studio Code on Ubuntu 18.04 LTS Linux system using Apt package manager and using snap package.

Prerequisites

Login to your Ubuntu 18.04 system with sudo privileged account. You must have Ubuntu Dekstop installed on your system.

Step 1 – Installing Visual Studio Code

Visual Studio Code is available as the Snap package as well official apt repository with the Debian package. Choose one of the below methods as per your choice. The Ubuntu 18.04 does not have the Snap tool installed. So, we are providing the installation methods using the Debian package first.

  • 1. Install using Apt Repository

    First of all, Import the GPG key to your system to verify packages before installation. To import gpg key, type:

    curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg 
    sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg 
    

    Microsoft team provides an repository for the Debian packages installation. To enable the Visual Studio code Apt repository, type:

    echo "deb [arch=amd64] http://packages.microsoft.com/repos/vscode stable main" | sudo \
       tee /etc/apt/sources.list.d/vs-code.list 
    

    Once you successfully added the repository to your system, Execute the following commands to install Visual Studio Code on the Ubuntu system.

    sudo apt update 
    sudo apt install code 
    

    Press ‘y’ for any confirmation prompted by the installer.

  • 2. Install using Snap Package

    The snap package contains all the requirements for any application. Make sure you have Snapd service installed on your system or use the following command to install it.

    sudo apt install snapd 
    

    Once snpad deamon installed on your system, execute the below command on your system terminal:

    sudo snap install code --classic 
    

    The above command will download VS Code snap package and install on your system. Once the installation is completed successfully, you will see the following output.

    install vs code ubuntu

    That’s it. The Visual Studio Code snap package has been successfully installed on your system.

Step 2 – Launch Visual Studio Code

Now, The Visual Studio Code has been installed on your Ubuntu 20.04 system. To launch the application type “code” in the search application and click on it.

launch vs code ubuntu

The Visual Studio Code editor is ready to use.

Visual Studio Code on Ubuntu

There are a large number of extensions available for Visual Studio Code like C#, Python, JavaScript, Google Chrome, etc. Install the required extensions to enhance your working experience with the Visual Studio Code.

Conclusion

This tutorial helps you to install Visual Studio Code on your Ubuntu 18.04 LTS Linux system.

The post How to Install Visual Studio Code on Ubuntu 18.04 appeared first on TecAdmin.

]]>
https://tecadmin.net/install-visual-studio-code-ubuntu-18-04/feed/ 1
How to Install Postman on Ubuntu 18.04 https://tecadmin.net/how-to-install-postman-on-ubuntu-18-04/ https://tecadmin.net/how-to-install-postman-on-ubuntu-18-04/#respond Thu, 29 Oct 2020 13:51:12 +0000 https://tecadmin.net/?p=23382 Postman is the large scale collaboration platform for the API development. It is used by the million’s of developers across the world including tech companies. A snapcraft package of postman is officially build the official team. The snap packages provides an efficient way of packaging and deployment of application on multiple Linux operating systems. This [...]

The post How to Install Postman on Ubuntu 18.04 appeared first on TecAdmin.

]]>
Postman is the large scale collaboration platform for the API development. It is used by the million’s of developers across the world including tech companies.

A snapcraft package of postman is officially build the official team. The snap packages provides an efficient way of packaging and deployment of application on multiple Linux operating systems.

This tutorial will help you to install Postmap on Ubuntu 18.04 Linux system.

Prerequisites

Login to your Ubuntu 18.04 LTS system with sudo privileged account.

Install Postman on Ubuntu 18.04

Postman snap package is available on the snapcraft. You must have snapd service installed on your Ubuntu system.

Use the following command to install snapd on your system:

sudo apt install snapd

This will install Snapd deamon on your system.

Then use the snap command to install Postman on Ubuntu 18.04 LTS Linux system.

sudo snap install postman

You will see the output on screen like this:

installing postman Ubuntu 18.04

That’s it. Postman has been successfully installed on your Ubuntu system.

Launch Postman Application

Click the Show Applications icon or use keyboard super key to launch applications menu. Then search for the “notepad” and you will see the launch icon as below:

Launch  postman Ubuntu 18.04

Click the application launcher icon to start Postman application.

It will prompt to create account with Postman. You can sign up or just skip the signup page to use application without login.

Running Postman on Ubuntu 18.04

Let’s start building and testing with APIs.

Conclusion

In this tutorial, you have found the instruction’s to install Postman on Ubuntu 18.04 Linux system.

The post How to Install Postman on Ubuntu 18.04 appeared first on TecAdmin.

]]>
https://tecadmin.net/how-to-install-postman-on-ubuntu-18-04/feed/ 0
How To Install Python 3.9 on Ubuntu 18.04 https://tecadmin.net/how-to-install-python-3-9-on-ubuntu-18-04/ https://tecadmin.net/how-to-install-python-3-9-on-ubuntu-18-04/#comments Tue, 20 Oct 2020 10:40:07 +0000 https://tecadmin.net/?p=23300 Python is an object-oriented, high-level programming language. It is open-source with a large community. Python is used as a key language among the top tech companies like Google. The latest stable version Python 3.9 is out with several improvements and security updates. It included multiple new modules, improved existing modules and many other features. This [...]

The post How To Install Python 3.9 on Ubuntu 18.04 appeared first on TecAdmin.

]]>
Python is an object-oriented, high-level programming language. It is open-source with a large community. Python is used as a key language among the top tech companies like Google.

The latest stable version Python 3.9 is out with several improvements and security updates. It included multiple new modules, improved existing modules and many other features.

This tutorial will help you to install Python 3.9 on Ubuntu 18.04 LTS system. You will find two methods to install Python. First method will use deadsnakes PPA to install Python. The second method will use Python’s source code for the installation.

Follow the below tutorial and choose one method to install Python 3.9. Both the methods are tested with the latest Ubuntu 18.04 system.

Prerequisites

Before beginning the Python installation, install some required packages on your system. Login to your Ubuntu system and execute following commands:

sudo apt update 
sudo apt install software-properties-common 

Install Python 3.9 Using Apt-Get

The Apt package manager provides simple way for installing Python 3.9 on Ubuntu system. Follow the steps below:

  • Open a terminal on your system and configure deadsnakes PPA to your system.
    sudo add-apt-repository ppa:deadsnakes/ppa 
    
  • Once you added the PPA on your Ubuntu system, update the apt cache and install Python 3.9 on Ubuntu.
    sudo apt update 
    sudo apt install python3.9 
    
  • Wait for the installation to complete. Check the Python version by executing:
    python3.9 -V 
    
    Python 3.9.6
    

That’s it. Python 3.9 is installed on your Ubuntu system and ready to use.

Install Python 3.9 Using Source Code

As the Debian packages are available, We don’t recommend installing Python 3.9 packages from source code. But in some cases, you may need to install Python from the source code.

So follow the below instructions to install Python 3.9 using source code on Ubuntu 18.04 Linux system.

  • First of all, install essential packages for compiling source code. Open a terminal and execute following commands:
    sudo apt install wget build-essential checkinstall 
    sudo apt install libreadline-gplv2-dev libncursesw5-dev libssl-dev \
        libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev 
    
  • Now, download the Python 3.9 source code from the official download site. Switch to a relevant directory and use wget to download the source file.
    cd /opt 
    sudo wget https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz 
    
  • Next, extract the downloaded archive file and prepare the source for the installation.
    tar xzf Python-3.9.6.tgz 
    cd Python-3.9.6 
    sudo ./configure --enable-optimizations 
    
  • Python source is ready to install. Execute make altinstall command to install Python 3.9 on your system.
    sudo make altinstall 
    

    make altinstall is used to prevent replacing the default python binary file /usr/bin/python.

  • The Python 3.9 has been installed on Ubuntu 18.04 system. Verify the installed version:
    python3.9 -V 
    
    Python 3.9.6
    
  • Remove the downloaded archive to free space
    sudo rm -f /opt/Python-3.9.6.tgz 
    

Conclusion

In this tutorial, you have learned to install Python 3.9 on Ubuntu 18.04 using Apt and source code.

The post How To Install Python 3.9 on Ubuntu 18.04 appeared first on TecAdmin.

]]>
https://tecadmin.net/how-to-install-python-3-9-on-ubuntu-18-04/feed/ 15
How to Install Chromium Browser on Ubuntu 18.04 https://tecadmin.net/install-chromium-browser-on-ubuntu-18-04/ https://tecadmin.net/install-chromium-browser-on-ubuntu-18-04/#respond Tue, 15 Sep 2020 09:15:30 +0000 https://tecadmin.net/?p=22860 Chromium is an open-source web browser project that aims to build a safer, faster, and more stable way to its users for a better experience of the web. Chromium is perfectly safe for using. Make sure to download it from a good source or official Google download page. Also make sure to update it on [...]

The post How to Install Chromium Browser on Ubuntu 18.04 appeared first on TecAdmin.

]]>
Chromium is an open-source web browser project that aims to build a safer, faster, and more stable way to its users for a better experience of the web.

Chromium is perfectly safe for using. Make sure to download it from a good source or official Google download page. Also make sure to update it on regular basis.

This tutorial will help you to install chromium web browser on Ubuntu 18.04 LTS Linux system.

Installing Chromium on Ubuntu

The Ubuntu 18.04 operating systems contains chromium browser under the default package repositories. It also available as Snap package for Ubuntu systems

Its your choice to choose any one of the below methods to install chromium browser in Ubuntu system.

  • Install Chromium using Snap Package

    A Snap package is containerized software packages provide easy to install method. You can install sanp package via the command line or using Ubuntu Software application.

    Open a terminal on your system and type:

    sudo snap install chromium 
    

    That’s it. The Chromium browser has been installed on your system.

  • Install Chromium using Debian Package

    Chromium browser debian package is available under the default apt repositories. Just update the apt cache and install browser on your system.

    Open a terminal and install chromium browser by typing:

    sudo apt update 
    sudo apt install chromium-browser 
    

Launch Chromium Browser

Search for Chromium under the application. You will see the chromium browser link similar to chrome but in different color as below screenshot:

launch chromium browser ubuntu on Ubuntu 18.04

Click on the link icon to launch chromium browser:

installing chromium browser on Ubuntu 18.04

Conclusion

In this tutorial, you learned two methods of the installation of Chromium browser on Ubuntu 18.04 Linux system.

The post How to Install Chromium Browser on Ubuntu 18.04 appeared first on TecAdmin.

]]>
https://tecadmin.net/install-chromium-browser-on-ubuntu-18-04/feed/ 0
How to Install Zoom on Ubuntu 18.04 https://tecadmin.net/install-zoom-on-ubuntu-18-04/ https://tecadmin.net/install-zoom-on-ubuntu-18-04/#comments Sun, 07 Jun 2020 16:57:59 +0000 https://tecadmin.net/?p=21765 Zoom application is one of the most popular application these days. The Zoom cloud meetings application provides simplified video conferencing with the real-time messaging and content sharing over the internet. The zoom client allows you to join meeting without sign in to the application. To start a new meeting, you would required to login to [...]

The post How to Install Zoom on Ubuntu 18.04 appeared first on TecAdmin.

]]>
Zoom application is one of the most popular application these days. The Zoom cloud meetings application provides simplified video conferencing with the real-time messaging and content sharing over the internet.

The zoom client allows you to join meeting without sign in to the application. To start a new meeting, you would required to login to the application. Visit zoom.us to create account.

This tutorial will help you to install Zoom client on your Ubuntu system.

Prerequisites

In this tutorial, you will install Zoom client application on Ubuntu using snap packages. So, you must have install Snapd service on your system.

Run the following commands to install Snapd service on your system:

sudo apt update
sudo apt install snapd

Installing Zoom on Ubuntu

Zoom client is available as snap packages. In the above step you have installed Snapd service on our system. Now, your Ubuntu system is ready to install Zoom client.

Run the following command to to install zoom client on your Ubuntu system:

sudo snap install zoom-client

Once the installation succeeded, you will see the following result on your system screen like:

zoom-client 5.0.399860.0429 from oliver Grawert (ogra) installed

Access Zoom Application

The application installer, add a launcher to the desktop systems. Search for the Zoom client under the applications. You will see the Zoom application launcher as shown in the screenshot below.

Launch zoom client on ubuntu

Click on the launcher button to start zoom application.

Running zoom client ubuntu

You must have a meeting ID to join meeting. Click on “Join a Meeting” button, then enter meeting ID and your name (to display in meeting) to connect meeting. You can get the meeting ID from the host of meeting.

You can also host a meeting on Zoom. To host a meeting you need to sign in to the zoom client application. After login you will get 4 options, Join meeting, new meeting, schedule or share screen only.

The post How to Install Zoom on Ubuntu 18.04 appeared first on TecAdmin.

]]>
https://tecadmin.net/install-zoom-on-ubuntu-18-04/feed/ 7
How to Install Nginx with PHP-FPM on Ubuntu 18.04 LTS https://tecadmin.net/install-nginx-php-fpm-ubuntu-18-04/ https://tecadmin.net/install-nginx-php-fpm-ubuntu-18-04/#respond Thu, 14 Nov 2019 18:17:25 +0000 https://tecadmin.net/?p=19839 This tutorial will help you to install Nginx web server with PHP-FPM/FastCGI on Ubuntu 18.04 (Bionic) LTS system. In this tutorial, we are using PHP 7.3 and configure with Nginx using PHP-FPM and FastCGI. Nginx Installation Nginx packages are available under default repositories. SSH to your Ubuntu 18.04 LTS system with sudo privileges account and [...]

The post How to Install Nginx with PHP-FPM on Ubuntu 18.04 LTS appeared first on TecAdmin.

]]>
This tutorial will help you to install Nginx web server with PHP-FPM/FastCGI on Ubuntu 18.04 (Bionic) LTS system. In this tutorial, we are using PHP 7.3 and configure with Nginx using PHP-FPM and FastCGI.

Nginx Installation

Nginx packages are available under default repositories. SSH to your Ubuntu 18.04 LTS system with sudo privileges account and install Nginx web server from the official repository.

sudo apt update 
sudo apt install nginx

PHP Installation

For the PHP installation we recommend to use ppa:ondrej/php PPA, which provides latest PHP versions for Ubuntu systems. Use the below couple of commands to add the PPA to your system.

sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php

Then install PHP 7.3 the latest version available on the day of writing this tutorial. Simply execute follows commands for the installation of PHP and PHP-FPM packages.

apt update
sudo apt install php7.3 php7.3-fpm
Note:- When you are using PHP-FPM. All the PHP modules configurations are residing under /etc/php/7.3/fpm directory. You can read more about enable/disable PHP modules.

After installing above packages php7.3-fpm service will automatically be started. You can make sure by typing below command on terminal.

sudo systemctl status php7.3-fpm

● php7.3-fpm.service - The PHP 7.3 FastCGI Process Manager
   Loaded: loaded (/lib/systemd/system/php7.3-fpm.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2019-11-21 03:36:08 UTC; 36s ago
     Docs: man:php-fpm7.3(8)
 Main PID: 9054 (php-fpm7.3)
   Status: "Processes active: 0, idle: 2, Requests: 0, slow: 0, Traffic: 0req/sec"
    Tasks: 3 (limit: 4704)
   CGroup: /system.slice/php7.3-fpm.service
           ├─9054 php-fpm: master process (/etc/php/7.3/fpm/php-fpm.conf)
           ├─9069 php-fpm: pool www
           └─9070 php-fpm: pool www

Nov 21 03:36:08 tecadmin systemd[1]: Starting The PHP 7.3 FastCGI Process Manager...
Nov 21 03:36:08 tecadmin systemd[1]: Started The PHP 7.3 FastCGI Process Manager.

Nginx Configuration

Let’s create a Nginx virtual host to run with FPM/FastCGI. For this tutorial, we use default VirtualHost. Edit VirtualHost host configuration file in text editor. You can create new VirtualHost as per your requirements, so make sure to enable any new VirtualHost.

sudo vim /etc/nginx/sites-available/example.com

Use the below basic Nginx Virtual host configuration with php fpm settings. Update the configuration as followings.

server {
        listen 80;
        root /var/www/html;
        index index.php index.html index.htm;
        server_name example.com;

        location / {
            try_files $uri $uri/ =404;
        }

        location ~ \.php$ {
            include snippets/fastcgi-php.conf;
            fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
        }
}

Save your changes to the configuration file and create a link to site enabled directory.

sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/example.com 

Then restart Nginx service to reload the changes.

sudo systemctl restart nginx.service

Test Setup

Create a PHP script with phpinfo() function and place it to your server document root. Use below command to do it.

echo "<?php phpinfo(); ?>" > /var/www/html/info.php

Now access the info.php using server IP address (for default VirtualHost) for your configured domain in Nginx VirtualHost.

Nginx PHP-FPM Ubuntu 18.04

Slide down the page and see the value of $_SERVER[‘SERVER_SOFTWARE’]. This will the show the web server details.

Nginx PHP Ubuntu 18.04

Conclusion

You have successfully configured Nginx web server with PHP-FPM on your Ubuntu 18.04 (Bionic) LTS. You can now host a website from your server.

The post How to Install Nginx with PHP-FPM on Ubuntu 18.04 LTS appeared first on TecAdmin.

]]>
https://tecadmin.net/install-nginx-php-fpm-ubuntu-18-04/feed/ 0
How to Install Apache with PHP-FPM on Ubuntu 18.04 LTS https://tecadmin.net/install-apache-php-fpm-ubuntu-18-04/ https://tecadmin.net/install-apache-php-fpm-ubuntu-18-04/#comments Wed, 13 Nov 2019 17:29:51 +0000 https://tecadmin.net/?p=19831 PHP FPM (FastCGI Process Manager) is an alternative implementation of PHP FastCGI. It provides some additional features like Adaptive process spawning which is useful for sites. This tutorial will help you to install Apache with PHP-FPM/FastCGI on Ubuntu 18.04 (Bionic) LTS system. In this tutorial, we are using PHP 7.3 and configure with Apache using [...]

The post How to Install Apache with PHP-FPM on Ubuntu 18.04 LTS appeared first on TecAdmin.

]]>
PHP FPM (FastCGI Process Manager) is an alternative implementation of PHP FastCGI. It provides some additional features like Adaptive process spawning which is useful for sites. This tutorial will help you to install Apache with PHP-FPM/FastCGI on Ubuntu 18.04 (Bionic) LTS system. In this tutorial, we are using PHP 7.3 and configure with Apache using PHP-FPM and FastCGI.

You can also visit the previous tutorial to configure Apache with multiple PHP versions using PHP-FPM/FastCGI on Ubuntu systems.

Apache Installation

Apache packages are available under default repositories. SSH to your Ubuntu 18.04 LTS system with sudo privileges account and install Apache web server from the official repository.

sudo apt update 
sudo apt install apache2 libapache2-mod-fcgid

PHP Installation

For the PHP installation we recommend to use ppa:ondrej/php PPA, which provides latest PHP versions for Ubuntu systems. Use the below couple of commands to add the PPA to your system.

sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php

Then install PHP 7.3 the latest version available on the day of writing this tutorial. Simply execute follows commands for the installation of PHP and PHP-FPM packages.

apt update
sudo apt install php7.3 php7.3-fpm
Note:- When you are using PHP-FPM. All the PHP modules configurations are residing under /etc/php/7.3/fpm directory. You can read more about enable/disable PHP modules.

After installing above packages php7.3-fpm service will automatically be started. You can make sure by typing below command on terminal.

sudo systemctl status php7.3-fpm

● php7.3-fpm.service - The PHP 7.3 FastCGI Process Manager
   Loaded: loaded (/lib/systemd/system/php7.3-fpm.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2019-11-21 03:36:08 UTC; 36s ago
     Docs: man:php-fpm7.3(8)
 Main PID: 9054 (php-fpm7.3)
   Status: "Processes active: 0, idle: 2, Requests: 0, slow: 0, Traffic: 0req/sec"
    Tasks: 3 (limit: 4704)
   CGroup: /system.slice/php7.3-fpm.service
           ├─9054 php-fpm: master process (/etc/php/7.3/fpm/php-fpm.conf)
           ├─9069 php-fpm: pool www
           └─9070 php-fpm: pool www

Nov 21 03:36:08 tecadmin systemd[1]: Starting The PHP 7.3 FastCGI Process Manager...
Nov 21 03:36:08 tecadmin systemd[1]: Started The PHP 7.3 FastCGI Process Manager.

Apache Configuration

Now enable few modules required for the configuration of multiple PHP versions with Apache. These modules are necessary to integrate PHP FPM and FastCGI with Apache server.

sudo a2enmod actions fcgid alias proxy_fcgi

Let’s configure the Apache VirtualHost to run with FPM/FastCGI. For this tutorial, we use default VirtualHost. Edit VirtualHost host configuration file in text editor. You can create new VirtualHost as per your requirements, so make sure to enable any new VirtualHost.

sudo vim /etc/apache2/sites-available/000-default.conf

Update the configuration as followings.

<VirtualHost *:80>
    ServerName example.com
    ServerAlias www.example.com
    DocumentRoot /var/www/html

    <Directory /var/www/html>
        Options -Indexes +FollowSymLinks +MultiViews
        AllowOverride All
        Require all granted
    </Directory>

    <FilesMatch \.php$>
        # 2.4.10+ can proxy to unix socket
        SetHandler "proxy:unix:/var/run/php/php7.3-fpm.sock|fcgi://localhost"
    </FilesMatch>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Save your changes to the configuration file and restart Apache to reload the changes.

sudo systemctl restart apache2.service

Test Setup

Create a PHP script with phpinfo() function and place it to your server document root. Use below command to do it.

echo "<?php phpinfo(); ?>" > /var/www/html/info.php

Now access the info.php using server IP address (for default VirtualHost) for your configured domain in Apache VirtualHost.

Apache PHP-FPM Ubuntu 18.04

Conclusion

You have successfully configured a Apache with PHP-FPM on your Ubuntu 18.04 (Bionic) LTS. You can now host a website from your server.

The post How to Install Apache with PHP-FPM on Ubuntu 18.04 LTS appeared first on TecAdmin.

]]>
https://tecadmin.net/install-apache-php-fpm-ubuntu-18-04/feed/ 5
How to Install and Configure Apache on Ubuntu 18.04 LTS https://tecadmin.net/install-apache-ubuntu1804/ https://tecadmin.net/install-apache-ubuntu1804/#respond Thu, 20 Jun 2019 04:44:12 +0000 https://tecadmin.net/?p=19811 This tutorial will help you to install and secure Apache web server on Ubuntu 18.04 LTS Linux operating system. Prerequsities SSH access to Ubuntu 18.04 SUDO privilege Install Apache on Ubuntu 18.04 First of all, Login to your Ubuntu 18.04 system via SSH and update the Apt cache. Then install Apache2 HTTP server packages as [...]

The post How to Install and Configure Apache on Ubuntu 18.04 LTS appeared first on TecAdmin.

]]>
This tutorial will help you to install and secure Apache web server on Ubuntu 18.04 LTS Linux operating system.

Prerequsities

  • SSH access to Ubuntu 18.04
  • SUDO privilege

Install Apache on Ubuntu 18.04

First of all, Login to your Ubuntu 18.04 system via SSH and update the Apt cache. Then install Apache2 HTTP server packages as following:

sudo apt update
sudo apt install apache2

To install most latest version of Apache use the following PPA.

sudo add-apt-repository ppa:ondrej/apache2
sudo apt update
sudo apt install apache2

Manage Apache Service

Apache service is managed with systemctl command line. After installation, use the following command to check the status of Apache service.

sudo systemctl status apache2.service

Apache Service Status Ubuntu

Here is the other commands to stop, start or restart Apache service via command line.

sudo systemctl stop apache2.service
sudo systemctl start apache2.service
sudo systemctl restart apache2.service

Test Apache Setup

Use the following command to view the installed Apache version on your Ubuntu 18.04 Linux system.

apache2 -v

Server version: Apache/2.4.41 (Ubuntu)
Server built:   2019-10-15T19:53:42

Now access your Apache server using the server’s IP address or a domain pointed to the server IP. You will see a default Apache page on web browser. It means Apache web server has successfully installed on your Ubuntu 18.04 system.

Install Apache2 on Ubuntu 18.04

Create New VirtualHost

Let’s create the first virtual host on your Apache server. For the tutorial, we are using sample domain “example.com”. Here we will create a Virtual host for example.com on port 80.

Create a directory and create a sample index file in a directory:

sudo mkdir -p /var/www/example.com
sudo echo "Welcome" > /var/www/example.com/index.html

Then create Virtualhost configuration file and edit in editor:

sudo vim /etc/apache2/sites-available/example.com.conf

Add the following content in configuration file. You may change the domain name as per your domain.

<VirtualHost *:80>
    ServerAdmin admin@example.com
    DocumentRoot /var/www/example.com
    ServerName example.com
    ServerAlias www.example.com
    <Directory /var/www/example.com>
           #Allowoverride all    ###Uncomment if required
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/example.com_error.log
    CustomLog ${APACHE_LOG_DIR}/example.com_access.log combined
</VirtualHost>

Save the Virtualhost configuration file, then enable Virtualhost and reload the Apache service using the following commands:

sudo a2ensite example.com
sudo systemctl reload apache2.service

Configure SSL VirtualHost

You can skip this step if you don’t need SSL. But the security is always the primary concert for any website.

The default Apache https listen on port 443. Make sure no other services using the same port. Now, you need to enable Apache ssl module, which is disabled by default.

sudo a2enmod ssl

For the tutorial, I have followed these instructions to generate a self signed SSL certificate for our domain.

Then create a new Virtual host file and edit it:

sudo vim /etc/apache2/sites-available/example.com_ssl.conf

with the following content:

<VirtualHost *:443>
    ServerAdmin admin@example.com
    DocumentRoot /var/www/example.com
	
    ServerName example.com
    ServerAlias www.example.com
	
    <Directory /var/www/example.com>
           #Allowoverride all    ###Uncomment if required
    </Directory>

    SSLEngine on
    SSLCertificateFile /etc/pki/tls/certs/example.com.crt
    SSLCertificateKeyFile /etc/pki/tls/certs/example.com.key
	
    ErrorLog ${APACHE_LOG_DIR}/example.com_ssl-error.log
    CustomLog ${APACHE_LOG_DIR}/example.com_ssl-access.log combined
</VirtualHost>

Here is three terms used to configure SSL virtualhost:

  • SSLEngine – Set this to “on”
  • SSLCertificateFile – Set the path of your SSL certificate
  • SSLCertificateKeyFile – This is the private key files used to generate SSL certificate

After that enable the Virtualhost and reload the Apache service using the following commands:

sudo a2ensite example.com_ssl
sudo systemctl reload apache2.service

Secure Apache Server

Edit the Apache security configuration file

sudo vim /etc/apache2/conf-enabled/security.conf

Here is the multiple security related settings. Add or Update the following settings. We are not going in detailed discriptions about it but these settings are very useful for the production servers.

ServerTokens Prod
ServerSignature Off
TraceEnable Off
Header always append X-Frame-Options SAMEORIGIN
Header always set X-XSS-Protection: "1; mode=block"
Header always set X-Content-Type-Options: "nosniff"
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
Header always edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure

Now edit SSL configuration file. Here you can set the server wide SSL protocol and SSLCipherSuite to use secure Cipers to serve your website.

sudo vim /etc/apache2/mods-enabled/ssl.conf

SSLProtocol -all +TLSv1.2
SSLCipherSuite HIGH:!aNULL:!MD5

After making changes restart the Apache service to apply new configuration.

sudo systemctl reload apache2.service

Conclusion

All done, You have installed and secured Apache server on your Ubuntu 18.04 Bionic Linux system.

The post How to Install and Configure Apache on Ubuntu 18.04 LTS appeared first on TecAdmin.

]]>
https://tecadmin.net/install-apache-ubuntu1804/feed/ 0
Download Ubuntu 18.04 LTS – DVD ISO Images https://tecadmin.net/download-ubuntu-18-04-iso/ https://tecadmin.net/download-ubuntu-18-04-iso/#comments Sat, 22 Dec 2018 10:39:17 +0000 https://tecadmin.net/?p=17866 Ubuntu 18.04 is the latest LTS release available to download. This tutorial has download links to DVD ISO Images of Ubuntu 18.04 LTS release. You can find the Ubuntu 18.04 release notes on its official website. Ubuntu 18.04 LTS Download Links Please find below DVD ISO images download links for Ubuntu Desktop and Ubuntu server [...]

The post Download Ubuntu 18.04 LTS – DVD ISO Images appeared first on TecAdmin.

]]>
Ubuntu 18.04 is the latest LTS release available to download. This tutorial has download links to DVD ISO Images of Ubuntu 18.04 LTS release. You can find the Ubuntu 18.04 release notes on its official website.

Ubuntu 18.04 LTS Download Links

Please find below DVD ISO images download links for Ubuntu Desktop and Ubuntu server edition. You can also use torrent to download images.

Desktop Edition

Server Edition:

Download Ubuntu 18.04 via Command Line

You can download any remote file suing wget or curl command line utility. Its simple to use. We use curl to download file.

### Ubuntu 18.04 Desktop Edition 
curl -O http://releases.ubuntu.com/18.04/ubuntu-18.04.4-desktop-amd64.iso

### Ubuntu 18.04 Server Edition
curl -O http://releases.ubuntu.com/18.04/ubuntu-18.04.4-live-server-amd64.iso

The post Download Ubuntu 18.04 LTS – DVD ISO Images appeared first on TecAdmin.

]]>
https://tecadmin.net/download-ubuntu-18-04-iso/feed/ 3