Before installing, first check whether it has been installed
apt list --installed | grep tool
tool: the name to be detected, such as mysql, apache, ngnix, etc.
install apache
sudo apt install apache2
Installing apache is enabled by default
You can check
the service through the browser apache stop # apache stop service
Opening, closing, and restarting services in Linux
1. service service name stop
2. service service name start
3. service service name restart
or
1. systemctl stop service name systemctl stop apache2
2. systemctl restart service name systemctl restart apache2 systemctl reload apache
3. systemctl start service name systemctl start apache2
4 systemctl status apache2
/var/www Directory for placing web pages
/var/log/apache2/
The directory where the /etc/apache2 configuration file is located
Check the apache version installed on Ubuntu
dpkg -l |grep apache2