对于想了解Centos6.8下编译安装Apache2.4.25详细过程的读者,本文将是一篇不可错过的文章,我们将详细介绍centos7编译安装apache,并且为您提供关于apache2.2.22在C
对于想了解Centos6.8下编译安装Apache 2.4.25详细过程的读者,本文将是一篇不可错过的文章,我们将详细介绍centos7编译安装apache,并且为您提供关于apache2.2.22在Centos6 64位下编译安装,modules里面没东西?、CentOS 5.5 编译安装Apache+MySQL+PHP、Centos 6 编译安装 Apache 2.4、centos 6.5 x64 编译安装apache2.4.9 .的有价值信息。
本文目录一览:- Centos6.8下编译安装Apache 2.4.25详细过程(centos7编译安装apache)
- apache2.2.22在Centos6 64位下编译安装,modules里面没东西?
- CentOS 5.5 编译安装Apache+MySQL+PHP
- Centos 6 编译安装 Apache 2.4
- centos 6.5 x64 编译安装apache2.4.9 .
Centos6.8下编译安装Apache 2.4.25详细过程(centos7编译安装apache)
总结
以上是小编为你收集整理的Centos6.8下编译安装Apache 2.4.25详细过程全部内容。
如果觉得小编网站内容还不错,欢迎将小编网站推荐给好友。
apache2.2.22在Centos6 64位下编译安装,modules里面没东西?
环境Centos 64位,编译安装 apache2.2.22,编译过程如下图:
在apache的安装目录下的modules下面,没有那些模块?
这是怎么回事。
如果编译安装的是apache2.4,那下面就有很多模块。不知道你们的是什么样子?
CentOS 5.5 编译安装Apache+MySQL+PHP
#检查并卸载
rpm -qa|grep httpd
rpm -e httpd
rpm -qa|grep MysqL
rpm -e MysqL
rpm -qa|grep PHP
rpm -e PHP
yum -y remove httpd
#查找最快的源
yum -y install yum-fastestmirror
yum -y update
yum -y install patch make gcc gcc-c++ gcc-g77 flex bison file
yum -y install libtool libtool-libs autoconf kernel-devel
yum -y install libjpeg libjpeg-devel libpng libpng-devel libpng10 libpng10-devel gd gd-devel
yum -y install freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel
yum -y install glib2 glib2-devel bzip2 bzip2-devel libevent libevent-devel
yum -y install ncurses ncurses-devel curl curl-devel e2fsprogs
yum -y install e2fsprogs-devel krb5 krb5-devel libidn libidn-devel
yum -y install openssl openssl-devel vim-minimal nano sendmail
yum -y install fonts-chinese gettext gettext-devel
yum -y install ncurses-devel
yum -y install gmp-devel pspell-devel
yum -y install unzip
wget -c http://soft.vpser.net/web/libmcrypt/libmcrypt-2.5.8.tar.gz
tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8/
./configure
make && make install
/sbin/ldconfig
cd libltdl/
./configure --enable-ltdl-install
make && make install
cd http://www.cnblogs.com/
wget -c http://soft.vpser.net/web/mhash/mhash-0.9.9.9.tar.gz
tar zxvf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9/
./configure
make && make install
cd ../
wget -c http://soft.vpser.net/web/libiconv/libiconv-1.13.tar.gz
tar zxvf libiconv-1.13.tar.gz
cd libiconv-1.13/
./configure --prefix=/usr/local
make && make install
cd ../
ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la
ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so
ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4
ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8
ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a
ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la
ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so
ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2
ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1
wget -c http://soft.vpser.net/web/mcrypt/mcrypt-2.6.8.tar.gz
tar zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8/
./configure
make && make install
cd ../
# 安装MysqL
wget -c http://soft.vpser.net/datebase/MysqL/MysqL-5.1.44.tar.gz
wget -c http://soft.vpser.net/web/pdo/PDO_MysqL-1.0.2.tgz
tar -zxvf MysqL-5.1.44.tar.gz
cd MysqL-5.1.44/
./configure --prefix=/usr/local/MysqL --with-extra-charsets=all --enable-thread-safe-client --enable-assembler --with-charset=utf8 --enable-thread-safe-client --with-extra-charsets=all --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile
make && make install
cd ../
groupadd MysqL
useradd -g MysqL MysqL
cp /usr/local/MysqL/share/MysqL/my-medium.cnf /etc/my.cnf
/usr/local/MysqL/bin/MysqL_install_db --user=MysqL
chown -R MysqL /usr/local/MysqL/var
chgrp -R MysqL /usr/local/MysqL/.
cp /usr/local/MysqL/share/MysqL/MysqL.server /etc/init.d/MysqL
chmod 755 /etc/init.d/MysqL
chkconfig --level 345 MysqL on
echo "/usr/local/MysqL/lib/MysqL" >> /etc/ld.so.conf
echo "/usr/local/lib" >>/etc/ld.so.conf
ldconfig
ln -s /usr/local/MysqL/lib/MysqL /usr/lib/MysqL
ln -s /usr/local/MysqL/include/MysqL /usr/include/MysqL
/etc/init.d/MysqL start
/usr/local/MysqL/bin/MysqLadmin -u root password $MysqLrootpwd
/etc/init.d/MysqL restart
/etc/init.d/MysqL stop
chkconfig MysqL-ndb off
chkconfig MysqL-ndb-mgm off
# 安装apache
wget http://soft.vpser.net/web/apache/httpd-2.2.11.tar.gz
tar zxvf httpd-2.2.11.tar.gz
cd httpd-2.2.11
./configure --prefix=/usr/local/apache --enable-deflate=shared --enable-headers=shared --enable-info=shared --enable-rewrite=shared --enable-so
make
make install
cd ../
# 安装PHP
wget http://soft.vpser.net/web/PHP/PHP-5.2.10.tar.gz
tar zxvf PHP-5.2.10.tar.gz
cd PHP-5.2.10/
./configure --prefix=/usr/local/PHP --with-config-file-path=/usr/local/PHP/etc --with-apxs2=/usr/local/apache/bin/apxs --with-MysqL=/usr/local/MysqL --with-MysqLi=/usr/local/MysqL/bin/MysqL_config --with-iconv-dir=/usr/local/libiconv --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear
# 如果下面两行不用,可尝试换此行 #--lcrypt --liconv #make && make install
make ZEND_EXTRA_LIBS='-liconv'
make install
mkdir -p /usr/local/PHP/etc
cp PHP.ini-dist /usr/local/PHP/etc/PHP.ini
cd ../
# PHP extensions
sed -i 's#output_buffering = Off#output_buffering = On#' /usr/local/PHP/etc/PHP.ini
sed -i 's/post_max_size = 8M/post_max_size = 50M/g' /usr/local/PHP/etc/PHP.ini
sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 50M/g' /usr/local/PHP/etc/PHP.ini
sed -i 's/;date.timezone =/date.timezone = PRC/g' /usr/local/PHP/etc/PHP.ini
# 安装zend
wget http://soft.vpser.net/web/zend/ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
tar zxvf ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
mkdir -p /usr/local/zend/
cp ZendOptimizer-3.3.9-linux-glibc23-i386/data/5_2_x_comp/ZendOptimizer.so /usr/local/zend/
cat >>/usr/local/PHP/etc/PHP.ini<<EOF
[Zend Optimizer]
zend_optimizer.optimization_level=1
zend_extension="/usr/local/zend/ZendOptimizer.so"
EOF
# 添加用户和建网站根目录
groupadd www
useradd -g www www
mkdir -p /home/wwwroot
chmod +w /home/wwwroot
chown -R www:www /home/wwwroot
# 安装PHPmyadmin
cd /home/wwwroot
wget http://soft.vpser.net/datebase/PHPmyadmin/PHPmyadmin.tar.gz
tar zxvf PHPmyadmin.tar.gz
cd ~
# 安装PHP加速缓存插件eAccelerator
wget http://soft.vpser.net/web/eaccelerator/eaccelerator-0.9.5.3.tar.bz2
tar jxvf eaccelerator-0.9.5.3.tar.bz2
cd eaccelerator-0.9.5.3/
/usr/local/PHP/bin/PHPize
./configure --enable-eaccelerator=shared --with-PHP-config=/usr/local/PHP/bin/PHP-config
make
make install
cd ../
mkdir -p /usr/local/eaccelerator_cache
cat >>/usr/local/PHP/etc/PHP.ini<<EOF
[eaccelerator]
zend_extension="/usr/local/PHP/lib/PHP/extensions/no-debug-non-zts-20060613/eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/usr/local/eaccelerator_cache"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="3600"
eaccelerator.shm_prune_period="3600"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
eaccelerator.keys = "disk_only"
eaccelerator.sessions = "disk_only"
eaccelerator.content = "disk_only"
EOF
####################
# 启动apache
/usr/local/apache/bin/apachectl -k start
# 重启apache
#/usr/local/apache/bin/apachectl -k restart
# 启动ssl
#/usr/local/apache/bin/apachectl -k startssl
# 启动MysqL
/etc/init.d/MysqL start
# 开机启动
vi /etc/rc.local
# 然后
ulimit -SHn 51200
/etc/init.d/MysqL start
/usr/local/apache/bin/apachectl -k start
#检查配置
#/usr/local/apache/bin/apachectl configtest
#检测Apache运行模块
#/usr/local/apache/bin/httpd -l
Centos 6 编译安装 Apache 2.4
安装软件包准备,需要安装apr 1.5.2、apr-util 1.5.4,如果要启用ssl需要安装openssl软件包,
1,安装apr因为是编译安装,通过./configure --help命令查看相关选项。
[root@localhostapr-1.5.2]#yuminstall-ygcc [root@localhostapr-1.5.2]#./configure--prefix=/usr/local/apr [root@localhostapr-1.5.2]#make&makeinstall
2,安装apr-util,在安装时需要指明apr的安装位置,以及--prefix路径
[root@localhostapr-util-1.5.4]#./configure--prefix=/usr/local/apr-util--with-apr=/usr/local/apr/ [root@localhostapr-util-1.5.4]#make&makeinstall
3,安装httpd2.4.23,需要安装pcre、pcre-devel,如果启用ssl需要安装openssl、openssl-devel(版本需要在0.9.8a以上版本)
[root@localhosthttpd-2.4.23]#./configure--prefix=/usr/local/httpd--sysconfdir=/etc/httpd--with-apr=/usr/local/apr--with-apr-util=/usr/local/apr-util/--enable-ssl--enable-modules=all [root@localhosthttpd-2.4.23]#make&makeinstall
4,配置httpd
a,修改环境变量
在/etc/profile/创建httpd.sh,增加export PATH=/usr/local/httpd/bin:$PATH ,(. /etc/profile.d/httpd.sh)导入环境变量。
b,包含库文件,创建软连接 ln -sv /usr/local/httpd/include /usr/local/include/httpd.
c,编辑man配置文件,添加httpd帮助文档,编辑/etc/man.config增加如下内容 MANPATH /usr/local/httpd/man
d,由于没有服务脚本,所以只能使用apachectl start命令执行启动。
如果出现如下报错AH00558: httpd: Could not reliably determine the server's fully qualified domain name,using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message,需要编辑httpd.conf 增加ServerName localhost(主机名称),再重新启动即可。
ps -axu |grep httpd 可以看到httpd的进程,用浏览器打开即可看到“It works!”。
服务脚本如下:
#!/bin/bash # #description:httpdservice #chkconfig:-8515 ./etc/rc.d/init.d/functions if[-f/etc/sysconfig/httpd];then ./etc/sysconfig/httpd fi HTTPD_LANG=${HTTPD_LANG-"C"} INITLOG_ARGS="" proc=httpd apachectl=/usr/local/httpd/bin/apachectl httpd=${httpd-/usr/local/httpd/bin/httpd} pidfile=${pidfile-/var/run/httpd/httpd.pid} lockfile=${lockfile-/var/lock/subsys/httpd} STOP_TIMEOUT=${STOP_TIMEOUT-10} RETVAL=0 start(){ echo-n$"Starting$prog:" LANG=$HTTPD_LANGdaemon--pidfile=${pidfile}$httpd$OPTIONS RETVAL=$? echo [$RETVAL=0]&&touch${lockfile} return$RETVAL } stop(){ echo-n$"Stopping$prog:" killproc-p${pidfile}-d${STOP_TIMEOUT}$httpd RETVAL=$? echo [$RETVAL=0]&&rm-f${lockfile}${pidfile} } reload(){ echo-n$"Reloading$prog:" if!LANG=$HTTPD_LANG$httpd$OPTIONS-t>&/dev/null;then RETVAL=6 echo$"notreloadingduetoconfigurationSyntaxerror" failure$"notreloading$httpdduetoconfigurationSyntaxerror" else #ForceLSBbehavIoUrfromkillproc LSB=1killproc-p${pidfile}$httpd-HUP RETVAL=$? if[$RETVAL-eq7];then failure$"httpdshutdown" fi fi echo } case"$1"in start) start ;; stop) stop ;; status) status-p${pidfile}$httpd RETVAL=$? ;; restart) stop start ;; condrestart|try-restart) ifstatus-p${pidfile}$httpd>&/dev/null;then stop start fi ;; force-reload|reload) reload ;; graceful|help|configtest|fullstatus) $apachectl$@ RETVAL=$? ;; *) echo$"Usage:$prog{start|stop|restart|condrestart|try-restart|force-reload|reload|status| fullstatus|graceful|help|configtest}" RETVAL=2 ;; esac exit$RETVAL
至此基本配置完成。
centos 6.5 x64 编译安装apache2.4.9 .
需要下载的包
apr-1.5.0.tar.gz
apr-util-1.5.3.tar.gz
pcre-8.33.tar.gz
httpd-2.4.9.tar.gz
我是统一放到/usr/下解压
安装apr-1.5.0
./configure安装apr-util-1.5.3
./configure --prefix=/usr/local/apr-util--with-apr=/usr/local/apr/bin/apr-1-config
注意在执行 ./configure --prefix=/usr/local/apr-util--with-apr=/usr/local/apr/bin/apr-1-config出现cannot install `libaprutil-1.la' to a directory not ending in /usr/local/apr/lib
执行 make clean
安装pcre-8.33 ./configure--prefix=/usr/local/pcre make
注意在执行./configure--prefix=/usr/local/pcre 出现You need a C++ compiler for C++ support时
执行 yum install -y gcc gcc-c++
安装httpd-2.4.9
./configure--prefix=/usr/local/apache2 --enable-so--enable-rewrite--enable-mods-shared=most--with-apr=/usr/local/apr--with-apr-util=/usr/local/apr-util--with-pcre=/usr/local/pcre
make
make install
修改: /usr/local/apache2/conf
用记事本打开httpd.conf
将里面的#ServerName www.example.comt:80注释去掉即可,把www.example.com改为localhost
再执行service httpd start
然后可以通过浏览器访问http://localhost:80,如果页面显示“Itworks!”,即表示apache已安装并启动成功。
添加到启动项
解决httpd: 未被识别的服务
cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd
vi /etc/rc.d/init.d/httpd
在开头的#!/bin/sh 下面加上
#chkconfig: 2345 85 15
chkconfig --add httpd 添加httpd服务
yum install lynx -y
执行service httpd status 出现
service httpd status
Not Found
The requested URL /server-status was not found on this server.
暂未解决
重启Apache
servicehttpdrestart
至此apache服务器软件安装完毕
=====================以下是网上资料=====================
进入/usr/local/apache2/conf目录,运行如下命令修改配置文件
vim httpd.conf
a) 1去掉下面语句前的#
LoadModulePHP5_module modules/libPHP5.so
如果没有词句,可添加到已有的LoadModule语句下
b) 修改邮箱
修改为自己的邮箱ServerAdmin xxx@gmail.com
修改服务器名为本机IP地址如下:ServerName192.168.1.191:80
c) 修改首页索引
修改首页索引文件如下(首页为index.PHP或index.html):
DirectoryIndexindex.PHP index.html
d) AddType修改
添加如下AddType到已有的AddType下面(没有下面语句将不能解析PHP文本)
AddTypeapplication/x-httpd-PHP .PHP .phtml .PHP3 .inc
运行命令
vi/usr/local/apache/conf/extra/httpd-info.conf 将
改成
关于Centos6.8下编译安装Apache 2.4.25详细过程和centos7编译安装apache的介绍现已完结,谢谢您的耐心阅读,如果想了解更多关于apache2.2.22在Centos6 64位下编译安装,modules里面没东西?、CentOS 5.5 编译安装Apache+MySQL+PHP、Centos 6 编译安装 Apache 2.4、centos 6.5 x64 编译安装apache2.4.9 .的相关知识,请在本站寻找。
本文标签: