Problem apache server (re-)Installation
8,220
Solution 1
finally i got the solution
sudo service apache2 stop
sudo apt-get remove --purge $APACHE_PKGS
sudo apt-get install --reinstall apache2
Solution 2
Open your terminal and type this
sudo apt-get install --reinstall apache2
Related videos on Youtube
Author by
Gabber
Updated on September 18, 2022Comments
-
Gabber almost 2 years
I am newbie in Ubuntu and I removed all apache file following command
sudo chown user /etc/init.d/apache2 sudo chmod 755 /etc/init.d/apache2 sudo rm /etc/init.d/apache2
I know its wrong way to removing apache, now I want to install apache again
Edit try to reinstal apache
sudo apt-get install --reinstall apache2
working fine,but when I type command
sudo service apache2 start
response as,
apache2: unrecognized service
-
S.L. Barth about 10 yearsProbably the same question, with upvoted answers: unix.stackexchange.com/questions/12597/… .
-
-
Gabber about 10 yearscommand is working fine,but "sudo service apache2 start" giving me error "apache2: unrecognized service"
-
AzkerM about 10 years@AmitDubey - Confirm whether your
apache2
service is installed by checking withdpkg --get-selections | grep -v deinstall | grep "apache2"
. This will give you an output if the packages in installed. -
Gabber about 10 years@AzkerM thanks for reply,command out put is "apache2=>install" "apache2-bin=>install", "apache2-data=>install"
-
AzkerM about 10 yearsseems like you've the packages in place. Try
sudo /etc/init.d/apache2 reload
orsudo apache2ctl graceful
to have a look through again. -
AzkerM about 10 yearsGood to hear! :)
-
mx7 about 10 yearsglad you have found that and thanks for adding . it will be useful for future reference.
-
reggie over 8 yearsDid not solve the problem.
-
Gabber over 8 years@reggie it worked for me