Some popular web servers are Apache, Apache Tomcat, IIS etc. While Apache is used for PHP pages, Tomcat is used for JSP. IIS is a Microsoft server used for ASP. In this post I will show you how to install Apache and host websites on it.
First of all we need to install Apache. In Ubuntu you can do so by typing
- Copy the default website to use it as a template
sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/adityapatawari.com
- Change the DocumentRoot by editing /etc/apache2/sites-available/adityapatawari.com to point to the new location i.e. /web/adityapatawari.com. You will need to have root permission to do this.
- Change the Directory directive, replace <Directory /var/www/>to <Directory /web/adityapatawari.com/ >
- Now disable the previous site and enable this new one. To do so type
sudo a2dissite default && sudo a2ensite adityapatawari.com