一、下载
apache:http://httpd.apache.org/download.cgi
apache编译时依赖如下包,下载最新版即可:
apr&&apr-util:http://apr.apache.org/download.cgi
pcre:http://jaist.dl.sourceforge.net/project/pcre/pcre
二、安装
apr
tar -zxvf apr-1.4.x.tar.gz cd apr-1.4.x ./configure --prefix=/usr/local/apr make && make install
apr-util
tar -zxvf apr-util-1.3.xx.tar.gz cd apr-util-1.3.xx ./configure --prefix=/usr/local/apr-util -with-apr=/usr/local/apr/bin/apr-1-config make && make install
pcre
tar -zxvf pcre-8.xx.tar.gz cd pcre-8.x ./configure --prefix=/usr/local/pcre make && make install
安装pcre是可能会遇到如下问题:
./configure --prefix=/usr/local/pcre 出现以下错误 configure: error: You need a C++ compiler for C++ support
解决方法:yum install -y gcc gcc-c++
或者下载安装最新版本:http://gcc.gnu.org/
tar zxvf gcc-4.1.x.tar.gz cd gcc-4.1.x ./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --disable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux make && make install
apache
tar -zxcf httpd-2.4.x.tar.gz cd httpd-2.4.x ./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre make && make install
三、测试
cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/apache #启动 service apache start #停止 service apache stop
启动后访问 http://apache.server.name
显示
It works!
查看端口:netstat -an | grep :80
查看进程:ps -aux | grep httpd
查看apache编译参数:cat /usr/local/apache/build/config.nice
相关推荐
Linux环境下Apache的安装过程!
linux下apache安装文档.pdf
linux下apache安装文档借鉴.pdf
linux下apache安装文档实用.pdf
Linux下安装APACHE, 详细步骤
本手册详细介绍apache在linux系统下的安装过程,是新学习者上手的好资料
NULL 博文链接:https://xuehaipeng.iteye.com/blog/677953
Linux下Apache+PHP+Mysql安装与配置
linux下安装apache+php+mysql的最简步骤
linux离线安装apache 真的麻烦 安装gcc g++ pcre open-ssl krb5 然后初始化 编译 apr
apache for linux安装文件,本人正在使用中,很稳定,推荐给同行们。
Linux环境apache安装 Linux环境apache安装 Linux环境apache安装
怎样在linux下安装apache2,具体的安装方法,和安装过程中遇到的问题
linux下的apache安装与配置,内包含安装包与依赖的包。
Linux下安装Apache httpd.doc
ubuntu linux下安装apache。
详细介绍linux下安装apache时遇到的问题,以及解决办法等。
Linux下apache与php的安装与整合,详细说明apache和php的整合配置
Linux上apache的安装文件,包含httpd-2.4.2. apr-util-1.4.1.tar.gz apr-1.4.6.tar.gz pcre-8.30.zip