编译安装软件

编译安装httpd软件
1先配置yum源
准备工作:把所有yum源改成本地光盘
[root@centos7 etc]#find *yum*(查找yum配置目录)
1.[root@centos6 ~]#df
.[root@centos6 ~]#cd /misc/cd/ (神奇文件自动挂载)光盘
[root@centos7 yum.repos.d]#ls(说明还没配置好)
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo先去配置
[root@centos6 yum.repos.d]#yum repolist(测试yum配置是否成功)
Loaded plugins: fastestmirror, refresh-packagekit, security
Determining fastest mirrors
base | 4.0 kB 00:00 …
base/primary_db | 4.7 MB 00:00 …
repo id repo name status
base base 6,706
repolist: 6,706
2.安装包组
#yum grouplist “Development Tools”
3.找源码(官网)安装httpd
解压#tar xvf httpd-2.2.34
[root@centos6 ~]#cd httpd-2.2.34
[root@centos6 httpd-2.2.34]#ls 进入目录查看重要文件
ABOUT_APACHE CHANGES httpd.dsp libhttpd.dep NOTICE server
acinclude.m4 config.layout httpd.mak libhttpd.dsp NWGNUmakefile srclib
Apache.dsw configure httpd.spec libhttpd.mak os support
build configure.in include LICENSE README test
BuildAll.dsp docs INSTALL Makefile.in README.platforms VERSIONING
BuildBin.dsp emacs-style InstallBin.dsp Makefile.win README-win32.txt
buildconf httpd.dep LAYOUT modules ROADMAP
4.编译./configure文件
[root@centos6 src]#./configure \
> –prefix=/root/app \(必须要改的)
> –sysconfdir=/etc/httpd22 \(把这个文件独立出来)
> –enable-ssl
checking openssl/opensslv.h presence… no
checking for openssl/opensslv.h… no
checking openssl/ssl.h usability… no
checking openssl/ssl.h presence… no
checking for openssl/ssl.h… no(报错提示缺少openssl开发包组)
所以去安装openssl
[root@centos6 src]#yum list *openssl*
Loaded plugins: fastestmirror, refresh-packagekit, security
 
openssl.i686 1.0.1e-57.el6 base
openssl-devel.i686 1.0.1e-57.el6 base
openssl-devel.x86_64 1.0.1e-57.el6 base (和编译相关大部份都要是devel包)
[root@centos6 src]#yum install openssl-devel把开发包组装上
[root@centos6 src]#chec./configure \(然后再跑一次,看看还少什
它缺啥就装啥
> –prefix=/root/app \
> –sysconfdir=/etc/httpd22 \
> –enable-ssl
[root@centos6 src]#echo $?
0 (说明前面命令没问题了)
5.make 编译(去设置cpu加为4个)
执行完毕声音提示
[root@centos6 src]#make -j 4 && echo -e “\a” && sleep 1&& echo -e “\a” && sleep 1&& echo -e “\a” && sleep 1&& echo -e “\a” && sleep 1&& echo -e “\a” && sleep 1sleep 1&& echo -e “\a”
ok软件已经装好
最后看看效果,让它跑起来,自己的机上有没有web服务,如果不能访问,打开安装程序文档INSTALL
[root@centos6 httpd-2.2.34]#cat INSTALL
http://httpd.apache.org/docs/2.2/install.html
$ ./configure –prefix=PREFIX
$ make
$ make install
$ PREFIX/bin/apachectl start(最后一步意思要运行/bin下的apachectl start程序运行起来)所以把/bin这个文件夹放到PATH变量里,以后就可以不用再重复写了,
开始改PATH变量
[root@centos6 src]#vi /etc/profile.d/env.sh(随便一个文件名)
1 PS1=”\[\e[1;35m\][\u@\h \W]\\$\[\e[0m\]”
2 PATH=/usr/local/apache2/bin:$PATH(把当前/bin的绝对路径加进去)
[root@centos6 src]#. /etc/profile.d/env.sh(生效)
[root@centos6 src]#echo $PATH(看改的咱样)
/usr/local/apache2/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
[root@centos6 src]#apachectl start(启动程序)
ok!!!!!!
更改网页内容,让它更漂亮点
[root@centos6 apache2]#ls
bin build cgi-bin conf error htdocs icons include lib logs man manual modules
[root@centos6 apache2]#cd htdocs(这个是放网页文件的文件夹)
[root@centos6 htdocs]#ls
index.html(网页文件内容的文件)
[root@centos6 htdocs]#cat index.html
<html><body><h1>It works!</h1></body></html>[root@centos6 htdocs]#^C
[root@centos6 htdocs]#vim index.html
1 <html><body><h1>well come to my space—</h1></body></

本文来自投稿,不代表Linux运维部落立场,如若转载,请注明出处:http://www.178linux.com/96802

(0)
上一篇 2018-04-22 16:45
下一篇 2018-04-22 17:15

相关推荐

  • 第七周 Linux系统启动流程,kickstart光盘镜像制作

    一、Linux系统启动流程 Linux启动流程可以分为五个阶段: 1、BIOS加电自检 机器启动后,首先会进行固件(BIOS)的自检,然后把保存在MBR(主引导记录)中的主引导加载程序放到内存中; 2、加载主引导加载程序(MBR) 主引导加载程序通过分区表查找活动分区,然后将活动分区的次引导加载程序从设备读入内存中运行; 3、加载次引导加载程序(GRUB) …

    2018-07-27
  • 权限和正则表达式

    实操为主
    week4

    Linux笔记 2018-07-15
  • Nginx认证模块与状态监测模块使用示例

    Nginx认证模块与状态监测模块使用示例 一、环境准备 1. 软件版本 CentOS7.4 httpd-tools.x86_64        2.4.6-67.el7.centos.6 nginx.x86_64                  1:1.12.2-2.el7 2. 软件安装 nginx的安装需要epel源,没有配置epel可以直接yum安装…

    2018-06-29
  • 实现创建私有CA

    CA的构成:PKI: Public Key Infrastructure签证机构:CA(Certificate Authority)注册机构:RA证书吊销列表:CRL证书存取库:X.509:定义了证书的结构以及认证协议标准版本号序列号签名算法颁发者有效期限主体名称主体公钥CRL分发点扩展信息发行者签名证书类型:证书授权机构的证书服务器用户证书获取证书两种方法…

    Linux笔记 2018-05-22
  • 喜欢上find

    喜欢上findfind :查找目录下的文件。find 命令其实很好记,会用了,那简直太好玩太方便了-newer查找更改时间比指定文件新的文件-type 按类型查找 (d f l s b c p )D-name 按文件名查找-mtime 按修改时间查找( +2 -2 2)-size 按文件大小查找-perm 按文件权限查找-user 按文件属主来查找-nous…

    2018-04-18
  • Linux文件管理总结和文件元数据

    Linux文件系统;目录结构;bash特性;文件的元数据

    2018-07-09