веб-сервер недоступен

На centos-7 я установил веб-сервер, но я не вижу тестовую страницу через веб-браузер.

# yum list httpd*
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.mirror.iphh.net
 * epel: mirror.imt-systems.com
 * extras: mirror.wiuwiu.de
 * updates: mirror.daniel-jost.net
Installed Packages
httpd.x86_64                                                2.4.6-45.el7.centos.4                                        @updates
httpd-manual.noarch                                       2.4.6-45.el7.centos.4                                        @updates
httpd-tools.x86_64                                        2.4.6-45.el7.centos.4                                        @updates
Available Packages
httpd-devel.x86_64                                        2.4.6-45.el7.centos.4                                        updates 
httpd-itk.x86_64                                          2.4.7.04-1.el7                                               epel    
# ls /etc/init.d/
functions  iprdump  iprinit  iprupdate  netconsole  network  README
# ps aux | grep httpd
root     28879  0.0  0.8 240340  8340 ?        Ss   01:03   0:00  /usr/sbin/httpd -DFOREGROUND
apache   28880  0.0  0.3 242352  3432 ?        S    01:03   0:00 /usr/sbin/httpd -DFOREGROUND
apache   28881  0.0  0.3 242424  3700 ?        S    01:03   0:00 /usr/sbin/httpd -DFOREGROUND
apache   28882  0.0  0.3 242424  3700 ?        S    01:03   0:00 /usr/sbin/httpd -DFOREGROUND
apache   28883  0.0  0.3 242424  3700 ?        S    01:03   0:00 /usr/sbin/httpd -DFOREGROUND
apache   28884  0.0  0.3 242424  3700 ?        S    01:03   0:00 /usr/sbin/httpd -DFOREGROUND
apache   28885  0.0  0.3 242424  3700 ?        S    01:03   0:00 /usr/sbin/httpd -DFOREGROUND
root     29076  0.0  0.0 112640   972 pts/0    S+   01:09   0:00 grep --color=auto httpd
# ps aux | grep apache
apache   28880  0.0  0.3 242352  3432 ?        S    01:03   0:00 /usr/sbin/httpd -DFOREGROUND
apache   28881  0.0  0.3 242424  3700 ?        S    01:03   0:00 /usr/sbin/httpd -DFOREGROUND
apache   28882  0.0  0.3 242424  3700 ?        S    01:03   0:00 /usr/sbin/httpd -DFOREGROUND
apache   28883  0.0  0.3 242424  3700 ?        S    01:03   0:00 /usr/sbin/httpd -DFOREGROUND
apache   28884  0.0  0.3 242424  3700 ?        S    01:03   0:00 /usr/sbin/httpd -DFOREGROUND
apache   28885  0.0  0.3 242424  3700 ?        S    01:03   0:00 /usr/sbin/httpd -DFOREGROUND
root     29078  0.0  0.0 112640   980 pts/0    S+   01:09   0:00 grep --color=auto apache

Просматривая журналы, я вижу

 # cat /var/log/httpd/access_log 
 # cat /var/log/httpd/error_log 
 [Tue May 16 01:03:35.055960 2017] [core:notice] [pid 28879] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
 [Tue May 16 01:03:35.057776 2017] [suexec:notice] [pid 28879] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
 AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message
 [Tue May 16 01:03:35.073921 2017] [auth_digest:notice] [pid 28879] AH01757: generating secret for digest authentication ...
 [Tue May 16 01:03:35.074540 2017] [lbmethod_heartbeat:notice] [pid 28879] AH02282: No slotmem from mod_heartmonitor
 [Tue May 16 01:03:35.101221 2017] [mpm_prefork:notice] [pid 28879] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips mod_fcgid/2.3.9 configured -- resuming normal operations
 [Tue May 16 01:03:35.101259 2017] [core:notice] [pid 28879] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'

Любой идея для дополнительной отладки?

2
задан 16 May 2017 в 08:17
1 ответ
  1. Убедитесь, что брандмауэр (firewalld) может разрешить порт №, который вы хотите использовать в активной зоне

sudo firewall-cmd --get-active-zone sudo firewall-cmd --zone = your_zone --add-port = 80 / tcp --permanent sudo firewall-cmd --reload

Вот хороший пример: https://stackoverflow.com/questions/24729024/centos-7-open-firewall-port

И для дополнительной конфигурации firewalld: https://fedoraproject.org/wiki/Firewalld?rd=FirewallD#Predefined_services

  1. Подтвердите, что selinux разрешает порт №, который вы хотите использовать (обычно 80 / tcp)

проверьте: senamage port -l

изменить: senamage port -a -t http_port_t -p tcp 80

Вы можете изменить больше портов.

https://wiki.centos.org/HowTos/SELinux#head-ad837f60830442ae77a81aedd10c20305a811388

3
ответ дан 3 December 2019 в 10:35

Теги

Похожие вопросы