Tag: Ubuntu

How to Run Multiple PHP Versions with Apache on Ubuntu 18.04 / 16.04

How to Run Multiple PHP Versions with Apache on Ubuntu 18.04 / 16.04

In this guide we will configure Apache to run PHP 7.x and PHP 5.6 simultaneously, and choose between them using Virtual Hosts or .htaccess.

Prerequisites This guide assumes you have Apache already installed and serving web pages. If you need to install Apache, please see: Installing Apache on Ubuntu 18.04 with Virtual Hosts Installing Apache on Ubuntu 16.04 / 17.10 with Virtual Hosts 1. Add Repository Let’s begin by updating the package lists. sudo apt update For Ubuntu 18.04 users, install libapache2-mod-fcgid. sudo…

Continue reading How to Run Multiple PHP Versions with Apache on Ubuntu 18.04 / 16.04

How to Install VNC on Ubuntu 18.04 (Windows, Linux and Mac)

How to Install VNC on Ubuntu 18.04 & 16.04 (Windows, Linux and Mac)

In this guide we will install the xfce4 desktop environment and VNC server to allow us to control Ubuntu 18.04 remotely from Linux, Mac or Windows. This guide has also been tested on Ubuntu 16.04 to Ubuntu 17.10.

Prerequisites You should use a non-root user account with sudo privileges. Please see the Initial Server Setup for Ubuntu 18.04 / 18.10 or Initial Server Setup for Ubuntu 16.04 / 17.10 for more details. You will also need to download and install a VNC client for your OS. We recommend the following: Windows VNC Clients VNC Viewer (RealVNC), TightVNC or UltraVNC For…

Continue reading How to Install VNC on Ubuntu 18.04 & 16.04 (Windows, Linux and Mac)

How to Reset MySQL Root Password in Ubuntu

How to Reset the MySQL Root Password on Ubuntu

In this article we will reset the MySQL root password in Ubuntu by starting MySQL with the --skip-grant-tables option.

1. Confirm MySQL version Firstly, you must confirm which version of MySQL on Ubuntu you are running as commands will be different. mysql -V mysql Ver 14.14 Distrib 5.7.25, for Linux (x86_64) using EditLine wrapper Keep note of your “Distrib”. In the above example, we are on MySQL 5.7. Keep note of this for later. 2. Restart…

Continue reading How to Reset the MySQL Root Password on Ubuntu

Disable Sudo Password Prompt or Extend Timeout in Linux

Every time you issue a sudo command, Linux asks for your user password after a certain inactivity timeout, usually 5 minutes. This is the recommended behaviour to prevent unauthorised commands being run by someone or a malicious script in your absence. However, this requirement can be disabled per session or permanently, or you can extend the inactivity timeout.

Disable Per Session This command below will prompt you for your sudo password once and never again until you log out and in again. sudo -i Extend Inactivity Timeout The default inactivity timeout is usually 5 minutes before Linux will prompt for your sudo password again. You can extend this timeout by editing the sudoers file.…

Continue reading Disable Sudo Password Prompt or Extend Timeout in Linux

htop showing swap space on Ubuntu

Creating Swap Space on Ubuntu 18.04

Swap space is highly recommended. If your server ever runs out of physical memory during heavy load, some critical services such as MySQL can crash. It’s important to have some swap space where memory can expand to if really necessary.

Of course, we do not recommend you use swap space as a replacement to physical memory, especially on cloud hosting. If you are continuously eating into swap space, you should upgrade your physical memory. Swap should really only be a fall back in case memory usage peaks abnormally. First check if the system has any…

Continue reading Creating Swap Space on Ubuntu 18.04

Let’s Encrypt Error: “Client with the currently selected authenticator does not support any combination of challenges that will satisfy the CA.”

Renewing an existing certificate Performing the following challenges: Client with the currently selected authenticator does not support any combination of challenges that will satisfy the CA. Attempting to renew cert (example.com) from /etc/letsencrypt/renewal/example.com.conf produced an unexpected error: Client with the currently selected authenticator does not support any combination of challenges that will satisfy the CA..…

Continue reading Let’s Encrypt Error: “Client with the currently selected authenticator does not support any combination of challenges that will satisfy the CA.”

Installing phpMyAdmin for Nginx on Ubuntu 18.04

Installing phpMyAdmin for Nginx on Ubuntu 18.04

In this guide we will install and configure phpMyAdmin to work with Nginx on Ubuntu Server 18.04 LTS (Bionic Beaver). phpMyAdmin is open source free software, designed to handle the administration and management of MySQL databases through a graphic user interface. Written in PHP, PHPMyAdmin has become one of the most popular web-based MySQL management tools.

Prerequisites You should be using a non-root user with sudo privileges as explained in Ubuntu 18.04 Initial Server Setup. You should also have your LEMP stack (Nginx, MySQL and PHP) already installed before continuing with this guide. If you don’t have these installed yet, please see Installing a LEMP Stack (Nginx, MySQL, PHP) on Ubuntu 18.04. 1.…

Continue reading Installing phpMyAdmin for Nginx on Ubuntu 18.04

Installing an FTP server (vsftpd) on Ubuntu 18.04

Installing an FTP server (vsftpd) on Ubuntu 18.04

vsftpd (Very Secure File Transfer Protocol Daemon) is a popular FTP server for Ubuntu. In this guide we will install and configure vsftpd on Ubuntu 18.04 LTS (Bionic Beaver). We will also set up an FTP user and optionally configure SFTP for secure file transfers.

Before you begin… It’s surprising how many web developers are still unaware of SFTP and the advantages over FTP/FTPS. I admit myself that until recently I would religiously set up a vsftpd server with every new Linux install, but it’s really not necessary. If your FTP client supports SFTP, you should use it! How to…

Continue reading Installing an FTP server (vsftpd) on Ubuntu 18.04

Can't connect to MySQL server

Can’t connect to MySQL server remotely on Ubuntu

To test a remote MySQL connection in Linux terminal: mysql -u username -h 192.16.8.1.22 -p Or via Telnet in WIndows: telnet 192.16.8.1.22 3306 If you are getting an error when trying to connect to your remote MySQL server ERROR 2003 (HY000): Can’t connect to MySQL server on ‘192.16.8.1.22’ (111) or in Telnet Connecting To 192.16.8.1.22…Could not open connection…

Continue reading Can’t connect to MySQL server remotely on Ubuntu

Installing Nginx, MySQL, PHP (LEMP) Stack on Ubuntu 18.04

Installing Nginx, MySQL, PHP (LEMP) Stack on Ubuntu 18.04

Ubuntu Server 18.04 LTS (Bionic Beaver) is finally here and is being rolled out across VPS hosts such as DigitalOcean and AWS. In this guide we will install a LEMP Stack (Nginx, MySQL, PHP) and configure a web server.

Video Tutorial

Prerequisites You should use a non-root user account with sudo privileges. Please see the Initial server setup for Ubuntu 18.04 guide for more details. 1. Install Nginx Let’s begin by updating the package lists and installing Nginx on Ubuntu 18.04. Below we have two commands separated by &&. The first command will update the package lists to ensure you…

Continue reading Installing Nginx, MySQL, PHP (LEMP) Stack on Ubuntu 18.04