/etc/init.d/apache2 is service script used to start / stop / restart the Apache2 service under Debian or Ubuntu Linux. You need to login as root or use sudo command restart Apache.
Task: Start Apache 2 Server
# /etc/init.d/apache2 start
$ sudo /etc/init.d/apache2 start
Task: Restart Apache 2 Server
# /etc/init.d/apache2 restart
$ sudo /etc/init.d/apache2 restart
Task: Stop Apache 2 Server
# /etc/init.d/apache2 stop
$ sudo /etc/init.d/apache2 stop
The usual location for Debian-like systems (ubuntu) is to place webfiles under the /var/www/… branch of dirs. That is also the location where apache would look (at least you find it in many example apache config files).
So you could build dirs like that:
You may see such statement:
„Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName”
To fix that problem, you need to edit the httpd.conf file. Open the terminal and type,
By default httpd.conf file will be blank. Now, simply add the following line to the file.
Save the file and exit from gEdit. Finally restart the server.