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:
- Docker Compose Nginx Node Js Mysql Docker Compose Nginx Node Js Mysql What is Docker Compose? Docker Compose is a utility used to deploy and manage applications created with multiple services (or containers) in a single…
- Remove Nginx Full Complete On Ubuntu 18 Remove Nginx Full Complete On Ubuntu 18 Uninstallating Nginx From Ubuntu Ubuntu is one of the most popular Linux-based operating systems, and it has a wide variety of programs available…
- 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…
- 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…
- 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…
- 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…
- Install Phpmyadmin On Nginx Ubuntu Install Phpmyadmin On Nginx Ubuntu What Is Phpmyadmin? Phpmyadmin is a free, open source web application written in PHP specifically designed to help manage MySQL databases. It is a powerful…
- 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…
- Install Nginx And Php On Ubuntu 18.04 Install Nginx And Php On Ubuntu 18.04 Introduction In this article, we will guide you on how to install Nginx and php on Ubuntu 18.04. Nginx is a popular web…
- 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…
- Webdav Nginx Ubuntu 16.04 Webdav Nginx Ubuntu 16.04 Introduction to Webdav with Nginx in Ubuntu 16.04 The ever-evolving world of the internet has given us a powerful platform to share information, media, and files…
- Can I Use Nginx For Cpanel Can I Use Nginx For Cpanel? What is Nginx and What Does it Do for Cpanel? Nginx is an open source web server and reverse proxy created by Igor Sysoev…
- 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…
- Available Application Apache And Nginx Available Application Apache And Nginx What is Apache? Apache is a web server software that allows users to store and deliver web content quickly and efficiently. Apache was created in…
- Nginx Ssl Ubuntu 16.04 Nginx SSL Ubuntu 16.04 What is SSL and Nginx? SSL stands for Secure Sockets Layer. It is a protocol used to encrypt communications over the internet. It is a secure…
- Ubuntu 16.04 Nginx Letsencrypt Ubuntu 16.04: A Comprehensive Guide to Nginx and Letsencrypt What is Nginx? Nginx is a web server and an open-source reverse proxy server for HTTP, HTTPS, and other protocols. It…
- Turn Off Nginx And Start Apache Turn Off Nginx And Start Apache What is Nginx and Apache? Nginx and Apache are two of the most commonly used web servers on the internet today. Nginx is the…
- Nginx Ssl Configuration Ubuntu 18.04 Nginx Ssl Configuration Ubuntu 18.04 What is Nginx? Nginx is an open source web server and reverse proxy software. It is used to manage web traffic on the internet, like…
- Vps Webserver Nginx Php7 Mysql Vps Webserver Nginx Php7 Mysql What Is VPS Webserver? A VPS webserver is a Virtual Private Server (VPS) that has been configured to act as a web server. A VPS…
- 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…
- Nginx Vs Apache Php Benchmarks Nginx Vs Apache Php Benchmarks What are the Nginx and Apache web servers? Nginx and Apache are two of the most popular web servers on the internet. Nginx is a…
- Easyengine Detected A Previously Installed Nginx Package Easyengine Detected A Previously Installed Nginx Package What is EasyEngine? EasyEngine is a command line tool that is used for installing, configuring, and managing web servers. It provides a simple…
- Install Postgis Ubuntu 18.04 Nginx Install Postgis Ubuntu 18.04 Nginx What is Postgis? Postgis is a Postgres-based open source geographic information system (GIS) that enables users to store, query, and analyze spatial data stored in…
- Digital Ocean Ubuntu Nginx Docker Digital Ocean Ubuntu Nginx Docker What is Digital Ocean? Digital Ocean is a cloud computing provider. It is a great platform for businesses and developers who need to quickly set…
- 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…
- Install Mysql Pada Nginx Pada Ubuntu Install Mysql Pada Nginx Pada Ubuntu Overview of Nginx and Its Benefits Nginx is a web server, reverse proxy server, and mail proxy server application that is open-source and available…
- Nginx Always Displaying Default Page In Ubuntu Nginx Always Displaying Default Page In Ubuntu Introduction Ubuntu is one of the most popular Linux distributions and an immensely powerful and versatile operating system. It has a great package…
- Reconfigured Nginx To Use Php7.2 Reconfigured Nginx To Use Php7.2 Introduction Nginx is one of the most popular and powerful web servers available today. It is often used as the primary web server for large…
- Remove Apache2 To Use Nginx Remove Apache2 To Use Nginx What is Apache2? Apache2 is an open server technology and web server platform used for running web applications, websites, and dynamic content. It is the…
- Error Install Nginx On Ubuntu Error Install Nginx On Ubuntu What is Nginx? Nginx is a web server software used to host web applications. It is open source software developed by the open source community.…