Note: You also need to replace port ’80’ with ‘8080’ in the Apache configuration ‘ nf‘ and all virtual host files under the ”sites-available” directory. To do this, you should edit the apache configuration ‘ nf‘ and all of the virtual host configurations under the ”sites-available” directory.įirst of all, go to the Apache configuration directory and run: cd /etc/apache2
So, in this section, you need to change the default apache port. The Apache web server will be running on port 8080 as backend, and the standard HTTP port 80 will use by ‘Varnish’.
How to change Apache default Port on Ubuntu 20.04 In this way, new ports for HTTP, HTTPS, and SSH have been opened, and are accessible from outside of the network. Also, type ‘ y‘ and press Enter to confirm: ufw enable Then, use the command below to start the firewall service and enable it to launch automatically at system boot. Open new SSH, HTTP, and HTTPS ports using the following UFW commands: ufw allow ssh ufw allow http ufw allow https In this step, you must allow everyone to access the webserver, HTTP, and HTTPS on our firewall rule. So, run: systemctl start apache2 systemctl enable apache2 Once the installation is completed, you are ready to start the Apache service and enable it to run automatically at system boot time.
So, use the following commands to update the Ubuntu repository and then install Apache: apt update apt install -y apache2 Since it is available in the Ubuntu repository by default. Let’s go through the steps of this guide to install Varnish cache for Apache on Ubuntu 20.04 and boost your website speed.įirst, you need to install the Apache webserver. When you install Varnish in front of any server that speaks HTTP and configures it to cache the contents, Varnish speeds a website by caching content that is frequently accessed by users and storing it in the memory, thereby guaranteeing faster retrieval of webpages. If you value speed, performance, scalability, and want to save on server infrastructure you will like Varnish and find it necessary for your business. How to Install Apache Webserver on Ubuntu 20.04 _ To set up, follow our Initial server setup on Ubuntu 20.04. To let this tutorial work better, please consider the below Prerequisites: Recommended Article: Tutorial Configure MongoDB Remote Access on Ubuntu 20.04 Prerequisites to Install Varnish Cache on Ubuntu 20.04