centos上编译安装nginx1.28+mariadb5.5.30+php5.4.14+webbench1.5

qweiu 2013-04-18 01:44:32
我们首先安装Nginx

安装pcre库,因为nginx依赖它
pcre-8.32 configuration summary:
Install prefix .................. : /usr/local
C preprocessor .................. : gcc -E
C compiler ...................... : gcc
C++ preprocessor ................ : g++ -E
C++ compiler .................... : g++
Linker .......................... : /usr/bin/ld
C preprocessor flags ............ :
C compiler flags ................ : -O2 -fvisibility=hidden
C++ compiler flags .............. : -O2 -fvisibility=hidden -fvisibility-inlines-hidden
Linker flags .................... :
Extra libraries ................. :
Build 8 bit pcre library ........ : yes
Build 16 bit pcre library ....... : no
Build 32 bit pcre library ....... : yes
Build C++ library ............... : yes
Enable JIT compiling support .... : no
Enable UTF-8/16/32 support ...... : no
Unicode properties .............. : no
Newline char/sequence ........... : lf
\R matches only ANYCRLF ......... : no
EBCDIC coding ................... : no
EBCDIC code for NL .............. : n/a
Rebuild char tables ............. : no
Use stack recursion ............. : yes
POSIX mem threshold ............. : 10
Internal link size .............. : 2
Match limit ..................... : 10000000
Match limit recursion ........... : MATCH_LIMIT
Build shared libs ............... : yes
Build static libs ............... : yes
Use JIT in pcregrep ............. : no
Buffer size for pcregrep ........ : 20480
Link pcregrep with libz ......... : no
Link pcregrep with libbz2 ....... : no
Link pcretest with libedit ...... : no
Link pcretest with libreadline .. : no
Valgrind support ................ : no
Code coverage ................... : no


编译安装Nginx
./configure --sbin-path=/usr/local/nginx/nginx --with-openssl=/usr/local/ssl/include
[root@wei nginx]# ls /usr/local/nginx/
client_body_temp fastcgi_temp logs proxy_temp uwsgi_temp
conf html nginx scgi_temp
修改ld.so.conf vi /etc/ld.so.conf
添加以下内容:
/usr/local/lib
因为我们的pcre库安装在/usr/local/lib下,系统默认找不到的,然后再运行ldconfig。

去除防火墙
[root@wei nginx]# iptables --flush
[root@wei nginx]# service iptables save
iptables:将防火墙规则保存到 /etc/sysconfig/iptables: [确定]
[root@wei nginx]# /usr/local/nginx/nginx
现在打开localhost就看到Welcome to nginx!的页面。

安装mariadb 5.5.30
因为mariadb依赖ncurses,所以先安装ncurses
tar zxf ncurses-5.7.tar.gz
cd ncurses-5.7
./configure
make
make install
开始安装mariadb
cd soft/mariadb-5.5.30
cmake . -DCURSES_LIBRARY=/usr/lib/libncurses.a -DCURSES_INCLUDE_PATH=/usr/
include
make
make install
我安装时好像mysql客户端编译的有问题,运行/usr/local/mysql/bin/mysql提示段错误
后来我用yum install mysql解决了


安装php5.4.14
首先准备以下软件:
php-5.4.14.tar.bz2
mhash-0.9.9.9.tar.bz2
libiconv-1.14.tar.gz
libmcrypt-2.5.8.tar.gz

安装依赖:
yum install ncurses-devel libxml2-devel bzip2-devel libcurl-devel curl-devel libjpegdevel libpng-devel freetype-devel net-snmp-devel -y
tar zxf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure --prefix=/usr/local
make
make install
tar zxf libiconv-1.14.tar.gz
cd libiconv-1.14
./configure --prefix=/usr/local
make
make install
tar jxf mhash-0.9.9.9.tar.bz2
cd mhash-0.9.9.9
./configure
make
make install

安装PHP
ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib
./configure --prefix=/usr/local/php --with-config-file-path=/etc --with-mysql=/usr/
local/mysql/ --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdo-mysql=/
usr/local/mysql/ --with-iconv-dir=/usr/local --enable-fpm --disable-phar --withfpm-user=www \
--with-fpm-group=www --with-pcre-regex --with-zlib --with-bz2 --enablecalendar --with-curl --enable-dba --with-libxml-dir --enable-ftp --with-gd --withjpeg-dir --with-png-dir --with-zlib-dir --with-freetype-dir --enable-gd-native-ttf --enable-gd-jis-conv \
--with-mhash --enable-mbstring --with-mcrypt --enable-pcntl --enable-xml --disable-rpath --enable-shmop --enable-sockets --enable-zip --enable-bcmath --with-snmp --disable-ipv6
make ZEND_EXTRA_LIBS='-liconv'
ldconfig
make test
#测试没报错的话就
make install



安装webbench 1.5
首先安装ctags:
tar zxf ctags-5.8.tar.gz
cd ctags-5.8
./configure
make
make install
再安装webbench
webbench默认没有configure文件,所以要自己生成
步骤:
autoscan
mv configure.scan configure.in
automake --add-missing
autoconf
./configure
make
make install
用webbench测试网站压力:
webbench -c 5000 -t 10 http://www.163.com/
c代表并发数,t代表持续时间
...全文
154 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

19,612

社区成员

发帖
与我相关
我的任务
社区描述
系统使用、管理、维护问题。可以是Ubuntu, Fedora, Unix等等
社区管理员
  • 系统维护与使用区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧