Update your system to the latest using below mentioned commands.
sudo apt update
sudo apt upgrade
Installing Apache 2 server
Once the system is updated with latest patches , we can install
Apache 2 software using the following command
sudo apt install apache2
Enabling the apache2 service
To check if the service is enabled
sudo systemctl is-enabled apache2.service
If not already enabled we can use the systemctl commmand
as follows:
sudo systemctl enable apache2.service
Start/Stop/Restart commands for apache2 service:
sudo systemctl start apache2.service
sudo systemctl stop apache2.service
sudo systemctl restart apache2.service
To check the status of service:
sudo systemctl status apache2.service
If you are using ufw firewall we need to open a few ports to access
the apache server using following commands :
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
After opening the ports same can be verified as:
sudo ufw status
The last step after going through all this complete process would be to
test the installation of apache 2 server .
We can do that using curl command as:
curl -I http://ip-address-of-the-server
Comments
Post a Comment