CentOS7系统搭建LAMP及更新PHP版本操作详解

本文实例讲述了CentOS7系统搭建LAMP及更新PHP版本操作。分享给大家供大家参考,具体如下:

搭建LAMP环境 用yum安装

安装Apache
  1. 安装Apache
[root@localhost /]# yum install httpd httpd-devel
  1. 启动Apache
[root@localhost /]# systemctl start httpd
  1. 设置Apache开机启动
[root@localhost /]# systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
  1. 查看Apache状态
[root@localhost /]# systemctl status httpd
● httpd.service - The Apache HTTP Server
  Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
  Active: active (running) since 五 2017-07-21 17:21:37 CST; 6min ago
   Docs: man:httpd(8)
      man:apachectl(8)
 Main PID: 2449 (httpd)
  Status: "Total requests: 11; Current requests/sec: 0; Current traffic:  0 B/sec"
  CGroup: /system.slice/httpd.service
      ├─2449 /usr/sbin/httpd -DFOREGROUND
      ├─2450 /usr/sbin/httpd -DFOREGROUND
      ├─2451 /usr/sbin/httpd -DFOREGROUND
      ├─2452 /usr/sbin/httpd -DFOREGROUND
      ├─2453 /usr/sbin/httpd -DFOREGROUND
      ├─2454 /usr/sbin/httpd -DFOREGROUND
      ├─2493 /usr/sbin/httpd -DFOREGROUND
      ├─2494 /usr/sbin/httpd -DFOREGROUND
      └─2495 /usr/sbin/httpd -DFOREGROUND

7月 21 17:21:35 nmserver-7.test.com systemd[1]: Starting The Apache HTTP Server...
7月 21 17:21:36 nmserver-7.test.com httpd[2449]: AH00558: httpd: Could not reliably determine the server's fully q...ssage
7月 21 17:21:37 nmserver-7.test.com systemd[1]: Started The Apache HTTP Server.
Hint: Some lines were ellipsized, use -l to show in full.

  1. 防火墙开启80端口, 依此执行以下命令
[root@localhost /]# firewall-cmd --permanent --zone=public --add-service=http
success
[root@localhost /]# firewall-cmd --permanent --zone=public --add-service=https
success
[root@localhost /]# firewall-cmd --reload
success
  1. 查看80端口监听状态
[root@localhost /]# netstat -tulp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address      Foreign Address     State    PID/Program name  
tcp    0   0 0.0.0.0:ssh       0.0.0.0:*        LISTEN   1084/sshd      
tcp    0   0 localhost:smtp     0.0.0.0:*        LISTEN   1486/master     
tcp6    0   0 [::]:ssh        [::]:*         LISTEN   1084/sshd      
tcp6    0   0 localhost:smtp     [::]:*         LISTEN   1486/master     
tcp6    0   0 [::]:http        [::]:*         LISTEN   2449/httpd     
udp    0   0 localhost:323      0.0.0.0:*              592/chronyd     
udp6    0   0 localhost:323      [::]:*               592/chronyd 

      

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/1850.html