I have been fiddling around with Apache for quite sometime now on Ubuntu and there were few questions which used to come to my mind as novice user initially like how do i install apache on first place, where are Apache logs, where are Apache conf files located, how do I add new site to Apache server, stopping and restarting the server so I thought that I would some up answer to all these question at a single place for my own future reference and for the help of my readers.
So first things first I will start with how to install apache here apt-get comes to your rescue and thanks to Ubuntu archives all you need to give simple on liner as shown below
sudo apt-get install apache2
So now that we are done with installation lets move on other things like for troubleshooting you need to know where are apache logs, apache logs can be found at below mentioned path here you can find access logs as well as error logs
/var/log/apache2/
we also need to know where are configuration related files to our web server for that we need to look at path mentioned below here you will find apache2.conf, httpd.conf, ports.conf and other configuration related files how to modify and update them is beyond the scope of this nifty article
/etc/apache2/
Moving on to next FAQ this one is my favourite now that I have setup apache how do I go about hosting my site thats the whole purpose for you following along this article, all you need to do is follow the sequence mentioned below
Create a file mysite or what ever name you want to give and add configuration related to your site in this file
gedit /etc/apache2/sites-available/mysite
cd /etc/apache2/sites-available
sudo a2ensite mysite
you are done with setting up your site.
Last of these faq’s is how do I start and stop the server for doing this all you need to know about is apache2ctl utility and you can start stop using it pretty easily
apache2ctl start
apache2ctl stop
apache2ctl restart
We are done with the faq’s which were in mind and I will keep on updating this list in future as and when things come to my mind. In next article I would covering how to use apache to host Subversion repositories along with domain authentication so stay tuned.
Filed under: Linux,OpenSource
Trackback Uri