因环境限制不能访问外网,在ubuntu14上安装ambari,所以采用离线方式搭建,特此记录
安装httpd服务(httpd依赖apr、apr-util、prce三个服务)
- 解压4个文件
tar -xzvf apr-1.6.3.tar.gz
tar -xzvf apr-util-1.6.1.tar.gz
tar -xzvf pcre-8.42.tar.gz
tar -xzvf httpd-2.4.33.tar.gz
- 编译、安装pcre,解决pcre not found的问题
cd pcre-8.42
./configure --prefix=/usr/local/pcre
make && make install
- 编译、安装apr,解决apr not found的问题
cd apr-1.6.3
./configure --prefix=/usr/local/apr
make && make install
- 编译、安装apr-util,解决apr-utilnot found的问题
cd apr-util-1.6.1
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make && make install
#直接将apr、apr-util源码拷贝至httpd的依赖文件夹srclib内也是一种方式,但是编译的时候容易出错,所以未采用#
# cp -r /usr/software/apr-1.6.3 /usr/software/httpd-2.4.33/srclib/apr
#cp -r /usr/software/apr-util-1.6.1 /usr/software/httpd-2.4.33/srclib/apr-util
- 安装C++编译环境,解决"You need a C++ compiler for C++ support"
sudo apt-get install build-essential
- 解决"fatal error: expat.h: No such file or directory"或者"collect2: error: ld returned 1 exit status"
sudo apt-get install libexpat1-dev
- 解决"error: mod_deflate has been requested but can not be built due to prerequisite failures"
sudo apt-get install zlib1g-dev
- 解决"error: mod_ssl has been requested but can not be built due to prerequisite failures"
原因是Ubuntu那是没有安装openssl包,需要安装:
sudo apt-get install openssl
之后报openssl版本太旧,所以下载最新源码手动编译安装
./config --prefix=/usr/local/ssl
make && make install
同时需要修改httpd编译配置添加
--with-ssl=/usr/local/ssl
- 编译、安装httpd
cd httpd-2.4.33
./configure --prefix=/usr/local/httpd \
--enable-dav \
--enable-so \
--enable-maintainer-mode \
--enable-rewrite \
--enable-deflate=shared \
--enable-ssl=shared \
--enable-expires=shared \
--enable-headers=shared \
--enable-static-support \
--with-included-apr \
--with-mpm=prefork \
--enable-cache \
--enable-file-cache \
--with-pcre=/usr/local/pcre \
--with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr-util \
--with-ssl=/usr/local/ssl
make && make install
下载镜像
在ambari离线安装包下载页面 下载以下文件:
- 上传并解压下载的文件至/var/www/html/hdp-2.6.5-ubuntu14/下(超过4G使用filezilla上传大文件)
- 修改httpd配置文件/usr/local/httpd/conf/httpd.conf
#开头添加 ServerName 10.24.21.144:8090 ... #修改 Listen 8090 ... #修改 DocumentRoot "/var/www/html" <Directory "/var/www/html">
启动httpd镜像服务
- 解决报错:"httpd: Syntax error on line 129 of /usr/local/cp-httpd-2.4.18/conf/httpd.conf: Cannot load modules/mod_ssl.so into server: libssl.so.1.0.0: cannot open shared object file: No such file or directory ",原因参考
#添加软连接即可
ln -s /usr/local/ssl/lib/*.so /usr/lib64
ln -s /usr/local/ssl//lib/*.so.* /usr/lib
#启动httpd服务
cd /usr/local/httpd/bin
./httpd -k start
image.png
网友评论