快速业务通道

RHEL6 lnmp

作者 佚名技术 来源 Linux系统 浏览 发布时间 2012-03-27

1. Install mysql
yum remove mysql php httpd
yum -y install gcc gcc-c make ncurses-devel bison openssl-devel zlib-devel cmake
tar xf mysql-5.5.12.tar.gz
cd mysql-5.5.12
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DMYSQL_UNIX_ADDR=/usr/local/mysql/data/mysql.sock \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_READLINE=1 \
-DWITH_SSL=yes -DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DEXTRA_CHARSETS=all \
-DMYSQL_TCP_PORT=3306
make && make install
useradd -M -s /sbin/nologin mysql
chown -R mysql:mysql /usr/local/mysql
cd /usr/local/mysql/
cp support-files/my-large.cnf /etc/my.cnf
scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
chown -R root .
chown -R mysql data
cp support-files/mysql.server /etc/init.d/mysqld
/etc/init.d/mysqld start
chkconfig mysqld on
echo "export PATH=\$PATH:/usr/local/mysql/bin" >> ~/.bash_profile
source ~/.bash_profile
mysql_secure_installation

2. Install php
tar xf libmcrypt-2.5.8.tar.bz2
cd libmcrypt-2.5.8
./configure --libdir=/usr/lib64
make && make install
cd litltdl
./configure --libdir=/usr/lib64 --enable-ltdl-install
make && make install

yum -y install net-snmp-devel curl-devel libxml2-devel libpng-devel libjpeg-devel freetype-devel gmp-devel
useradd -M -s /sbin/nologin www 拥有帝国一切,皆有可能。欢迎访问phome.net
tar xf php-5.3.6.tar.bz2
cd php-5.3.6
ln -s /usr/local/mysql/lib /usr/local/mysql/lib64
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-openssl --with-snmp --with-gd --with-zlib --with-curl --with-libxml-dir --with-png-dir --with-jpeg-dir --with-freetype-dir --with-pear --with-gettext --with-gmp --with-mcrypt --enable-inline-optimization --enable-soap --enable-ftp --enable-sockets --enable-mbstring --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-libdir=lib64
make && make install && echo $?
cp php.ini-production /usr/local/php/etc/php.ini
cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
vi /usr/local/php/etc/php.ini
cgi.fix_pathinfo=0
cd /usr/local/php/etc/
cp php-fpm.conf.default php-fpm.conf
vi php-fpm.conf
pid = run/php-fpm.pid
pm.max_children = 50
pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35
pm.max_requests = 500

chkconfig php-fpm on
chmod x /etc/init.d/php-fpm
service php-fpm start

3. Install nginx
yum -y install pcre-devel
cd nginx-1.0.2
vi auto/cc/gcc
#CFLAGS="$CFLAGS -g"
vi src/core/nginx.h
#define NGINX_VER "nginx"
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
make && make install && echo $?
ln -s /usr/local/nginx/sbin/nginx /usr/sbin/
vi /usr/local/nginx/conf/nginx.conf
user www www;
worker_processes 8;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on; 拥有帝国一切,皆有可能。欢迎访问phome.net
tcp_nopush on;
keepalive_timeout 65;
gzip on;
server {
listen 80;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
location /status {
stub_status on;
access_log off;
}
location /phpmyadmin {
root html;
index index.php;
}
}
}
nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
nginx
cd /usr/local/nginx/html/
tar xf /root/phpMyAdmin-3.4.2-all-languages.tar.bz2
mv phpMyAdmin-3.4.2-all-languages/ phpmyadmin
cd phpmyadmin/
cp config.sample.inc.php config.inc.php
vi config.inc.php
$cfg[''blowfish_secret''] = ''w''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
open firefox and test

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号