编译安装httpd-2.4
2016-08-04 23:38
417 查看
编译安装httpd-2.4
编译安装步骤:
yum groupinstall "Development Tools" "Server Platform Development" -y 安装开发环境
lftp http://archive.apache.org/dist/apr/ 下载apr和apr-util
>mget apr-1.5.2.tar.bz2 apr-util-1.5.3.tar.bz2
>bye
ls
tar xf apr-1.5.2.tar.bz2
cd apr-1.5.2
./configure --prefix=/usr/local/apr
make && make install
ls
tar xf apr-util-1.5.3.tar.bz2
cd apr-util-1.5.3
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make && make install
apr和apr-util就装好了。
前提:
安装开发环境,安装pcre-devel
# groupadd -r apache 创建系统组,运行apache的
# useradd -r -g apache apahce 添加一个系统用户
# yum install pcre-devel -y
# lftp http://httpd.apache.org/download.cgi 这个我下载不下来,说没有资源,但我可以手动下载,于是用xshell传输到linux上了。
# mget httpd-2.4.23.tar.bz2
# tar xf httpd-2.4.23.tar.bz2
# cd httpd-2.4.23
# ./configure --prefix=/usr/local/apache --sysconf=/etc/httpd24 --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --enable-modules=most --enable-mpms-shared=all --with-mpm=prefork
# make && make install
启动服务:
apachectl
确保80端口没有其他服务在占用,否则启动不起来,套接字是独占的。
/usr/local/apache/bin/apachectl 这个命令,不要直接使用apachectl,那是rmp包安装生成的。
也可以这样:
vim /etc/profile.d/httpd.sh
export PATH=/usr/local/apache/bin:$PATH 把这个位置放前面
保存退出
[root@web1 ~]# vim /etc/profile.d/httpd.sh
[root@web1 ~]# . /etc/profile.d/httpd.sh
[root@web1 ~]# echo $PATH
/usr/local/apache/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
[root@web1 ~]# which apachectl
/usr/local/apache/bin/apachectl
[root@web1 ~]#
[root@web1 ~]# apachectl start
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using web1.ams.com. Set the 'ServerName' directive globally to suppress this message
报错了。。。。
解决方案:
killall httpd
cd /etc/httpd24
vim httpd.conf
ServerName web1.ams.com:80 把这项启用起来,改为自己的服务器名。
保存退出,
[root@web1 ~]# apachectl restart
[root@web1 ~]# ss -tnl
80端口已经监听。
访问下自己的地址:http://192.168.1.117/
显示:it works!
本文出自 “子非鱼” 博客,请务必保留此出处http://ssippi.blog.51cto.com/11647200/1834553
编译安装步骤:
yum groupinstall "Development Tools" "Server Platform Development" -y 安装开发环境
lftp http://archive.apache.org/dist/apr/ 下载apr和apr-util
>mget apr-1.5.2.tar.bz2 apr-util-1.5.3.tar.bz2
>bye
ls
tar xf apr-1.5.2.tar.bz2
cd apr-1.5.2
./configure --prefix=/usr/local/apr
make && make install
ls
tar xf apr-util-1.5.3.tar.bz2
cd apr-util-1.5.3
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make && make install
apr和apr-util就装好了。
前提:
安装开发环境,安装pcre-devel
# groupadd -r apache 创建系统组,运行apache的
# useradd -r -g apache apahce 添加一个系统用户
# yum install pcre-devel -y
# lftp http://httpd.apache.org/download.cgi 这个我下载不下来,说没有资源,但我可以手动下载,于是用xshell传输到linux上了。
# mget httpd-2.4.23.tar.bz2
# tar xf httpd-2.4.23.tar.bz2
# cd httpd-2.4.23
# ./configure --prefix=/usr/local/apache --sysconf=/etc/httpd24 --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --enable-modules=most --enable-mpms-shared=all --with-mpm=prefork
# make && make install
启动服务:
apachectl
确保80端口没有其他服务在占用,否则启动不起来,套接字是独占的。
/usr/local/apache/bin/apachectl 这个命令,不要直接使用apachectl,那是rmp包安装生成的。
也可以这样:
vim /etc/profile.d/httpd.sh
export PATH=/usr/local/apache/bin:$PATH 把这个位置放前面
保存退出
[root@web1 ~]# vim /etc/profile.d/httpd.sh
[root@web1 ~]# . /etc/profile.d/httpd.sh
[root@web1 ~]# echo $PATH
/usr/local/apache/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
[root@web1 ~]# which apachectl
/usr/local/apache/bin/apachectl
[root@web1 ~]#
[root@web1 ~]# apachectl start
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using web1.ams.com. Set the 'ServerName' directive globally to suppress this message
报错了。。。。
解决方案:
killall httpd
cd /etc/httpd24
vim httpd.conf
ServerName web1.ams.com:80 把这项启用起来,改为自己的服务器名。
保存退出,
[root@web1 ~]# apachectl restart
[root@web1 ~]# ss -tnl
80端口已经监听。
访问下自己的地址:http://192.168.1.117/
显示:it works!
本文出自 “子非鱼” 博客,请务必保留此出处http://ssippi.blog.51cto.com/11647200/1834553
相关文章推荐
- 编译安装httpd2.4
- httpd-2.4编译安装
- httpd-2.4编译安装基本步骤
- 编译安装httpd 2.4
- Linux下编译安装Apache httpd 2.4
- 源码编译安装httpd2.4及虚拟主机
- CentOS6.6上编译安装httpd2.4
- 编译安装httpd2.4
- 【Apache学习】编译安装httpd2.4 含傻瓜版自动安装脚本
- Httpd2.4简介及CenOS6.6下编译安装
- 编译安装httpd2.4
- httpd-2.4编译安装及新特性详解 --LAMP
- 编译安装httpd-2.4
- 编译安装httpd2.4,配置httpd服务
- httpd2.4之编译安装及配置参数详细说明
- 源码编译安装 httpd2.4+MariaDB5.5+php5.4 全新的LAMP 推荐
- https服务器的配置(一)编译安装apache2.4 (httpd)
- 在centos6.5上编译安装httpd-2.4和2.4版本特性介绍
- centos下httpd-2.4的编译安装
- web:4、编译安装httpd-2.4及其新特性