I have installed lamp on Ubuntu 15.10. Apache is working fine. Whenever i tried to start the server it says. bash: /etc/init.d/httpd: No such file or directory. Please help.
Asked
Active
Viewed 7,444 times
0
-
What command did you run to start the server? – Michael Lindman Jan 08 '16 at 13:53
-
$/etc/init.d/httpd start – Goutham Sridhar Jan 08 '16 at 13:56
-
Ah, current versions of Ubuntu use systemd and the start command is `sudo systemctl start apache2.service` and for earlier versions using upstart the command is `sudo service apache2 start`. Ubuntu hasn't used `/etc/init.d/` for starting services for quite a while now. – Michael Lindman Jan 08 '16 at 14:01
-
1Possible duplicate of [How to enable or disable services?](http://askubuntu.com/questions/19320/how-to-enable-or-disable-services) – Michael Lindman Jan 08 '16 at 14:02
1 Answers
1
$/etc/init.d/httpd start will not work on Ubuntu, Debian/Ubuntu support listed below commands and CentOS/RHEL support service httpd restart:
How to start Apache 2:
sudo service apache2 start
How to stop Apache 2:
sudo service apache2 stop
How to restart Apache 2:
sudo service apache2 restart
How to reload Apache 2:
sudo service apache2 reload
Ramesh Chand
- 7,116
- 4
- 30
- 37
-
Thanks a lot. Can you please tell me how do i run perl programs on the server. – Goutham Sridhar Jan 08 '16 at 14:04
-
@GouthamSridhar If you have new question please ask it by clicking on the [Ask Question](https://askubuntu.com/questions/ask) button. – Michael Lindman Jan 08 '16 at 14:07
-