Skip to content
-
Subscribe to our newsletter & never miss our best posts. Subscribe Now!
B2B Hosting Club B2B Hosting Club B2B Hosting Club

Fast & Secure Web Hosting in Pakistan

B2B Hosting Club B2B Hosting Club B2B Hosting Club

Fast & Secure Web Hosting in Pakistan

  • Web Hosting
    • Shared Hosting
    • E-commerce Hosting
    • WordPress Hosting
    • Cloud Hosting
    • Python Hosting
    • Dedicated Hosting
    • Unlimited Hosting
    • Business Hosting
    • DMCA Ignored Hosting
    • SMM PANEL HOSTING
    • VPS Hosting
    • Student Hosting
    • Business Email
    • PHP Hosting
    • Storage Hosting
  • Reseller Hosting
    • cpanel Reseller Hosting
    • Master Reseller Hosting
    • Alpha Reseller Hosting
    • Agency Reseller Hosting
    • DMCA Ignored Reseller Hosting
  • Servers
    • Managed Dedicated Servers
    • Virtual Dedicated Server
    • Cloud Dedicated Server
    • NVMe Dedicated Servers
    • GPU Server
    • Bare Metal Server
    • Pk Based Dedicated Server
    • DMCA Ignored Server
    • Gaming server
    • Android Emulator VPS
    • kubernetes Hosting
    • Streaming Server
    • Rendering Services
    • Windows Server
    • Forex Server
  • VPS/VM/RDP
    • Virtual Machine
      • centos webpanel vm
      • vesta cp vm
      • kloxo mr vm
      • Ubuntu VPS
      • Debian VPS
    • Windows VPS
      • Win 11 Server/VPS
      • Win 10 Server/VPS
      • Win 7 Server/ VPS
      • Windows 2025/2022 VPS
      • Windows 2019/2016 VPS
    • Linux VPS
      • CentOS VPS
      • Ubuntu VPS
      • Debian VPS
    • VPS
      • Unmanaged VPS
      • Managed VPS
      • Storage VPS
    • RDP VPS
    • Pk Based Dedicated VPS
  • Solutions
    • DMCA Ignored Hosting
    • Proxies
    • License
    • SSL Certificated
    • SEO
    • Web Development
  • AI
    • Ollama Hosting
    • Gemma Hosting
    • ComfyUI Hosting
    • Mistral Hosting
    • Chatterbox TTS Hosting
    • Chroma DB Hosting
    • VLLM Hosting
    • Qwen Hosting
    • Stable Diffusion
    • Bark Hosting
    • PaddleOCR Hosting
    • Milvus Hosting
    • LM Studio Hosting
    • Qwen3-VL Hosting
    • ChatGPT Hosting
    • XTTS-V2 Hosting
    • Wan Hosting
    • Keras Hosting
    • DeepSeek Hosting
    • OpenAl Whisper
    • OpenAI GPT- OSS
    • Kokoro TTS Hosting
    • TensorFlow Hosting
    • PyTorch Hosting
    • LLaMA Hosting
    • Flux.1 Hosting
    • Phi Hosting
    • Coqui TTS Hosting
    • Qdrant Hosting
    • Android Emulator
  • Domain
    • Domain Register
    • .Pk Domain Register
    • Domains Checker
    • Domains Transfer
    • PKNIC Prepaid Cards
  • Help Center
    • About Us
    • Contact Us
    • Blog
    • Affiliate Program
  • Web Hosting
    • Shared Hosting
    • E-commerce Hosting
    • WordPress Hosting
    • Cloud Hosting
    • Python Hosting
    • Dedicated Hosting
    • Unlimited Hosting
    • Business Hosting
    • DMCA Ignored Hosting
    • SMM PANEL HOSTING
    • VPS Hosting
    • Student Hosting
    • Business Email
    • PHP Hosting
    • Storage Hosting
  • Reseller Hosting
    • cpanel Reseller Hosting
    • Master Reseller Hosting
    • Alpha Reseller Hosting
    • Agency Reseller Hosting
    • DMCA Ignored Reseller Hosting
  • Servers
    • Managed Dedicated Servers
    • Virtual Dedicated Server
    • Cloud Dedicated Server
    • NVMe Dedicated Servers
    • GPU Server
    • Bare Metal Server
    • Pk Based Dedicated Server
    • DMCA Ignored Server
    • Gaming server
    • Android Emulator VPS
    • kubernetes Hosting
    • Streaming Server
    • Rendering Services
    • Windows Server
    • Forex Server
  • VPS/VM/RDP
    • Virtual Machine
      • centos webpanel vm
      • vesta cp vm
      • kloxo mr vm
      • Ubuntu VPS
      • Debian VPS
    • Windows VPS
      • Win 11 Server/VPS
      • Win 10 Server/VPS
      • Win 7 Server/ VPS
      • Windows 2025/2022 VPS
      • Windows 2019/2016 VPS
    • Linux VPS
      • CentOS VPS
      • Ubuntu VPS
      • Debian VPS
    • VPS
      • Unmanaged VPS
      • Managed VPS
      • Storage VPS
    • RDP VPS
    • Pk Based Dedicated VPS
  • Solutions
    • DMCA Ignored Hosting
    • Proxies
    • License
    • SSL Certificated
    • SEO
    • Web Development
  • AI
    • Ollama Hosting
    • Gemma Hosting
    • ComfyUI Hosting
    • Mistral Hosting
    • Chatterbox TTS Hosting
    • Chroma DB Hosting
    • VLLM Hosting
    • Qwen Hosting
    • Stable Diffusion
    • Bark Hosting
    • PaddleOCR Hosting
    • Milvus Hosting
    • LM Studio Hosting
    • Qwen3-VL Hosting
    • ChatGPT Hosting
    • XTTS-V2 Hosting
    • Wan Hosting
    • Keras Hosting
    • DeepSeek Hosting
    • OpenAl Whisper
    • OpenAI GPT- OSS
    • Kokoro TTS Hosting
    • TensorFlow Hosting
    • PyTorch Hosting
    • LLaMA Hosting
    • Flux.1 Hosting
    • Phi Hosting
    • Coqui TTS Hosting
    • Qdrant Hosting
    • Android Emulator
  • Domain
    • Domain Register
    • .Pk Domain Register
    • Domains Checker
    • Domains Transfer
    • PKNIC Prepaid Cards
  • Help Center
    • About Us
    • Contact Us
    • Blog
    • Affiliate Program
Close

Search

Client Portal
B2B Hosting Club B2B Hosting Club B2B Hosting Club

Fast & Secure Web Hosting in Pakistan

B2B Hosting Club B2B Hosting Club B2B Hosting Club

Fast & Secure Web Hosting in Pakistan

  • Web Hosting
    • Shared Hosting
    • E-commerce Hosting
    • WordPress Hosting
    • Cloud Hosting
    • Python Hosting
    • Dedicated Hosting
    • Unlimited Hosting
    • Business Hosting
    • DMCA Ignored Hosting
    • SMM PANEL HOSTING
    • VPS Hosting
    • Student Hosting
    • Business Email
    • PHP Hosting
    • Storage Hosting
  • Reseller Hosting
    • cpanel Reseller Hosting
    • Master Reseller Hosting
    • Alpha Reseller Hosting
    • Agency Reseller Hosting
    • DMCA Ignored Reseller Hosting
  • Servers
    • Managed Dedicated Servers
    • Virtual Dedicated Server
    • Cloud Dedicated Server
    • NVMe Dedicated Servers
    • GPU Server
    • Bare Metal Server
    • Pk Based Dedicated Server
    • DMCA Ignored Server
    • Gaming server
    • Android Emulator VPS
    • kubernetes Hosting
    • Streaming Server
    • Rendering Services
    • Windows Server
    • Forex Server
  • VPS/VM/RDP
    • Virtual Machine
      • centos webpanel vm
      • vesta cp vm
      • kloxo mr vm
      • Ubuntu VPS
      • Debian VPS
    • Windows VPS
      • Win 11 Server/VPS
      • Win 10 Server/VPS
      • Win 7 Server/ VPS
      • Windows 2025/2022 VPS
      • Windows 2019/2016 VPS
    • Linux VPS
      • CentOS VPS
      • Ubuntu VPS
      • Debian VPS
    • VPS
      • Unmanaged VPS
      • Managed VPS
      • Storage VPS
    • RDP VPS
    • Pk Based Dedicated VPS
  • Solutions
    • DMCA Ignored Hosting
    • Proxies
    • License
    • SSL Certificated
    • SEO
    • Web Development
  • AI
    • Ollama Hosting
    • Gemma Hosting
    • ComfyUI Hosting
    • Mistral Hosting
    • Chatterbox TTS Hosting
    • Chroma DB Hosting
    • VLLM Hosting
    • Qwen Hosting
    • Stable Diffusion
    • Bark Hosting
    • PaddleOCR Hosting
    • Milvus Hosting
    • LM Studio Hosting
    • Qwen3-VL Hosting
    • ChatGPT Hosting
    • XTTS-V2 Hosting
    • Wan Hosting
    • Keras Hosting
    • DeepSeek Hosting
    • OpenAl Whisper
    • OpenAI GPT- OSS
    • Kokoro TTS Hosting
    • TensorFlow Hosting
    • PyTorch Hosting
    • LLaMA Hosting
    • Flux.1 Hosting
    • Phi Hosting
    • Coqui TTS Hosting
    • Qdrant Hosting
    • Android Emulator
  • Domain
    • Domain Register
    • .Pk Domain Register
    • Domains Checker
    • Domains Transfer
    • PKNIC Prepaid Cards
  • Help Center
    • About Us
    • Contact Us
    • Blog
    • Affiliate Program
  • Web Hosting
    • Shared Hosting
    • E-commerce Hosting
    • WordPress Hosting
    • Cloud Hosting
    • Python Hosting
    • Dedicated Hosting
    • Unlimited Hosting
    • Business Hosting
    • DMCA Ignored Hosting
    • SMM PANEL HOSTING
    • VPS Hosting
    • Student Hosting
    • Business Email
    • PHP Hosting
    • Storage Hosting
  • Reseller Hosting
    • cpanel Reseller Hosting
    • Master Reseller Hosting
    • Alpha Reseller Hosting
    • Agency Reseller Hosting
    • DMCA Ignored Reseller Hosting
  • Servers
    • Managed Dedicated Servers
    • Virtual Dedicated Server
    • Cloud Dedicated Server
    • NVMe Dedicated Servers
    • GPU Server
    • Bare Metal Server
    • Pk Based Dedicated Server
    • DMCA Ignored Server
    • Gaming server
    • Android Emulator VPS
    • kubernetes Hosting
    • Streaming Server
    • Rendering Services
    • Windows Server
    • Forex Server
  • VPS/VM/RDP
    • Virtual Machine
      • centos webpanel vm
      • vesta cp vm
      • kloxo mr vm
      • Ubuntu VPS
      • Debian VPS
    • Windows VPS
      • Win 11 Server/VPS
      • Win 10 Server/VPS
      • Win 7 Server/ VPS
      • Windows 2025/2022 VPS
      • Windows 2019/2016 VPS
    • Linux VPS
      • CentOS VPS
      • Ubuntu VPS
      • Debian VPS
    • VPS
      • Unmanaged VPS
      • Managed VPS
      • Storage VPS
    • RDP VPS
    • Pk Based Dedicated VPS
  • Solutions
    • DMCA Ignored Hosting
    • Proxies
    • License
    • SSL Certificated
    • SEO
    • Web Development
  • AI
    • Ollama Hosting
    • Gemma Hosting
    • ComfyUI Hosting
    • Mistral Hosting
    • Chatterbox TTS Hosting
    • Chroma DB Hosting
    • VLLM Hosting
    • Qwen Hosting
    • Stable Diffusion
    • Bark Hosting
    • PaddleOCR Hosting
    • Milvus Hosting
    • LM Studio Hosting
    • Qwen3-VL Hosting
    • ChatGPT Hosting
    • XTTS-V2 Hosting
    • Wan Hosting
    • Keras Hosting
    • DeepSeek Hosting
    • OpenAl Whisper
    • OpenAI GPT- OSS
    • Kokoro TTS Hosting
    • TensorFlow Hosting
    • PyTorch Hosting
    • LLaMA Hosting
    • Flux.1 Hosting
    • Phi Hosting
    • Coqui TTS Hosting
    • Qdrant Hosting
    • Android Emulator
  • Domain
    • Domain Register
    • .Pk Domain Register
    • Domains Checker
    • Domains Transfer
    • PKNIC Prepaid Cards
  • Help Center
    • About Us
    • Contact Us
    • Blog
    • Affiliate Program
Close

Search

Client Portal
Home/Linux Hosting/How to Install the Apache Web Server on Ubuntu 20.04
How to Install the Apache Web Server on Ubuntu 20.04

How to Install the Apache Web Server on Ubuntu 20.04

What is Web Server?

A web server is a software application or a computer system that serves web content over the internet. It handles requests from clients, such as web browsers, and delivers the requested web pages, files, or other resources to the client. When a user enters a URL (Uniform Resource Locator) into a web browser, the browser sends an HTTP (Hypertext Transfer Protocol) request to the web server associated with that URL. The web server processes the request and sends back an HTTP response containing the requested content, which is then rendered and displayed by the web browser.

Commonly used web server software includes Apache HTTP Server (Apache), Nginx, Microsoft Internet Information Services (IIS), and LiteSpeed. Each web server has its own features, performance characteristics, and configuration options.

What is Apache Web Server?

The Apache HTTP Server, commonly referred to as Apache, is one of the most popular and widely used web servers in the world. Apache is known for its stability, performance, and flexibility, and it runs on various operating systems, including Linux, Unix, Windows, and macOS. It supports multiple protocols, including HTTP, HTTPS, FTP, and more.

In this guide, you’ll learn how to install an Apache web server on your Ubuntu 20.04 server.

Step-by-Step Guide to Installing Apache on Ubuntu 20.04

Step 1. Install Apache

Open a terminal or SSH into your Ubuntu 20.04 server and using the following command the switch to the root user so you have the permission for later operations. Then, input password as prompted.

$ sudo -i
Switch to root user using sudo -i

Next, update the package repositories to ensure you have the latest package information.

$ apt update
update the package repositories

Once the package repositories are updated, you can install the Apache web server by running the following command:

$ apt install apache2

And type y to confirm the installation.

Install Apache

Step 2. Adjust Firewall

If you have a firewall enabled, such as UFW, you need to allow incoming HTTP (port 80) and HTTPS (port 443) traffic. Run the following commands to allow HTTP and HTTPS traffic:

$ ufw allow 'Apache'

Then, make sure the service is active by running the command:

$ systemctl status apache2
Apache status

From the above screenshot, we can see the Apache service is running. You can also verify that Apache is installed and running correctly by requesting a page from Apache. Open a web browser and enter your server’s IP address or domain name. If you do not know your server’s IP address, try the command below. If Apache is working correctly, you should see the Apache Ubuntu Default Page.

$ hostname -I

If Apache is working correctly, you should see the Apache Ubuntu Default Page as below.

default Apache2 Ubuntu Default Page.

Step 3. Set Up Virtual Hosts (Recommended)

A virtual host, also known as a virtual server, is a configuration in a web server that allows multiple websites or web applications to be hosted on a single physical server. Each virtual host has its own domain name or IP address and operates as if it is a separate server, even though it shares the underlying hardware resources with other virtual hosts. We will set up a domain called your_domain, but you should replace this with your own domain name.

Apache on Ubuntu 20.04 has one virtual host enabled by default that is configured to serve documents from the /var/www/html directory. We can create a new directory within /var/www for a your_domain site. Replace your_domain with the actual domain name of your site. In this case, we use mytestsite.com. Then, assign ownership of the directory to the user you’re currently signed in and allow the owner to read, write, and execute the files while granting only read and execute permissions to groups and others

$ mkdir /var/www/your_domain 
$ chown -R $USER:$USER /var/www/your_domain
$ chmod -R 755 /var/www/your_domain
Create a new directory

Next, create a sample index.html page using your favorite editor. Here, we use nano editor.

$ nano /var/www/your_domain/index.html
Apache status

Then create a sample HTML as below.

Apache status

Then, save the file by pressing CTRL + X, then Y and ENTER.

Next, create a virtual host configuration file for your domain. Use the following command to create and open the file in a text editor:

$ nano /etc/apache2/sites-available/your_domain.conf
default Apache2 Ubuntu Default Page.

In the configuration file, add the following content, replacing your_domain with your actual domain name. Then, save the file by pressing CTRL + X, then Y and ENTER.

default Apache2 Ubuntu Default Page.

Now enable the file with the a2ensite tool and disable the default site defined in 000-default.conf:

$ a2ensite your_domain.conf
$ a2dissite 000-default.conf
Enable new site
Disable the default site

After that, we can test for configuration errors with the command below. And you should receive the “Syntax OK” output as the screenshot shows.

$ apache2ctl configtest
Enable new site

Finally, restart Apache so that the changes take effect.

$ systemctl restart apache2
Restart Apache

When Apache is restarted, it should now be serving your domain name. You can test this by navigating to http://your_domain, and you should see the content you configured for your index page.

Verify successful virtual host setup

Manage Apache Process

Here are some basic management commands that is commonly used.

Run the commands to stop, start, and restart your web server respectively.
$ systemctl stop apache2
$ systemctl start apache2
$ systemctl restart apache2
If you are simply making configuration changes, Apache can often reload without dropping connections with the reload command:
$ systemctl restart apache2
By default, Apache is configured to start automatically when the server starts. If this is not what you want, disable this behavior
$ systemctl disable apache2
You can always enable the behavior using the command.
$ systemctl enable apache2

Conclusion

Setting up the Apache web server on Ubuntu 20.04 is a simple and effective way to start hosting websites and applications. By following a few clear steps, you can quickly get Apache running and begin serving content online. Once installed, Apache enables you to host multiple sites and share your services with the world.

Author

b2b hosting

Follow Me
Other Articles
How To Monitor Linux System Logs with Logwatch
Previous

How To Monitor Linux System Logs with Logwatch

How to Install the ModSecurity Apache Module
Next

How to Install the ModSecurity Apache Module

No Comment! Be the first one.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

© Copyright 2026 — B2B Hosting Club. All rights reserved. Design By MME.