AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 850316
Accepted
mahmood
mahmood
Asked: 2017-05-16 21:17:07 +0800 CST2017-05-16 21:17:07 +0800 CST 2017-05-16 21:17:07 +0800 CST

网络服务器无法访问

  • 772

在 centos-7 上,我已经安装了 Web 服务器,但我无法通过 Web 浏览器看到测试页面。

# 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'

有更多调试的想法吗?

web-server
  • 1 1 个回答
  • 1701 Views

1 个回答

  • Voted
  1. Best Answer
    minish
    2017-05-16T22:57:53+08:002017-05-16T22:57:53+08:00
    1. 检查防火墙(firewalld)可以允许您要在活动区域​​中使用的端口#

    sudo firewall-cmd --get-active-zones 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

相关问题

  • 提供 70,000 个静态文件 (jpg) 的最佳方式?

  • 持续监控许多服务器运行状况的简单方法?

  • 构建家庭服务器时要考虑的要点[关闭]

  • 用于 Web 应用服务器的 FreeBSD 磁盘分区(Apache/MySQL/PHP)

  • 我需要在 Rackspace 专用/托管网络和数据库 (Linux) 服务器上安装防病毒软件吗?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve