Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Solutions to the problems occurred in the installation of apache and installation process of Centos7.4 Server

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article describes the Centos 7.4 server installation apache and installation process problems. Share it for your reference, as follows:

I. Install httpd

1. Before installation, check whether there is an installed httpd.rpm package in the system. If there is no httpd. rpm package, delete the rpm package name corresponding to rpm -e.

#rpm -qa | grep httpd

2. Use yum installation (automatic installation of dependency packages), simple and convenient

#yum -y install httpd

3. After successful installation, httpd-v check the installed apache version and find the apache configuration file location

#find / -name "httpd.conf"

4. Backup a copy of the source configuration file found to prevent unrecoverable errors

#cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.bak

5. Start Apache Services

#systemctl start httpd.service

6. Start Apache automatically

#systemctl enable httpd.service startup self-startup httpd#systemctl disable httpd.service startup does not start httpd

7. Check the status of httpd

#systemctl status httpd.service

II. Problems in the installation process

1. Apache failed to start, Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details

Execute the command to view the error prompt

#systemctl status httpd.service[root@cloud1 bin]# systemctl status httpd.service httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled) Active: failed (Result: exit-code) since May 2018-11-26 11:13:09 CST; 6min ago Docs: man:httpd(8) man:apachectl(8) Process: 9915 ExecStop=/bin/kill -WINCH ${MAINPID}(code=exited, status=1/FAILURE) Process: 9913 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE) Main PID: 9913 (code=exited, status=1/FAILURE) Nov 26 11:13:09 cloud1.localdomain httpd[9913]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]: 8011 Mar 26 11:13:09 cloud1.localdomain httpd[9913]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0: 8011 Mar 26 11:13:09 cloud1.localdomain httpd[9913]: no listening sockets, shutting down Nov 26 11:13:09 cloud1.localdomain httpd[9913]: AH00015: Unable to open logsNov 26 11:13:09 cloud1.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURENovember 26 11:13:09 cloud1.localdomain kill[9915]: kill: cannot find process "November 26 11:13:09 cloud1.localdomain systemd[1]: httpd.service: control process exited, code=exited status= November 26 11:13:09 cloud1.localdomain systemd[1]: Failed to start The Apache HTTP Server. November 26 11:13:09 cloud1.localdomain systemd[1]: Unit httpd.service entered failed state. November 26 11:13:09 cloud1.localdomain systemd[1]: httpd.service failed.

The problem is that port 80 is occupied.

Solution:

View usage of port 80

① .netstat -lnp|grep 80

tcp 0 0 192.168.180.68:61027 0.0.0.0:* LISTEN 6289/oproxyd

tcp 0 0 :::80 :::* LISTEN 846/httpd

tcp 0 0 ::ffff:192.168.180.68:7001 :::* LISTEN 32015/java

Kill processes occupying port 80

② .kill -9 846

③ . If the first two methods do not work, restart and then start the httpd service.

httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName

① . Enter the apache configuration file

vi /etc/httpd/conf/httpd.conf

② ./ ServerName Find ServerName

#ServerName www.example.com:80

Remove the #before it.

:wq Save and exit

③ . restart the service

systemctl restart httpd.service

I hope this article is helpful for CentOS server configuration.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report