zabbix[2]为zabbix server安装apache http2.4

本文介绍如何从源码安装 Apache 2.4,并详细配置使其支持 PHP5.6,包括依赖库的安装、源码编译、配置文件调整及服务启动等步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


yum install -y gcc gcc-c++
yum groupinstall "Development tools"
yum install zlib-devel pcre-devel
yum install openssh-clients


wget http://mirror.bit.edu.cn/apache//httpd/httpd-2.4.6.tar.gz
wget http://mirror.esocc.com/apache//apr/apr-1.4.8.tar.gz
wget http://mirror.esocc.com/apache//apr/apr-util-1.5.2.tar.gz

tar -xvf httpd-2.4.6.tar.gz
tar -xvf apr-1.4.8.tar.gz
tar -xvf apr-util-1.5.2.tar.gz


mv apr-1.4.8 httpd-2.4.6/srclib/apr
mv apr-util-1.5.2 httpd-2.4.6/srclib/apr-util
cd httpd-2.4.4

./configure --with-included-apr --enable-nonportable-atomics=yes --with-z --enable-so

make
make install


修改配置文件,将以下行的注释去掉

/usr/local/apache2/conf/httpd.conf
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule dir_module modules/mod_dir.so
LoadModule mime_module modules/mod_mime.so
LoadModule php5_module modules/libphp5.so


添加mime,添加一行

/usr/local/apache2/conf/mime.types
application/x-httpd-php php

老版本需要改

/usr/local/apache2/conf/httpd.conf
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>


服务的启动和停止


/usr/local/apache2/bin/apachectl [-k start|restart|graceful|graceful-stop|stop]
/usr/local/apache2/bin/apachectl -k start
/usr/local/apache2/bin/apachectl -k stop


访问测试
http://192.168.200.146
it works!
说明安装成功


以下步骤,配置完PHP后再测试
[url=http://powertech.iteye.com/blog/2316882]zabbix[3]为zabbix server编译安装php5.6 [/url]

测试php


vi /usr/local/apache2/htdocs/info.php

<?php
phpinfo()
?>

http://192.168.200.146/info.php
出现php安装修,则php运行无误

[quote]
System Linux centos.vm.zzdev.com 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64
Build Date Aug 12 2016 00:33:15
Configure Command './configure' '--prefix=/opt/php5' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-config-file-path=/opt/php5/lib' '--disable-cli' '--enable-shared' '--with-libxml-dir' '--with-gd' '--with-openssl' '--enable-mbstring' '--with-mcrypt' '--with-mysqli' '--with-mysql' '--enable-opcache' '--enable-mysqlnd' '--enable-zip' '--with-zlib-dir' '--with-pdo-mysql' '--with-jpeg-dir' '--with-freetype-dir' '--with-curl' '--without-pdo-sqlite' '--without-sqlite3' '--enable-bcmath' '--enable-sockets' '--with-gettext'
Server API Apache 2.0 Handler
Virtual Directory Support enabled
Configuration File (php.ini) Path /opt/php5/lib
Loaded Configuration File /opt/php5/lib/php.ini
Scan this dir for additional .ini files (none)
Additional .ini files parsed (none)
PHP API 20131106
PHP Extension 20131226
Zend Extension 220131226
Zend Extension Build API220131226,TS
PHP Extension Build API20131226,TS
Debug Build no
Thread Safety enabled
Zend Signal Handling disabled
Zend Memory Manager enabled
Zend Multibyte Support provided by mbstring
IPv6 Support enabled
DTrace Support disabled
Registered PHP Streams https, ftps, compress.zlib, php, file, glob, data, http, ftp, phar, zip
Registered Stream Socket Transports tcp, udp, unix, udg, ssl, sslv3, sslv2, tls, tlsv1.0, tlsv1.1, tlsv1.2
Registered Stream Filters zlib.*, convert.iconv.*, mcrypt.*, mdecrypt.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk
Zend logo This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
[/quote]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值