QueHow

A How-To and wiki Blog

  • Operating System
    • Windows
      • Windows 10
      • Windows 7
    • Linux
  • Software
    • Application Software
    • Microsoft Office
      • Outlook
      • Word
      • PowerPoint
  • Internet
    • Browsers
      • Mozilla Firefox
      • Google Chrome
    • CMS
    • Tips & Tricks
  • Website
    • ecommerce
    • Google
    • Social Networking
    • General Websites
  • Mobile
  • Email
    • Gmail
  • Wiki

How to Install and Configure Apache Web Server in Ubuntu

By Neha T Leave a Comment

Have you ever thought of maintaining your websites with your own web server? So why not Apache, see how to install and configure Apache Web Server. It is used widely for the purpose of running various servers, especially in Ubuntu, as it is pretty much cost effective as compared to using it with any web hosting provider services.

Apache is an open source web server based on HTTPD, here the suffix “D” with HyperText Transfer Protocol stands for Daemon. The HTTP Daemon, as the name suggests, runs in the background, and it is with HTTP that enables to operate a web server and handle requests. There are several benefits of using your own web server, some of them are as follows:

  • Handling your own web server is much easier to maintain, as changes can only be done by you.
  • It’s free to use, not including the charges of an additional software, internet charges or electricity bill. I think, it does not matter, if you have decided to run your own server.
  • You can use the server for various purposes such as email and media server.
  • You can configure and customize it according to your suitability.

Previously Apache was designed to run the server in Linux based systems only, but later on, it got modified for Unix, Solaris, Windows and many others Operating System. As Ubuntu is one of the trendy distribution of Linux operating system, so many people prefer to setup web server in this system.

Steps to Install and Configure Apache Web Server in Ubuntu

Step 1: To install Apache using the Terminal, open up the Terminal using “Ctrl + Alt + T”. Then write the following command: “sudo apt-get install apache2” and press enter.

How-to-install-and-configure-apache-web-server-in-Ubuntu-Step1

Step 2: Enter the password of your Ubuntu Machine, and after this, you may see a statement that an “additional space is required”, to proceed further write “y” to say yes.

How-to-install-and-configure-apache-web-server-in-Ubuntu-Step2

Step 3: It will take few minutes to complete the Installation process. When completed, look for the default “ServerName” for the Apache.

How-to-install-and-configure-apache-web-server-in-Ubuntu-Step3

Step 4: Type the IP address in the range of the “ServerName” of Apache, i.e., 127.0.1.1 on any Web Browser. I have done the same, look at the default page of “Apache”, from which you”ll get assured that it is successfully installed on the system OR simply type localhost.

The output of it will be visible to you. Some information is also available on the page, notice one thing that the default file, i.e., index.html resides in the folder as highlighted.

How-to-install-and-configure-apache-web-server-in-Ubuntu-Step4

Step 5: So let’s check it once, Type ‘ls’ followed by the directory name, each separated by forward slash i.e. “ls /var/www/html” and press enter.

“/var/www” is the folder where web servers reside in Linux system (Ubuntu). All the web traffic comes on port number 80 which is assigned to “www”.

How-to-install-and-configure-apache-web-server-in-Ubuntu-Step5

Step 6: Result of the above command will be on your screen, it’s “index.html”, a default page to access your web page. You can change it by the domain name of your site.

How-to-install-and-configure-apache-web-server-in-Ubuntu-Step6

Step 7: Suppose you want to edit the content of this page, you have to open it by using nano, gedit or vim editor, whichever suits you.

For the time being, open it using nano: write “sudo nano /var/www/html/index.html” then press enter.

How-to-install-and-configure-apache-web-server-in-Ubuntu-Step7

Step 8: According to the version of your Ubuntu and Apache server, the default page may differ. You can perform the changes as required. Just for testing, change the Title of the page to “Ubuntu14 Homepage” then press ctrl +X to exit, then you will be asked to Save changes or not, type “y” for yes.

How-to-install-and-configure-apache-web-server-in-Ubuntu-Step8

Step 9: When done with the changes, look for it, by refreshing the Web Page. Here, in the figure you can see that the “Title” of the page is changed.

How-to-install-and-configure-apache-web-server-in-Ubuntu-Step9

Step 10: Now, if you wish to stop the web server, type “sudo /etc/init.d/apache2 stop” and press enter. This command will stop the Apache server, in the same way, you can write “restart” or “start”.

The restart will force the server to check for the changes made into the library of Apache. Whereas start is used to simply start the server if you have freshly logged in to the system. Here, you may notice that the directory “/etc/init.d” is accessed as it contains the script regarding when to start, stop and restart a particular service. You might have heard about “init”, it is the first program that initiates when the kernel has completed the entire initializing process.

How-to-install-and-configure-apache-web-server-in-Ubuntu-Step10

You Might Also Like:

How to install PHP and Apache Server in Ubuntu 14.04 How to install lamp (Linux, Apache, MySQL and Php) in Ubuntu 14.04 How to install and configure uTorrent server in Ubuntu 14.04 how-to-install-and-configure-ssh-in-ubuntuHow to Install and Configure SSH (Secure SHell) in Ubuntu how-to-install-mysql-in-ubuntu-using-terminalHow to Install MySQL in Ubuntu using Terminal How to install and configure built In firewall in Ubuntu 14.04 how-to-install-and-configure-wine-in-ubuntuHow to Install and Configure Wine on Ubuntu how-to-use-and-install-telnet-in-ubuntuHow to Install and Use TELNET in Ubuntu

Leave a Reply Cancel reply

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

Most Viewed

  • How to Install and Use TELNET in Ubuntu
  • How to install Hindi fonts in MS Word
  • How to Change a File Extension in Windows 10?
  • How to create a flipkart account in 3 simple steps
  • How to Change Monitor Refresh Rate in Windows 10?
  • How to install IIS on Windows 10
  • How to Insert Clickable Checkbox in MS Word 2016?
  • How to Set Auto Reply in Outlook 2016?
  • How to Login as Administrator in Windows 10?
  • How to Check RAM Size and System Type in Windows 10?

Recent Additions

  • How to Add Hyperlink to Another Sheet in Excel?
  • How to Add and Remove Watermark in Excel
  • How to use Relative and Absolute Cell Reference in Excel?
  • How to Enable and Disable Scroll Lock in Excel?
  • How to Use INDEX and MATCH Functions in Excel?
  • How to Make Bar Graph in Excel?
  • How to Count Duplicate Values in Excel?
  • How to Wrap Text in Excel?
  • How to Round off Numbers in Excel?
  • How to Create a Bell Curve in Excel?

Related Searches

  • How to Partition Hard Drive in Windows 10?
  • How to Find MAC Address in Windows 10?
  • How to Turn on Instagram Notifications?
  • How to Create, Add, and Customize a Template in OneNote 2016?
  • How to Send Message on Instagram from PC?

Copyright © 2023 · QueHow · Contact Us