编译安装httpd

               1 将 httpd-2.4.25.tar.bz2下载 到  centos7的 /app目录下

                [root@localhost app]# ls
                httpd-2.4.25.tar.bz2

              2 将该文件解压

              [root@localhost app]# tar -xvf httpd-2.4.25.tar.bz2 

              [root@localhost app]# ls

              httpd-2.4.25  httpd-2.4.25.tar.bz2

              3 安装开发包组

             [root@localhost httpd-2.4.25]# cd /app/httpd-2.4.25
             [root@localhost httpd-2.4.25]# yum groupinstall “Development tools”

             4 

              [root@localhost httpd-2.4.25]# ./configure –prefix=/app/httpd –sysconfdir=/etc/httpd/

            5 报错, 根据提示还得装下面这些包

              yum install apr-devel
             yum install apr-util-devel
             yum install pcre-devel

             6

            make 

             7

           make install
            8
         [root@localhost bin]# cd /app/httpd/bin

            9  开启服务器并启动端口

           [root@localhost bin]# apachectl start

          [root@localhost bin]# netstat -tnl

         Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN     
tcp        0      0 192.168.122.1:53        0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:6010          0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:6011          0.0.0.0:*               LISTEN     
tcp6       0      0 :::111                  :::*                    LISTEN     
tcp6       0      0 :::80                   :::*                    LISTEN     
tcp6       0      0 :::21                   :::*                    LISTEN     
tcp6       0      0 :::22                   :::*                    LISTEN     
tcp6       0      0 ::1:631                 :::*                    LISTEN     
tcp6       0      0 ::1:25                  :::*                    LISTEN     
tcp6       0      0 ::1:6010                :::*                    LISTEN     
tcp6       0      0 ::1:6011                :::*                    LISTEN     

           10  查看本机IP地址

    [root@localhost bin]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.130  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::f36e:9e00:5218:4cbb  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:1c:1c:10  txqueuelen 1000  (Ethernet)
        RX packets 39129  bytes 44634625 (42.5 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 13242  bytes 2208017 (2.1 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 28  bytes 2408 (2.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 28  bytes 2408 (2.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:a0:c6:47  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

            

        11  在浏览器中输入 http://192.168.1.130/          就可以看到 IT,s work 页面

        

         12 如果 想不在 /app/httpd/bin 目录下就可以启动http服务器则需要 在/etc/profile.d/httpd.sh 文件中加入一行 PATH=$PATH:/app/httpd/bin

         [root@localhost ~]# cd /etc/profile.d/

         [root@localhost profile.d]# vim httpd.sh 

      #! /bin/bash

      PATH=$PATH:/app/httpd/bin


        [root@localhost profile.d]# cd /root
        [root@localhost ~]# apachectl start

        [root@localhost ~]# netstat -tnl

       Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN     
tcp        0      0 192.168.122.1:53        0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:6010          0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:6011          0.0.0.0:*               LISTEN     
tcp6       0      0 :::111                  :::*                    LISTEN     
tcp6       0      0 :::80                   :::*                    LISTEN     
tcp6       0      0 :::21                   :::*                    LISTEN     
tcp6       0      0 :::22                   :::*                    LISTEN     
tcp6       0      0 ::1:631                 :::*                    LISTEN     
tcp6       0      0 ::1:25                  :::*                    LISTEN     
tcp6       0      0 ::1:6010                :::*                    LISTEN     

tcp6       0      0 ::1:6011                :::*                    LISTEN     

        

          

原创文章,作者:fsy,如若转载,请注明出处:http://www.178linux.com/74118

(0)
fsyfsy
上一篇 2017-04-24 21:23
下一篇 2017-04-24 21:35

相关推荐

  • test

    test the URL.

    Linux干货 2016-12-03
  • KeepAlived高可用集群详解及拓扑实验搭建配置

    Linux Cluster:KeepAlive 1.集群类型:LB(负载均衡集群),HA(高可用集群),HP(高性能集群)     LB:均衡负载的实现LVS     HA:高可用的实现KeepAlived 2.RS:健康状态检测方式: (1)网络层:icmp ping (2)传…

    Linux干货 2016-11-01
  • Linux基础-用户管理相关操作-week 4

    1.复制/etc/skel 目录为/home/tuser1,要求/home/tuser1及其内部文件的属组和其他用户均没有任何访问权限  cp /etc/skel /home/tuser1 -rf chmod og=  /home/tuser1 -R 2.编辑/etc/group文件添加组hadoop echo hadoop:x:503 …

    Linux干货 2016-11-21
  • OpenSSL:实现创建私有CA、签署证书请求详解

    一、OpenSSL:CA默认配置信息     1.证书签发机构CA:公共信任CA、私有CA                建立私有CA方式如下: 小范围测试使用openssl、 大…

    Linux干货 2016-04-30
  • mysql数据库及表的管理

    MySQL中字符大小写: 1、SQL关键字及函数名不区分字符大小写; 2、数据库、表及视图名称的大小区分与否取决于低层OS及FS 3、存储过程、存储函数及事件调度器的名字不区分大小写,但触发器区分; 4、表别名区分大不写; 5、对字段中的数据,如果字段类型为Binary类型,则区分大小写;非Binary不区分大小写; 数据库: CREATE {DATABAS…

    Linux干货 2015-06-01
  • 第四周

    查看链接:http://note.youdao.com/noteshare?id=317ec635a5f28f2681421fd7c9a60f27

    Linux干货 2016-09-19

评论列表(1条)

  • renjin
    renjin 2017-04-28 11:32

    对编译安装httpd进行了流程式的介绍,内容总结的很详细,需要注意排版。把执行的代码放入到”插入程序代码”中去