I am new to Ubuntu. i have installed apache2. I want to start apache2 by command but i am unable to find it any of the directory in root. I just want to know where is that apache2 file stored and how can i start it with command?
-
2Possible duplicate of What is the equivalent to the Windows "Program Files" folder? (Where do things go when I install them?) – muru Feb 03 '16 at 06:51
-
this url will give you some ideas to deal with your problems – willie Feb 03 '16 at 07:16
-
Thanks for your link but i am using a server version not desktop version. – Subhash kiran Feb 03 '16 at 07:20
-
you can check it again, it is not only for Desktop(VM) but for Server is okay , thanks – willie Feb 03 '16 at 07:23
3 Answers
The apache config is in :
/etc/apache2
If you want to start apache, launch in a term :
sudo service apache2 start
If you want to restart apache, launch in a term :
sudo service apache2 restart

- 126
- 3
After installation of apache2 package the server should be started as daemon on machine startup. Therefore, it should run. Just open a browser and check localhost
for a running webserver. It should result in an "It work's" page of apache.

- 107,489

- 169
-
Thanks for your answer. can you tell me after installation what is the default directory in which they are stored? – Subhash kiran Feb 03 '16 at 07:05
Based on your command you are most likely trying to find the html files.
You can edit the html files by adding to the /var/www/html
directory.
Unless you add your own html files you will get the default index.html page.
You can make your own personal changes by editing or changing the default index.html file.
For instance:
$ sudo -H gedit /etc/www/html/index.html
Whatever yo uplace in that file will come up when you access your server with by placing the host
, ip address
, or the word localhost
in the web browser.
Please note that the $
is a default terminal prompt for a normal user. If you were logged in as root the default prompt would be #
. You would't need the sudo
command if you were logged in under root.

- 25,036