Hello, everybody today I am gonna show the procedure to install apache server on ubuntu 15.04.
so lets get started.
step - o1:
Open terminal and type sudo apt-get install apache2
step - 02:
after completing installation type sudo /etc/init.d/apache2 start for start server.
Here is some useful apache command
sudo /etc/init.d/apache2 start #start apache
sudo /etc/init.d/apache2 stop #stop apache
sudo /etc/init.d/apache2 restart #restart apache
# prevent auto-start when booting up
sudo update-rc.d -f apache2 remove
so lets get started.
step - o1:
Open terminal and type sudo apt-get install apache2
step - 02:
after completing installation type sudo /etc/init.d/apache2 start for start server.
Here is some useful apache command
sudo /etc/init.d/apache2 start #start apache
sudo /etc/init.d/apache2 stop #stop apache
sudo /etc/init.d/apache2 restart #restart apache
# prevent auto-start when booting up
sudo update-rc.d -f apache2 remove
step - 03:
Open your browser and type localhost then you should see a page like this.
the default server directory is /var/www/html inside this folder you can place you html files, But if you want to change the default root directory then follow few more steps with me.
step - Changing default root directory :
open a new terminal and paste this sudo gedit /etc/apache2/sites-available/000-default.conf then it open a file in gedit find the line DocumentRoot /var/www/html and replace it with DocumentRoot /home/your_username/public_html here /.../public_html is custom folder directory you are free to give any directory but at first make sure you created the directory before doing this.
here is my public_html tree.
and your are done ! open browser and type your file url (use your own) http://localhost/jolly-jumper/index.html then you should see the result.
Thanks,hope I helped you someway, feel free to comments.