实验二:源码包的安装
实验目标:
源码包的安装
1. 安装gcc(yum –y install gcc*)
[root@localhost~]# yum -y install gcc*
Loaded plugins:product-id, security, subscription-manager
This system isnot registered to Red Hat Subscription Management. You can use subscription-managerto register.
Setting upInstall Process
Packagegcc-4.1.2-54.el5.x86_64 already installed and latest version
Packagegcc44-gfortran-4.4.7-1.el5.x86_64 already installed and latest version
Packagegcc-objc-4.1.2-54.el5.x86_64 already installed and latest version
Packagegcc44-c++-4.4.7-1.el5.x86_64 already installed and latest version
Packagegcc-gfortran-4.1.2-54.el5.x86_64 already installed and latest version
2. 解压源码包
[root@localhostusr]# cd src
[root@localhostsrc]# cp /root/Desktop/httpd-2.2.25.tar.gz /usr/src/
[root@localhostsrc]# ls
debug httpd-2.2.25.tar.gz kernels vmware-tools-distrib
[root@localhostsrc]# tar -zxf httpd-2.2.25.tar.gz
[root@localhostsrc]# ls
debug httpd-2.2.25 httpd-2.2.25.tar.gz kernels vmware-tools-distr
3. 配置
[root@localhostsrc]# cd httpd-2.2.25
[root@localhosthttpd-2.2.25]# ./configure prefix=/usr/local/apache2/
configure:creating ./config.status
creatingmodules/aaa/Makefile
creatingmodules/arch/win32/Makefile
creatingmodules/cache/Makefile
creatingmodules/database/Makefile
creatingmodules/debug/Makefile
creatingmodules/echo/Makefile
creatingmodules/experimental/Makefile
4. 编译:
[root@localhosthttpd-2.2.25]# make
_alias.lamodules/mappers/libmod_so.la server/mpm/prefork/libprefork.la os/unix/libos.la-lm /usr/src/httpd-2.2.25/srclib/pcre/libpcre.la/usr/src/httpd-2.2.25/srclib/apr-util/libaprutil-1.la/usr/src/httpd-2.2.25/srclib/apr-util/xml/expat/libexpat.la/usr/src/httpd-2.2.25/srclib/apr/libapr-1.la -lrt -lcrypt -lpthread -ldl
5. 安装:
[root@localhosthttpd-2.2.25]# make install
Installingheader files
Installing buildsystem files
Installing manpages and online manual
make[1]: Leavingdirectory `/usr/src/httpd-2.2.25'
6. 开启服务:
[root@localhosthttpd-2.2.25]# /usr/local/apache2/bin/apachectl start
结果验证
测试:ping主机ip地址
It works!
问题和经验总结
故障现象:./configure 未搭建
解决办法:安装gcc
故障现象:测试不通
解决办法:1、服务没开启,开启服务:/usr/local/apache2/bin/apachectl start
2、 源码包没安装成功,得重新安装