“Configuring Apache Web Server on CentOS 7”

7 months ago 44
BOOK THIS SPACE FOR AD
ARTICLE AD

Alshifa Shaikh

The Apache HTTP Server, commonly known as Apache, is an open-source web server software maintained by the Apache Software Foundation. It is one of the most popular and widely-used web servers in the world. Apache is designed to handle HTTP requests, serving web content such as HTML pages, images, CSS files, and more to clients (such as web browsers) over the Internet. It runs on various operating systems including Linux, Unix, Windows, and others, and it supports a range of features including virtual hosting, SSL/TLS encryption, URL rewriting, authentication, and more. Apache’s flexibility, stability, and extensibility have made it a cornerstone of the modern web infrastructure.The command will determine whether the package is installed or not.# rpm -qa|grep httpdIf the package is not installed, then the package will be installed with this command.# yum install httpd*After the package is installed, you can use this command to check whether the package has been installed or not.# rpm -qa|grep httpd

The Package Name Is :-

[httpd-2.4.6–99.el7.centos.1.x86_64 ]

This command allows you to view information about the package.# rpm -qi httpd-2.4.6-99.el7.centos.1.x86_64You can view the list of installed packages using this command. # rpm -ql httpd-2.4.6-99.el7.centos.1.x86_64You can view the configuration file of the package using this command.# rpm -qc httpd-2.4.6-99.el7.centos.1.x86_64You can view the documentation of the package using this command. # rpm -qd httpd-2.4.6-99.el7.centos.1.x86_64With this command, you can view the inclusions of configuration files.# cat /etc/httpd/conf/httpd.conf With this command, you can check the status.# systemctl status httpd.serviceYou can start a service with this command.# systemctl start httpd.serviceYou can restart a service with this command.# systemctl restart httpd.serviceYou can enable a service with this command.# systemctl enable httpd.serviceThe command netstat -nltup | grep httpd is used to filter the output of the netstat command to only display lines that contain the keyword “httpd”. This is useful for quickly checking if there are any processes associated with the Apache HTTP Server (httpd). The netstat -nltup part of the command lists all listening TCP and UDP ports along with their corresponding programs and process IDs, and the grep httpd part filters this output to only show lines containing “httpd”.# netstat -nltup

# netstat -nltup|grep httpd

Allowing the port associated with the httpd service in the firewall configuration file will enable the service to start.# vim /etc/sysconfig/iptables

-A INPUT -p tcp --dport 80 -j ACCEPT

:wq!

You can restart a service with this command.# systemctl restart iptables.serviceAfter restarting the httpd service, if you search the server’s IP address in the URL, you will be directed to the default index page of the http service.

Enter the server’s IP address in the URL search bar.

“This is the default index page of the Apache Web server.”
Read Entire Article