!!编译安装步骤详解,httpd安装实例及7个依赖包!!

编译安装httped

    • 1、下载编译安装包文件
    • 2、利用md5sum命令验证文件完整性
    • 3、然后挂载cdrom
    • 4、安装依赖性文件包
      • [root@localhost ~]# rpm -ivh /mnt/Packages/pcre-devel-8.32-17.el7.x86_64.rpm
      • [root@localhost ~]# rpm -ivh /mnt/Packages/apr-devel-1.4.8-3.el7.x86_64.rpm
      • [root@localhost ~]# rpm -ivh /mnt/Packages/expat-devel-2.1.0-10.el7_3.x86_64.rpm
      • [root@localhost ~]# rpm -ivh /mnt/Packages/libdb-devel-5.3.21-20.el7.x86_64.rpm
      • [root@localhost ~]# rpm -ivh /mnt/Packages/cyrus-sasl-devel-2.1.26-21.el7.x86_64.rpm
      • [root@localhost ~]# rpm -ivh /mnt/Packages/openldap-devel-2.4.44-5.el7.x86_64.rpm
      • [root@localhost ~]# rpm -ivh /mnt/Packages/apr-util-devel-1.5.2-6.el7.x86_64.rpm
    • 5、解压编辑安装软件包
    • 6、进入到/opt/httpd-2.4.25目录,将编辑安装的软件安装到/usr/local/apache/目录里
    • 7、进行翻译
    • 8、翻译后安装
    • 9、用vi编辑器对配置文件进行修改,将194行首的#号删去,启用80端口
    • 10、启动Apache

1、下载编译安装包文件

2、利用md5sum命令验证文件完整性

[root@localhost ~]# md5sum httpd-2.4.25
d41d8cd98f00b204e9800998ecf8427e httpd-2.4.25

3、然后挂载cdrom

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

4、安装依赖性文件包

[root@localhost ~]# rpm -ivh /mnt/Packages/pcre-devel-8.32-17.el7.x86_64.rpm

Preparing… ################################# [100%]
Updating / installing…
1:pcre-devel-8.32-17.el7 ################################# [100%]

[root@localhost ~]# rpm -ivh /mnt/Packages/apr-devel-1.4.8-3.el7.x86_64.rpm

Preparing… ################################# [100%]
Updating / installing…
1:apr-devel-1.4.8-3.el7 ################################# [100%]

[root@localhost ~]# rpm -ivh /mnt/Packages/expat-devel-2.1.0-10.el7_3.x86_64.rpm

Preparing… ################################# [100%]
Updating / installing…
1:expat-devel-2.1.0-10.el7_3 ################################# [100%]

[root@localhost ~]# rpm -ivh /mnt/Packages/libdb-devel-5.3.21-20.el7.x86_64.rpm

Preparing… ################################# [100%]
Updating / installing…
1:libdb-devel-5.3.21-20.el7 ################################# [100%]

[root@localhost ~]# rpm -ivh /mnt/Packages/cyrus-sasl-devel-2.1.26-21.el7.x86_64.rpm

Preparing… ################################# [100%]
Updating / installing…
1:cyrus-sasl-devel-2.1.26-21.el7 ################################# [100%]

[root@localhost ~]# rpm -ivh /mnt/Packages/openldap-devel-2.4.44-5.el7.x86_64.rpm

Preparing… ################################# [100%]
Updating / installing…
1:openldap-devel-2.4.44-5.el7 ################################# [100%]

[root@localhost ~]# rpm -ivh /mnt/Packages/apr-util-devel-1.5.2-6.el7.x86_64.rpm

Preparing… ################################# [100%]
Updating / installing…
1:apr-util-devel-1.5.2-6.el7 ################################# [100%]

5、解压编辑安装软件包

[root@localhost ~]# tar zxvf httpd-2.4.25 -C /opt

6、进入到/opt/httpd-2.4.25目录,将编辑安装的软件安装到/usr/local/apache/目录里

[root@localhost ~]# cd /opt/httpd-2.4.25
[root@localhost httpd-2.4.25]#
[root@localhost httpd-2.4.25]# ./configure --prefix=/usr/local/apache

7、进行翻译

[root@localhost httpd-2.4.25]# make

8、翻译后安装

[root@localhost httpd-2.4.25]# make install

9、用vi编辑器对配置文件进行修改,将194行首的#号删去,启用80端口

[root@localhost ~]# vi /usr/local/apache/conf/httpd.conf
编辑时可以在末行模式输入:set number 显示行数
在末行模式输入行号 :194 直接跳到对应行
!!编译安装步骤详解,httpd安装实例及7个依赖包!!_第1张图片
!!编译安装步骤详解,httpd安装实例及7个依赖包!!_第2张图片

10、启动Apache

[root@localhost ~]# cd /usr/local/apache/bin
[root@localhost bin]# ./apachectl start
httpd (pid 70743) already running

你可能感兴趣的:(linux)