Remove Nginx And Install Apche Ubuntu 18.04
Introduction
The world of web servers is quite vast and different web servers have different applications and preferences. If you are new to the world of web servers it can be quite daunting to know which one you should use for your particular website or application. One of the most popular web servers used today is Nginx (Engine X), which is well known for its speed, reliability and scalability. On the other hand, another popular web server is Apache, which has been around for a much longer time and is quite versatile.
Apache is generally considered to be more feature-rich compared to Nginx. It can be used for web hosting, as a proxy server, for file serving, as an application server and for many other purposes. This can be quite handy for websites or applications with varying needs. In this article, we will show you how to uninstall Nginx and install Apache on Ubuntu 18.04.
Prerequisites
In order to complete this tutorial, you need:
- A server running Ubuntu 18.04 with at least 1GB of RAM.
- A non-root user with sudo privileges.
- Access to the root account or a user with sudo privileges.
You can check whether your server meets the requirements by running the following command:
You should see your RAM size listed in the output:
Output
MemTotal: 8195240 kB
[...]
Once you have checked that your server meets the requirements, you can proceed with the installation.
Step 1 — Uninstalling Nginx
Let’s start by uninstalling the previous version of Nginx. To do this, run the following command:
- sudo apt-get remove nginx -y
The output should look something like this:
Output
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libnginx-mod-http-image-filter libnginx-mod-http-xslt-filter libnginx-mod-mail
libnginx-mod-stream
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
nginx*
[...]
Now that Nginx has been uninstalled, we can proceed with the installation of Apache.
Step 2 — Installing Apache
To install Apache, we need to first install the Apache2 package from the Ubuntu repository. To do this, run the following command:
- sudo apt-get install apache2 -y
The output should look something like this:
Output
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
apache2-bin apache2-data libapr1 libaprutil1 libaprutil1-dbd-sqlite3
libaprutil1-ldap ssl-cert
Suggested packages:
apache2-doc apache2-suexec-pristine apache2-suexec-custom
apache2-utils ssl-cert libnet-ssleay-perl libauthen-pam-perl
libio-pty-perl libcrypt-ssleay-perl
The following NEW packages will be installed:
apache2 apache2-bin apache2-data libapr1 libaprutil1
libaprutil1-dbd-sqlite3 libaprutil1-ldap ssl-cert
[...]
Once Apache is installed, we need to configure it for our application. To do this, open the Apache configuration file in your text editor:
- sudo nano /etc/apache2/apache2.conf
In the configuration file, add the following line to your VirtualHost definition:
ServerName your_domain_name
In the above line, replace your_domain_name
with the actual domain name of your application. You should also add the following line to the same file:
ServerAlias *.your_domain_name
Save and close the file when you are finished. Now, we need to enable the Apache modules we need for our application. To do this, run the following command:
Replace module_name
with the Apache module you need for your application. For example, to enable the rewrite module you would use the following command:
Once you have enabled all the modules you need for your application, you can restart Apache to apply the changes:
- sudo systemctl restart apache2
You can now check if the installation was successful by running the following command:
The output should look something like this:
Output
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: active (running) since Tue 2018-07-31 11:07:05 EDT; 41s ago [...]
At this point, Apache should be installed and running on your server.
Conclusion
In this article, we have shown you how to uninstall Nginx and install Apache on Ubuntu 18.04. If you have any questions or comments, please feel free to
Related Posts:
- Nginx Reverse Proxy Apache Change Document Roo Nginx Reverse Proxy Apache Change Document Roo What is Nginx and Apache? Nginx and Apache are two of the most popular open source web servers out there. Nginx is known…
- Install Nginx 1.16 Ubuntu Install Nginx 1.16 Ubuntu Introduction to Nginx 1.16 Nginx 1.16 is a web server that helps you to serve web content quickly, efficiently and securely. It is especially popular with…
- 502 Bad Gateway Nginx Fix Ubuntu 502 Bad Gateway Nginx Fix Ubuntu What is 502 Bad Gateway? The 502 Bad Gateway is an HTTP status code that shows up when the client computer attempts to communicate…
- How To Uninstall Let Encrypt On Nginx How to Uninstall Let Encrypt on Nginx Introduction to Let Encrypt and Nginx Let’s Encrypt is a free and open-source Certificate Authority (CA) that provides free certificates to enable secure…
- Cache Http Tanpavirus.Web.Id Nginx-Virus Cache Http Tanpavirus.Web.Id Nginx-Virus What is Cache Http Tanpavirus.Web.Id? Cache Http Tanpavirus.Web.Id is a malicious website that infects web browsers and servers when they visit the website. It is often…
- Nginx Vs Apache Performance Benchmark Nginx Vs Apache Performance Benchmark Introduction As web development continues to evolve, it’s essential for websites to stay ahead of the competition. Using the right server-side web service is essential…
- How To Check Whether 2 Nginx Is Installed In Ubuntu How To Check Whether 2 Nginx Is Installed In Ubuntu Overview Nginx is an open-source web server that is used to host web sites and applications. It is very popular…
- Hhvm Nginx Ubuntu 16.4 HHVM Nginx Ubuntu 16.4 What is HHVM? HHVM, also known as HipHop Virtual Machine, is a virtual machine developed by Facebook to speed up the execution of PHP code. It…
- Install Odoo 11 Nginx Ubuntu 16 Install Odoo 11 Nginx Ubuntu 16 What is Odoo 11 Nginx? Odoo 11 Nginx is an open source software package designed to facilitate secure and reliable web development. It is…
- Install Wordpress On Ubuntu 18.04 Nginx Install WordPress On Ubuntu 18.04 Nginx Introduction To Ubuntu And Nginx Ubuntu is a popular open-source operating system which has gained immense popularity over the years. It is easy to…
- Debian Install Nginx Php Mysql Phpmyadmin On Debian 9 Debian Install Nginx Php Mysql PhpMyAdmin On Debian 9 What Is Debian 9? Debian 9 (codenamed “stretch”) is the most recent stable version released by the Debian project, the developers…
- Ubuntu Nginx Fastcgi 7.2 Ubuntu Nginx Fastcgi 7.2 What is Ubuntu Nginx Fastcgi? Ubuntu Nginx Fastcgi is an open-source web server that is used to provide web hosting services on Ubuntu Linux. It provides…
- Remove Apache2 Ubuntu And Change To Nginx Remove Apache2 Ubuntu And Change To Nginx What Is Apache2? Apache2 is an open-source web server software created and maintained by the Apache Software Foundation. It is one of the…
- Ubuntu Install Nginx Php7.2 Mysql Ubuntu Install Nginx Php7.2 Mysql What is Nginx? Nginx is an open source web server that is very popular for powering web applications such as WordPress and Drupal. It is…
- Nginx Install Ssl Certificate Ubuntu Nginx Install SSL Certificate Ubuntu What is Nginx? Nginx is a free, open-source web server that is used for powering websites. It is popular for its speed, scalability, and stability,…
- E Unable To Locate Package Nginx E Unable To Locate Package Nginx What is Nginx? Nginx is an open-source web server and reverse proxy that is used for hosting websites, web applications, and other network services.…
- How Use Nginx Mysql Ubuntu How to Use Nginx, MySQL and Ubuntu What is Nginx? Nginx is an open source web server and reverse proxy software written by Igor Sysoev. It is a popular choice…
- Ubuntu Server Postgresql Nginx Php Ubuntu Server Postgresql Nginx Php Introduction Optimizing your server is one of the most important steps you can take when it comes to running a successful website or application. It…
- Wordpress Performance Easy Engine Nginx Wordpress Performance Easy Engine Nginx Introduction to WordPress and Performance WordPress is a popular, open-source content management system (CMS) often used for creating professional websites. This platform has easy-to-use features…
- Laravel Migration From Apche To Nginx Laravel Migration From Apache To Nginx What is Nginx? Nginx is a web server that has become increasingly popular over the years. It is robust, reliable, and secure. Nginx is…
- Digital Ocean Ubuntu Server Nginx Docker Digital Ocean Ubuntu Server Nginx Docker Understanding Digital Ocean Digital Ocean is a cloud service provider that focuses on simplifying web infrastructure for cloud developers. They offer a platform where…
- Php Run On Server Apache Nginx PHP Run on Server Apache Nginx What is PHP? PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source scripting language that can be used to create dynamic…
- Replace Apache To Nginx Ubuntu 18 Replace Apache To Nginx Ubuntu 18 Installing Nginx Ubuntu 18 uses Nginx as its default web server, and it is pre-installed. However, if you want to use a fresh version…
- Nginx 1.4 6 Ubuntu Nginx 1.4 6 Ubuntu Overview of Nginx 1.4 6 Ubuntu Nginx is an open-source web server software used to serve webpages and HTTP requests. Nginx was initially developed for the…
- Nginx Reverse Proxy For Apache Nginx Reverse Proxy For Apache What is a Reverse Proxy? A reverse proxy is a server that takes incoming traffic from the Internet and forwards it to one or more…
- How To Know Apache Or Nginx How To Know Apache Or Nginx Understanding Apache and Nginx Apache and Nginx are two of the most popular web servers used today. Apache is a open-source web server management…
- Compare Webproxy Nginx And Apache Compare webproxy Nginx and Apache What is Nginx? Nginx (pronounced “engine-x”) is a web server that is used for web-hosting purposes. It is open source software that is available for…
- How To Install Nginx Ubuntu How To Install Nginx Ubuntu What is Nginx? Nginx is an open-source web server, reverse proxy, load balancer, and HTTP cache solution with a strong focus on speed and performance.…
- Nginx Https For Node Js Nginx Https For Node JS What is Node JS Node JS is an open-source, cross-platform, JavaScript runtime environment used for creating server-side and network applications. Node JS is most commonly…
- Install Rails On Ubuntu Nginx Rbenv Install Rails On Ubuntu Nginx Rbenv Introduction Rails is an open-source web application framework written in Ruby. It is designed to make programming web applications easier by providing a full…