Install Apache in Linux environment

apache001

summary

Install the web server software Apache in a Linux environment.

Apache installation

What is Apache?

It is one of the most famous “Web server software” in the world.

The web server software accepts HTTP requests from clients.

Executes a script language such as PHP in response to a request and responds the execution result to the client.

HTTP

Abbreviation for “HyperText Transfer Protocol”, which is a communication protocol (procedure, convention) for sending and receiving message data between a client and a server.

Check software package “httpd”

Check the apache package.

sudo dnf module list httpd

Software package installation

Install the default v2.4.

sudo dnf -y install httpd

Confirmation after installation

httpd -v

Apache startup

Use the “systemctl” command to start Apache.

systemctl

A command that operates systemd (system management daemon).

Start, Stop, and Check the status of the service.

systemctl command {Unit name}.service
command processingexample
statusstatus checksystemctl status httpd
startStart of the servicesystemctl start httpd
restartService restartsystemctl restart httpd
stopEnd of servicesystemctl stop httpd
enableService automatic startupsystemctl enable httpd
disableService automatic startup stopsystemctl disable httpd

Execute the command to execute the command.

sudo systemctl enable --now httpd

Check the status.

systemctl status httpd

Change firewall settings

Open the port that accepts https requests from the outside.

sudo firewall-cmd --zone=public --add-service=http --permanent

Reboot firewall

sudo firewall-cmd --reload

Check firewall

sudo systemctl status firewalld

Access the web server

Access the web server from the web browser (Edge, chrome) of the host OS.

http://{Web server IP}:80/

If the IP of the Web server is “192.168.0.100”, it will be as follows.

http://192.168.0.100:80/

Apache has been successfully installed.

タイトルとURLをコピーしました