安装源码包Apache,源码包apache


##1:下载安装apache
此处我是在北理开源软件镜像服务下载 的,其实,有点好奇,这些镜像他们是这么维护的。
###1.1:下载

[root@hadb httpd]# wget http://mirror.bit.edu.cn/apache/httpd/httpd-2.4.29.tar.gz
--2018-02-03 00:15:27--  http://mirror.bit.edu.cn/apache/httpd/httpd-2.4.29.tar.gz
正在解析主机 mirror.bit.edu.cn... 114.247.56.117
正在连接 mirror.bit.edu.cn|114.247.56.117|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:8638793 (8.2M) [application/octet-stream]
正在保存至: “httpd-2.4.29.tar.gz”

100%[=============================================================>] 8,638,793   3.54M/s   in 2.3s    

2018-02-03 00:15:29 (3.54 MB/s) - 已保存 “httpd-2.4.29.tar.gz” [8638793/8638793])

[root@hadb httpd]# 
```sehll
###1.2:拷贝到另一台机器并编译安装

```sehll
[root@hadb httpd]# scp httpd-2.4.29.tar.gz root@hadc:/usr/mysoft/httpd/##使用scp把文件拷贝到另一台机器上面,此处配置了ssh免登陆
httpd-2.4.29.tar.gz                                                  100% 8436KB   8.2MB/s   00:00    
[root@hadb httpd]# 
##在另一台机器上面解压
[root@hadc httpd]# tar -zxvf httpd-2.4.29.tar.gz##解压
[root@hadc httpd-2.4.29]# ./configure --prefix=/usr/mysoft/httpd/work/##指定安装位置编译
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
configure: 
configure: Configuring Apache Portable Runtime library...
configure: 
checking for APR... no##提示APR错误
configure: error: APR not found.  Please read the documentation.
[root@hadc httpd-2.4.29]# 

###1.3:解决APR问题
涉及到的APR可以在http://apr.apache.org/download.cgi下载,此处我下载的是源码tar.gz格式

[root@hadc httpd-2.4.29]# wget http://mirror.bit.edu.cn/apache//apr/apr-1.6.3.tar.gz&& wget http://mirror.bit.edu.cn/apache//apr/apr-util-1.6.1.tar.gz&& wget http://mirror.bit.edu.cn/apache//apr/apr-iconv-1.2.2.tar.gz

####1.3.1:编译安装APR

解压进入目录
[root@hadc apr-1.6.3]# ./configure --prefix=/usr/local/apr
编译会报错,如下
config.status: executing libtool commands
rm: cannot remove `libtoolT': No such file or directory

编辑configure这个文件,将 $RM $cfgfile 那行注释掉 ,然后重新编译

编译通过安装

make &&make install
####1.3.2:编译安装apr-util
这里使用了上一步安装的apr (–with-apr)
这里我在编译安装时报错
yum install expat-devel -y

[root@hadc apr-util-1.6.1]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config

[root@hadc apr-util-1.6.1]# make&&make install

###1.4:安装apach

[root@hadc httpd-2.4.29]# ./configure --prefix=/usr/mysoft/httpd/work \
> --with-apt=/usr/local/apr/ \
> --with-apr-util=/usr/local/apr-util

make &&make install

./configure --prefix=/usr/local/apache2/
–sysconfdir=/usr/local/apache2/etc/ --with-included-apr --enable-dav
–enable-so --enable-deflate=shared --enable-expires=shared
–enable-rewrite=shared

##2:scp拷贝


从远程拷贝到本机
scp user@host:/文件 本机路劲 (拷贝文件)
scp -r user@host:/目录 本机目录 (拷贝文件夹)


从本机上传至远程
scp 文件 user@host:/路径(上传文件)
scp -r 目录 user@host:/目录 (上传文件夹)

###参考
http://www.mamicode.com/info-detail-1911203.html
http://blog.51cto.com/xtony/836508

相关内容

    暂无相关文章