linux下apache的安装
一、下载
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
相关推荐
liuhangtiant 2020-10-20
hairetz 2015-09-07
comeonxueRong 2015-09-07
duckes 2020-05-17
byourb 2020-01-11
咻咻ing 2020-01-08
咻咻ing 2019-12-17
亦碎流年 2019-12-05
zhoujk00 2014-03-12
单调的低调 2015-01-16
Neptune 2019-11-11
泥淖 2019-11-09
RuoShangM 2019-10-23
xiaohanshasha 2011-06-01
eroshn 2019-10-27
artwebs 2011-02-17
TLROJE 2010-08-26