Tengine2.1.0 + php5.5.25 + Mysql 5.5.42 安装

安装Tengine

#yum安装pcre库yum install pcre-devel openssl openssl-devel zlib -y

#创建运行账号useradd -s /sbin/nologin -M www

#下载并安装wget http://tengine.taobao.org/download/tengine-2.1.0.tar.gztar zxf tengine-2.1.0.tar.gzcd tengine-2.1.0./configure --prefix=/apps/tenginemake && make install

#nginx.conf 参考====================================================user  www www;worker_processes     auto;worker_cpu_affinity  auto;

error_log  /data/logs/nginx/error.log  crit;pid        /var/run/nginx.pid;

worker_rlimit_nofile 51200;

events{    use epoll;    worker_connections 51200;}

http{    include       mime.types;    default_type  application/octet-stream;

    server_tokens off;    server_tag TWS;

    reset_timedout_connection       on;    keepalive_timeout               120;    keepalive_requests              100;

    sendfile on;    tcp_nodelay on;    tcp_nopush  off;

    ignore_invalid_headers          on;

    server_names_hash_max_size      256;    server_names_hash_bucket_size   64;    client_header_buffer_size 8k;    large_client_header_buffers 4 32k;    client_max_body_size 50m;    client_body_buffer_size  256k;

    connection_pool_size            256;    request_pool_size               64k;

    output_buffers                  2 128k;    postpone_output                 1460;

    client_header_timeout           1m;    client_body_timeout             3m;    send_timeout                    3m;

    fastcgi_connect_timeout 300;    fastcgi_send_timeout 300;    fastcgi_read_timeout 300;    fastcgi_buffer_size 64k;    fastcgi_buffers 4 64k;    fastcgi_busy_buffers_size 128k;    fastcgi_temp_file_write_size 256k;         gzip on;    gzip_min_length  1k;    gzip_buffers     4 32k;    gzip_http_version 1.1;    gzip_comp_level 4;    gzip_types       text/plain application/x-javascript text/css application/xml;    gzip_vary on;

    log_format main  ‘$remote_addr - $remote_user [$time_local] "$request" ‘            ‘$status $body_bytes_sent "$http_referer" ‘            ‘"$http_user_agent" "$http_x_forwarded_for" $request_time‘;

    open_log_file_cache               max=1000 inactive=20s min_uses=1 valid=1m;

    server {        listen 80;        server_name test.cnyang.com;        access_log /data/logs/nginx/test.cnyang.access.log main;             index index.php index.html index.html;        root /data/site/test.cnyang.com;             location /        {            try_files $uri $uri/ /index.php?$args;        }             location ~ .*\.(php)?$        {            expires -1s;            try_files $uri =404;            fastcgi_split_path_info ^(.+\.php)(/.+)$;            include fastcgi_params;            fastcgi_param PATH_INFO $fastcgi_path_info;            fastcgi_index index.php;            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;            fastcgi_pass  unix:/dev/shm/php-fcgi.sock;  #和后面的php-fpm配置结合使用(通过sock方式与php连接)        }                 location /nstu {            stub_status on;            access_log   off;         #  allow 172.16.50.0/24;         #  deny all;        }

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {            expires      30d;        }

        location ~ .*\.(js|css)?$ {            expires      12h;        }             }

}====================================================

安装php

#需要有www用户useradd -s /sbin/nologin -M www#yum解决依赖包问题。yum install gcc make gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel -y#下载phpwget http://cn2.php.net/distributions/php-5.5.25.tar.bz2#解压并编译安装tar -xjf php-5.5.25.tar.bz2cd php-5.5.25./configure --prefix=/apps/php --with-config-file-path=/apps/php/etc --with-bz2 --with-curl --enable-ftp --enable-sockets --enable-opcache --with-fpm-user=www --with-fpm-group=www --disable-ipv6 --with-gd --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-freetype-dir=/usr/local --enable-gd-native-ttf --with-iconv-dir=/usr/local --enable-mbstring --enable-calendar --with-gettext --with-libxml-dir=/usr/local --with-zlib --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-mysql=mysqlnd --enable-dom --enable-xml --enable-fpm --with-libdir=lib64make ZEND_EXTRA_LIBS=‘-liconv‘make install

#修改配置文件cp php.ini-production /apps/php/etc/php.ini

sed -i ‘s/post_max_size = 8M/post_max_size = 50M/g‘ /apps/php/etc/php.inised -i ‘s/upload_max_filesize = 2M/upload_max_filesize = 32M/g‘ /apps/php/etc/php.inised -i ‘s#;date.timezone =.*#date.timezone = Asia/Shanghai#g‘ /apps/php/etc/php.ini#开启Opcachesed -i ‘s/;opcache.enable=0/opcache.enable=1/g‘ /apps/php/etc/php.inised -i ‘/opcache.enable=1/azend_extension = "opcache.so"‘ /apps/php/etc/php.inised -i ‘s/;opcache.enable_cli=0/opcache.enable_cli=1/g‘ /apps/php/etc/php.inised -i ‘s/;opcache.memory_consumption=64/opcache.memory_consumption=128/g‘ /apps/php/etc/php.inised -i ‘s/;opcache.max_accelerated_files=2000/opcache.max_accelerated_files=2000/g‘ /apps/php/etc/php.inised -i ‘s/;opcache.revalidate_freq=2/opcache.revalidate_freq=240/g‘ /apps/php/etc/php.inised -i ‘s/expose_php = On/expose_php = Off/g‘ /apps/php/etc/php.ini  #禁止显示版本信息#禁用一些较危险的函数。sed -i ‘s/disable_functions =/disable_functions = passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,escapeshellcmd,dll,popen,disk_free_space,checkdnsrr,checkdnsrr,getservbyname,getservbyport,disk_total_space,posix_ctermid,posix_get_last_error,posix_getcwd, posix_getegid,posix_geteuid,posix_getgid, posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid, posix_getppid,posix_getpwnam,posix_getpwuid, posix_getrlimit, posix_getsid,posix_getuid,posix_isatty, posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid, posix_setpgid,posix_setsid,posix_setuid,posix_strerror,posix_times,posix_ttyname,posix_uname/g‘ /apps/php/etc/php.inicat >/apps/php/etc/php-fpm.conf<<EOF[global]pid = /var/run/php-fpm.piderror_log = /var/log/php/php-fpm-error.loglog_level = noticerlimit_files = 65535

[www]listen = /dev/shm/php-fcgi.socklisten.backlog = -1listen.allowed_clients = 127.0.0.1listen.owner = wwwlisten.group = wwwlisten.mode = 0666user = wwwgroup = wwwpm = dynamicpm.max_children = 100pm.max_requests = 1000pm.start_servers = 18pm.min_spare_servers = 5pm.max_spare_servers = 20request_terminate_timeout = 900request_slowlog_timeout = 5slowlog = /var/log/php/\$pool.log.slowEOF

mkdir /var/log/php

安装mysql

#yum解决依赖yum install –y autoconf automake imake libxml2-devel expat-devel cmake gcc gcc-c++ libaio libaio-devel bzr bison libtool ncurses5-devel

#下载安装mkdir pkgcd pkg[ ! -s mysql-5.5.42-linux2.6-x86_64.tar.gz ] && wget http://cdn.mysql.com/Downloads/MySQL-5.5/mysql-5.5.42-linux2.6-x86_64.tar.gz

tar zxf mysql-5.5.42-linux2.6-x86_64.tar.gzmkdir -p /apps/mysqlmv mysql-5.5.42-linux2.6-x86_64/* /apps/mysql

ln -s -f /apps/mysql/lib/mysql /usr/lib/mysqlln -s -f /apps/mysql/include/mysql /usr/include/mysqlln -s -f /apps/mysql/bin/mysql /usr/bin/mysqlln -s -f /apps/mysql/bin/mysqldump /usr/bin/mysqldumpln -s -f /apps/mysql/bin/myisamchk /usr/bin/myisamchkln -s -f /apps/mysql/bin/mysqld_safe /usr/bin/mysqld_safeln -s -f /apps/mysql/bin/mysqlbinlog /usr/bin/mysqlbinlogln -s -f /apps/mysql/bin/mysqladmin /usr/bin/mysqladmin

/usr/sbin/groupadd mysql/usr/sbin/useradd -g mysql -s /sbin/nologin -M mysqlmkdir -p /data/dbdata/chown -R mysql /apps/mysqlchown -R mysql /data/dbdata/

#my.cnf 参考 [ -f /etc/my.cnf ] && mv /etc/my.cnf /etc/my.cnf-$(date +%Y%m%d)cat /etc/my.cnf============================================[mysql]# CLIENT #port                           = 3306socket                         = /data/dbdata/mysql.sockdefault-character-set          = utf8  [mysqld]# GENERAL #user                           = mysqldefault-storage-engine         = InnoDBcharacter-set-server           = utf8lower_case_table_names         = 1socket                         = /data/dbdata/mysql.sockpid-file                       = /data/dbdata/mysql.pid  # MyISAM #key-buffer-size                = 128Mmyisam-recover-options         = FORCE,BACKUP  # SAFETY #max-allowed-packet             = 32Mmax-connect-errors             = 10000skip-name-resolve  # DATA STORAGE #datadir                        = /data/dbdata/  # BINARY LOGGING #log-bin                        = /data/dbdata/mysql-binexpire-logs-days               = 14sync-binlog                    = 1max_binlog_size                = 500M  # CACHES AND LIMITS #tmp-table-size                 = 32Mmax-heap-table-size            = 32Mquery-cache-type               = 0query-cache-size               = 0connect_timeout                = 20back_log                       = 256max-connections                = 1024thread-cache-size              = 64open-files-limit               = 65535table-definition-cache         = 2048table-open-cache               = 4096  # INNODB #innodb_data_file_path          = ibdata1:10M:autoextendinnodb-flush-method            = O_DIRECTinnodb-log-files-in-group      = 2innodb-log-file-size           = 256Minnodb-flush-log-at-trx-commit = 1innodb-file-per-table          = 1innodb_thread_concurrency      = 4innodb-buffer-pool-size        = 6G  # LOGGING #log-error                      = /data/dbdata/mysql-error.loglog-queries-not-using-indexes  = 1slow-query-log                 = 1slow-query-log-file            = /data/dbdata/mysql-slow.log============================================

#初始化MySQL数据库/apps/mysql/scripts/mysql_install_db --defaults-file=/etc/my.cnf --basedir=/apps/mysql --datadir=/data/dbdata/ --user=mysql

#配置mysql启动文件cp -f /apps/mysql/support-files/mysql.server /etc/init.d/mysqldsed -i ‘s#^basedir=$#basedir=/apps/mysql/#‘ /etc/init.d/mysqldsed -i ‘s#^datadir=$#datadir=/data/dbdata/#‘ /etc/init.d/mysqldsed -i "s#/usr/local/mysql#/apps/mysql#g" /apps/mysql/bin/mysqld_safechmod +x /etc/init.d/mysqldchkconfig --add mysqldchkconfig mysqld on

#启动mysql:/etc/init.d/mysqld start

#简单配置myslq数据库cat > /tmp/mysql_sec_script<<EOFuse mysql;update user set password=password(‘mysql1234‘) where user=‘root‘;delete from user where not (user=‘root‘);delete from user where user=‘root‘ and password=‘‘;DROP USER ‘‘@‘%‘;flush privileges;EOFmysql < /tmp/mysql_sec_scriptrm -f /tmp/mysql_sec_script
时间: 2024-12-29 02:12:19

Tengine2.1.0 + php5.5.25 + Mysql 5.5.42 安装的相关文章

(apache2.4.7 php5.4.25 mysql 5.5.23) 编译安装

环境要求 gcc.gcc-c++.cmake.bison(可能)支持 1.yum install gcc gcc-c++ cmake bison 2.修改yum配置,达到搜索本地设置 移走或改名/etc/yum.repos.d/CentOS-Base.repo 修改 vi /etc/yum.repos.d/CentOS-Media.repo baseurl=file:///mnt/cdrom enabled=1 3.卸载原有的apache.mysql等 rpm -qa |grep mysql 是

lamp环境编译(apache2.4.7 php5.4.25 mysql 5.5.23)

环境要求 gcc.gcc-c++.cmake.bison(可能)支持 1.yum install gcc gcc-c++ cmake bison 2.修改yum配置,达到搜索本地设置 移走或改名/etc/yum.repos.d/CentOS-Base.repo 修改 vi /etc/yum.repos.d/CentOS-Media.repo baseurl=file:///mnt/cdrom enabled=1 3.卸载原有的apache.mysql等 rpm -qa |grep mysql 是

搭配Centos6.5+Nginx1.8.0+PHP5.6(php-fpm) (一).nginx安装

基本按照http://www.cnblogs.com/ppoo24/p/4918288.html走一遍,如有不懂请访问原文 1.安装wget下载程序 1 yum -y install wget 安装成功的显示 2.安装编译环境:gcc,gcc-c++,automake,autoconf,libtool,make yum -y install gcc gcc-c++ automake autoconf libtool make 编译成功 3.安装相关依赖包(由于/usr/local/src目录一般

搭配Centos6.5+Nginx1.8.0+PHP5.6(php-fpm) (二).php-fpm安装

来源基本和http://www.cnblogs.com/ppoo24/p/4920106.html一样,如有不懂请访问原文 编译安装PHP及内置PHP-FPM nginx本身不能处理PHP,它只是个web服务器,当接收到请求后,如果是php请求,则发给php解释器处理,并把结果返回给客户端(浏览器). nginx一般是把请求发fastcgi管理进程处理,fascgi管理进程选择cgi子进程处理结果并返回给nginx,然后nginx返回给浏览器. 下面将以php-fpm为例介绍如何使nginx支持

tengine-2.1.0 源码安装

[[email protected] tengine-2.1.0]# yum update -y [[email protected] tengine-2.1.0]# yum install gcc gcc-c++ autoconf automake -y 安装需要的组件 PCRE(Perl Compatible Regular Expressions)是一个Perl库,包括 perl 兼容的正则表达式库.nginx rewrite依赖于PCRE库,所以在安装Tengine前一定要先安装PCRE

Ubuntu下安装Nginx,PHP5(及PHP-FPM),MySQL

Ubuntu 下 nginx , php , mysql 和 golang 的简单安装 我是搞php出身,自然安装lnmp是常规技能.以前的手段还是lnmp安装包,比如军哥的lnmp1.0.随着php和mysql的更新,大多数一键安装都开始版本老化,更新困难的问题.因此,重新研究了一下Ubuntu下lnmp的安装,发现现在简单的多,记录一下. 另外最近在学习golang,Ubuntu下安装自然也是必须的过程.不过golang的安装也有一些奥妙.当然,不是源码安装的啦. Nginx Stable/

CentOS 6.2编译安装Nginx1.2.0+MySQL5.5.25+PHP5.3.13

CentOS 6.2编译安装Nginx1.2.0+MySQL5.5.25+PHP5.3.132013-10-24 15:31:12标签:服务器 防火墙 file 配置文件 written 一.配置好IP.DNS .网关,确保使用远程连接工具能够连接服务器 二.配置防火墙,开启80端口.3306端口1    vi/etc/sysconfig/iptables #编辑防火墙配置文件1    -A INPUT -m state --state NEW -m tcp -p tcp --dport 80

Windows Server 2003 IIS6.0+PHP5(FastCGI)+MySQL5环境搭建教程

准备篇 一.环境说明: 操作系统:Windows Server 2003 SP2 32位 PHP版本:php 5.3.14 MySQL版本:MySQL5.5.25 二.相关软件下载: 1.PHP下载地址: http://windows.php.net/downloads/releases/php-5.3.14-nts-Win32-VC9-x86.zip 2.MySQL下载地址: http://gd.tuwien.ac.at/db/mysql/Downloads/MySQLInstaller/my

win2003 + IIS6.0 + Php5.4(FastCGI)配置

 说明:本文根据网络文章修改,非完全原创! 一.提醒   先简要说下php在iis下运行的方式分ISAPI和FastCGI.从php.5.3.1版本开始,不再提供针对IIS安全线程运行方式(即不提供ISAPI运行php),只支持php的线程安全版本(FastCGI).有关php的线程安全(thread safe)和非线程序安全(non thread safe),自行百度谷歌.另外,PHP5.5开始,已不支持xp和win2003上运行了,win2003上只能安装PHP5.4X的版本. 二.软件要求