Sunday, January 10, 2016

How to install Apache web server on Lubuntu

How to install Apache web server on Lubuntu

You will need to have web server if you want to run some webpages, the most popular web server is apache web server, in this article i will show you how to install and setup apache web server on lubuntu.

Open the terminal/console/command line (press CTRL + ALT + T) and then run the following command to install apache web server:

sudo apt-get install apache2

Once installed, check whether the apache web server is running or not, by opening web browser and then type localhost, you should see something like this:

How to install Apache web server on Lubuntu

If you see that page, means apache web server is working properly, up and running, you can also run this command to check the status of apache web server:

sudo service apache2 status

You can stop, start, and restart apache web server using these commands:

sudo service apache2 stop

sudo service apache2 start

sudo service apache2 restart

By default the document root for apache web server is on /var/www/, this is where you put your web files (html, css, javascript, php, etc). The apache web server default page we saw earlier is located at /var/www/html/index.html.

The apache web server configuration file is located at /etc/apache2/apache2.conf, i strongly suggest to backup first before editing that file, so if something went wrong you can restore the default config.

sudo leafpad /etc/apache2/apache2.conf

After editing the apache web server configuration file, make sure you restart the apache web server, so that the changes can take effect.

How to remove/uninstall apache web server?

In case you want to try other web server, or you already have another web server and it conflict with apache, you can uninstall apache web server from lubuntu, using this command:

sudo apt-get purge apache2

If thats doesn't work, try this:

sudo apt-get remove apache2*

~ good luck ~

1 comment:

  1. How i could know my Server's Public IP Address in lubuntu? Thanks