About us

Join us FREE!

Installing Apache Web server on Linux server

Tutorial by Amit connectclue-author-image

All > Technical > Apache server

2 likes

Please login to like this article.

connectclue-linkedin-share

Apache http web server is open source. In this tutorial we will get to know the steps to install this in Ubuntu Server.
This steps are tested on Ubuntu 16.04. I have listed down some basic Linux commands also which you should be aware of.

1.  Since this is Ubuntu so you need to update it before all types of installation
      -sudo apt update

2.  Install Apache server by running the below command.
   - sudo apt install apache2

3. Once this is installed, try the below url to check if web server is running with default page without any issue. You can type your IP address instead of localhost.
  - localhost:80/


 

4. If you see the above screen shot in your response then Apache web server is installed successfully. This is serving the default page created during installing from below location.
 - cd /var/www/html

 5. You can try to open the index.html file present here and update, same will reflect here localhost:80/
    Open and Edit file
   - vim index.html
    Type "i" to enter insert mode.
    Press ESC and then type ":wq!" then press Enter to save the changes and exit vim.


6. Now we will learn how to create a placeholder for any new site hosting. Suppose your site name is myexample
 cd /var/www/myexample
 nano index.html
   Add any content in this file which you wants, I added below content.



7. Now let's configure the new site in default location of apache.
    cd /etc/apache2/sites-available/

9. Create config for our domain
    sudo nano myexample.conf
    Add the email address in ServerAdmin email@myexample.com
    Add the server name as ServerName myexample.com
    Add the Document for the folder which you had already created




10. Once all done resrtart Apache
- service apache2 reload


Now hit myexample.com, it will open the page for this domain which you had mentioned in the html.
     
     Happy learning!!









Login for enhanced experience

connectclue-tick Create and manage your profile

connectclue-tick Refer an author and get bonus Learn more

connectclue-tick Publish any lost and found belongings

connectclue-tick Connect with the authors & add your review comments

connectclue-tick Join us for Free to advertise for your business or Contact-us for more details

connectclue-tick Join us for Free to publish your own blogs, articles or tutorials and get your Benefits

connectclue-login

Back to top