centos 编译安装Apache 2.4

简介: 2013年12月29日 16:40:20 ./configure --prefix=/usr/local/web/apache --enable-so --enable-rewrite --enable-mods-shared=all --with-apr=/usr/local/lib/apr...

2013年12月29日 16:40:20

./configure --prefix=/usr/local/web/apache --enable-so --enable-rewrite --enable-mods-shared=all --with-apr=/usr/local/lib/apr

注意:

--prefix时不要在最后添加路径分隔符('/'),否则安装后会在配置文件等地方会重复出现两个路径分隔符: usr/local/apache//bin/httpd (通过两次安装,我确定)

似乎提前安装apr/apr-util,并写入环境变量并不起作用,要显式的写明apr的绝对路径

安装后通过bin/apachectl start启动

取消conf/httpd.conf 的 ServerName 指令前的#注释,写上相应的ip或域名+端口,否则也没什么,能正常启动httpd,只是会有警告

推荐一篇文章:http://blog.chinaunix.net/uid-20670387-id-1902061.html

----------------------------------------------

perl 安装: yum -y install perl

Apache带的apx脚本需要perl解释程序去执行,而安装PHP时会用到apx,所以先安装perl,让Apache的安装程序为这个apx脚本的第一行写上perl解释器的路径,随后安装PHP时就不用手工改写那句话了

apr下载: http://apr.apache.org/download.cgi (apr,apr-util,apr-iconv)

apache 下载: http://httpd.apache.org/download.cgi#apache24

pcre 下载: http://www.pcre.org/

 1 wget http://mirrors.cnnic.cn/apache//apr/apr-1.5.0.tar.bz2
 2 wget http://mirrors.cnnic.cn/apache//apr/apr-util-1.5.3.tar.bz2
 3 wget http://mirrors.cnnic.cn/apache//apr/apr-iconv-1.2.1.tar.bz2
 4 wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.34.tar.bz2
 5 ./configure --prefix=/usr/local/lib/apr
 6 make && make install
 7 ./configure --prefix=/usr/local/lib/apr-util --with-apr=/usr/local/lib/apr
 8 make && make install
 9 ./configure --prefix=/usr/local/lib/apr-iconv --with-apr=/usr/local/lib/apr
10 make && make install
11 ./configure --prefix=/usr/local/lib/pcre #要求安装c++编译器 yum install gcc-c++ libstdc++-devel
12 make && make install
13 
14 ./configure --prefix=/usr/local/web/apache --enable-so --enable-rewrite --enable-mods-shared=all --with-apr=/usr/local/lib/apr --with-apr-util=/usr/local/lib/apr-util --with-pcre=/usr/local/lib/pcre
15 make && make install

 

 

 

目录
相关文章
|
1月前
|
Linux 开发工具 C语言
Centos8下编译安装最新版ffmpeg解决方案(含Centos8换源阿里云)
Centos8下编译安装最新版ffmpeg解决方案(含Centos8换源阿里云)
154 3
|
4月前
|
Linux 网络安全 Apache
Centos下操作Apache httpd
Centos下操作Apache httpd
70 0
|
1月前
|
Java Linux
Flume【环境搭建 01】CentOS Linux release 7.5 安装配置 apache-flume-1.9.0 并验证
【2月更文挑战第16天】Flume【环境搭建 01】CentOS Linux release 7.5 安装配置 apache-flume-1.9.0 并验证
34 0
|
16天前
|
Linux Apache
CentOS 7 源码安装LAMP环境源 和apache监听别的端口
CentOS 7 源码安装LAMP环境源 和apache监听别的端口
12 0
|
3月前
|
Linux C语言
centos 7 下使用高版本gcc编译安装
centos 7 下使用高版本gcc编译安装
118 0
|
4月前
|
Linux Python
百度搜索:蓝易云【CentOS 7.8编译安装python 3.7教程。】
请注意,编译安装Python可能需要一些时间,并需要较高的系统性能和网络连接。在安装过程中,请确保按照提示和错误信息进行相应的操作和解决方案。
84 1
|
4月前
|
SQL 关系型数据库 MySQL
centos编译安装mariadb
一般我不太愿意用mysql,那个玩意,有的时候不太友好。 我还是比较喜欢mariadb。
133 0
|
4月前
|
关系型数据库 MySQL Shell
centos编译安装mysql
centos编译安装mysql
137 0
|
4月前
|
应用服务中间件 Linux Shell
centos编译安装nginx(2)
安装成功之后,nginx的配置文件,在安装目录(/usr/local/nginx)下的conf目录下的nginx.conf中。 Php-fpm在安装的时候已经配置过了,这里不再赘述
56 0
centos编译安装nginx(2)
|
4月前
|
应用服务中间件 Shell Linux
centos编译安装nginx(1)
进入解压后的目录,编译
108 0