Linux 通过源代码安装和编译程序

Linux源代码安装在平常工作学习中经常用到,总结下步骤↓↓↓

 

第一步:#mount /dev/cdrom/mnt (挂载一个软盘)

第二步:手动安装httpd-2.4.25.tar.gz 依赖关系包

下面为HTTP的依赖关系包

root@localhost httpd-2.4.25]#rpm -ivh /mnt/Packages/pcre-devel-8.32-17.e17.x86_64.rpm

root@localhost httpd-2.4.25]#rpm -ivh /mnt/Packages/apr-devel-1.4.8-e17_4.1.x86_64.rpm

root@localhost httpd-2.4.25]#rpm -ivh /mnt/Packages/expat-devel-2.1.0-10.e17_3.x86_64.rpm

root@localhost httpd-2.4.25]#rpm -ivh /mnt/Packages/libdb-devel-5.3.21-24.e17.x86-64.rpm

root@localhost httpd-2.4.25]#rpm -ivh /mnt/Packages/cyrus-sasl-devel-2.1.26-23.e17.x86_64.rpm

root@localhost httpd-2.4.25]#rpm -ivh /mnt/Packages/openldap-devel-2.4.44-13.e17.x86_64.rpm

root@localhost httpd-2.4.25]#rpm -ivh /mnt/Packages/apr-util-devel-1.5.2-6.e17.x86_64.rpm

第三步:上传http-2.4.25.tar.gz软件包到/opt目录下

root@localhost ~]#cd /opt     进入目录

root@localhost opt]#md5sum httpd-2.4.25.tar.gz   验证包的完整性

  24fb8b9e36cf13d78caae864ea0f6a  httpd-2.4.25.tar.gz

root@localhost opt]#tar zxvf httpd-2.4.25.tar.gz -C /opt   解压压缩包

root@localhost opt]#cd /httpd-2.4.25/          进入目录

root@localhost httpd-2.4.25]#./configure--prefix=/usr/local/apache    ./configure配置

root@localhost httpd-2.4.25]#make

root@localhost httpd-2.4.25]#make install

root@localhost httpd-2.4.25]#cd /usr/local/apache/bin/           进入目录


root@localhost bin]#vi /usr/localapache/conf/httpd.conf   添加安装的路径

root@localhost bin]#./apachectl start

root@localhost bin]#netstat anutp |grep 80  查看进程

root@localhost bin]#yum -y install lynx      安装客户端的浏览工具

root@localhost bin]#lynx 127.0.0.1

It works

这样就安装好了

posted @ 2020-07-14 19:39  不是冷漠  阅读(481)  评论(0编辑  收藏  举报