rpm install httpd


挂载光驱

[root@localhost ~]# mount /dev/cdrom /mnt
mount: /dev/sr0 is write-protected, mounting read-only

rpm安装httpd以及依赖包

[root@localhost ~]# cd /mnt/Packages/
[root@localhost Packages]# rpm -ivh mailcap-2.1.41-2.el7.noarch.rpm 
warning: mailcap-2.1.41-2.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:mailcap-2.1.41-2.el7             ################################# [100%]
[root@localhost Packages]# rpm -ivh httpd-tools-2.4.6-40.el7.centos.x86_64.rpm 
warning: httpd-tools-2.4.6-40.el7.centos.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:httpd-tools-2.4.6-40.el7.centos  ################################# [100%]
[root@localhost Packages]# rpm -ivh httpd-
httpd-2.4.6-40.el7.centos.x86_64.rpm         httpd-manual-2.4.6-40.el7.centos.noarch.rpm  
httpd-devel-2.4.6-40.el7.centos.x86_64.rpm   httpd-tools-2.4.6-40.el7.centos.x86_64.rpm   
[root@localhost Packages]# rpm -ivh httpd-2.4.6-40.el7.centos.x86_64.rpm 
warning: httpd-2.4.6-40.el7.centos.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:httpd-2.4.6-40.el7.centos        ################################# [100%]

启动httpd

[root@localhost Packages]# systemctl start httpd.service

查看httpd的信息

[root@localhost Packages]# systemctl status httpd.service 
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
   Active: active (running) since Fri 2016-07-08 22:29:28 CST; 9s ago
     Docs: man:httpd(8)
           man:apachectl(8)
 Main PID: 13427 (httpd)
   Status: "Total requests: 0; Current requests/sec: 0; Current traffic:   0 B/sec"
   CGroup: /system.slice/httpd.service
           ├─13427 /usr/sbin/httpd -DFOREGROUND
           ├─13428 /usr/sbin/httpd -DFOREGROUND
           ├─13429 /usr/sbin/httpd -DFOREGROUND
           ├─13430 /usr/sbin/httpd -DFOREGROUND
           ├─13431 /usr/sbin/httpd -DFOREGROUND
           └─13432 /usr/sbin/httpd -DFOREGROUND

Jul 08 22:29:28 localhost systemd[1]: Starting The Apache HTTP Server...
Jul 08 22:29:28 localhost httpd[13427]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using ::1. ... message
Jul 08 22:29:28 localhost systemd[1]: Started The Apache HTTP Server.
Hint: Some lines were ellipsized, use -l to show in full.

设置selinux

[root@localhost Packages]# setenforce 0

添加服务http

[root@localhost Packages]# firewall-c
firewall-cmd     firewall-config  
[root@localhost Packages]# firewall-cmd --add-service=http
success

停止并查看httpd

[root@localhost Packages]# systemctl stop httpd.service 
[root@localhost Packages]# systemctl status httpd.service 
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: man:httpd(8)
           man:apachectl(8)

Jul 08 22:29:28 localhost systemd[1]: Starting The Apache HTTP Server...
Jul 08 22:29:28 localhost httpd[13427]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using ::1. ... message
Jul 08 22:29:28 localhost systemd[1]: Started The Apache HTTP Server.
Jul 08 22:30:52 localhost systemd[1]: Stopping The Apache HTTP Server...
Jul 08 22:30:53 localhost systemd[1]: Stopped The Apache HTTP Server.
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost Packages]#

测试


results matching ""

    No results matching ""