Under the command newbie in ubuntu install and uninstall apache2

1, the installation command

sudo  apt  install  apache2

Note: apt command to install

2, to see if the installation was successful

sudo  systemctl  status  apache2

Successful installation will appear: active (running)

3, see the apache2 version:

   apache2ctl  -v  

Note: -v (-version)

4, the client browser and enter http: // localhsot 

 

5, open the service shut down

cd / etc

init.d / apache2 start to start the service

init.d / apache2 stop stop service

init.d / apache2 restart to restart the service

6, website directory path

cd

cd / var

ls

cd www

ls

cd html

ls

 

 

Unload apache2

1, stop the service  

cd / etc

init.d/apache2  stop

2, uninstall

sudo apt-get purge apache2

sudo apt-get autoremove

3, if there is no uninstall file under inspection

whereis apache2

The following commands to delete files based on directory

sudo rm -rf /etc/apache2

Note: In the terminal with sudo rm -rf copy and paste files to delete one by one under a different directory: ctrl + shift + c, ctrl + shift + v

 rm -rf    

rm - remove files or directories

rm -rf * delete all files in the current directory, this command is very dangerous and should be avoided.
Note: the deleted file, generally can not be restored!

Uninstall successful!

Guess you like

Origin www.cnblogs.com/qiu277206188/p/12153342.html