首页 > 代码库 > tengine2+mysql-5.6+php5.5 Linux 服务器环境架构
tengine2+mysql-5.6+php5.5 Linux 服务器环境架构
升级所需要的库sudo -sLANG=Cyum install -y wget gcc gcc-c++ openssl* curl curl-devel libxml2 libxml2-devel glibc glibc-devel glib2 glib2-devel gd gd2 gd-devel gd2-devel libaio autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel二、创建目录病下载需要的软件:创建两个目录分别用于软件源码目录和日志目录,然后下载软件。mkdir -p /lvtao.net/resourcemkdir -p /lvtao.net/logscd /lvtao.net/resource/wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.35.tar.gzwget http://tengine.taobao.org/download/tengine-2.0.1.tar.gzwget downloads.skysql.com/archives/mysql-5.6/mysql-5.6.16-linux-glibc2.5-x86_64.tar.gzwget http://cn2.php.net/distributions/php-5.5.12.tar.gzwget http://downloads.sourceforge.net/mhash/mhash-0.9.9.9.tar.gzwget http://downloads.sourceforge.net/mcrypt/libmcrypt-2.5.8.tar.gzwget http://downloads.sourceforge.net/mcrypt/mcrypt-2.6.8.tar.gzwget http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gzwget http://pecl.php.net/get/memcache-2.2.7.tgzwget http://mirrors-au.go-parts.com/mirrors/ImageMagick/ImageMagick-6.8.9-1.tar.gzwget http://pecl.php.net/get/imagick-3.1.2.tgz三、安装 tengine① 安装 pcretar zxvf pcre-8.35.tar.gzcd pcre-8.35./configuremake && make installcd ../② 安装 tenginegroupadd wwwuseradd -g www wwwtar zxvf tengine-2.0.1.tar.gzcd tengine-2.0.1./configure --user=www --group=www --prefix=/lvtao.net/software/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/lvtao.net/resource/pcre-8.35 --with-http_realip_module --with-http_image_filter_module --with-http_concat_modulemakemake installcd ../③ 配置域名rm -f /lvtao.net/software/nginx/conf/nginx.confvi /lvtao.net/software/nginx/conf/nginx.conf输入以下内容(文件夹 sites-enabled 是存放虚拟主机配置文件的,位于 mkdir -p /lvtao.net/software/nginx/sites-enabled/ 中)user www www;worker_processes auto; #error_log logs/error.log;error_log logs/error.log notice;#error_log logs/error.log info; pid logs/nginx.pid; events { worker_connections 1024;} http { include mime.types; default_type application/octet-stream; gzip on; gzip_disable "msie6"; gzip_vary on; gzip_proxied any; gzip_comp_level 6; gzip_min_length 1100; gzip_buffers 16 8k; gzip_http_version 1.1; gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; access_log off; log_not_found off; error_log /lvtao.net/logs/nginx-error.log warn; # access_log /lvtao.net/logs/nginx-access.log main buffer=16k; server_admin admin@bugxm.com; server_tag Apache/2.4; log_format main ‘$remote_addr - $remote_user [$time_local] "$request" ‘ ‘$status $body_bytes_sent "$http_referer" ‘ ‘"$http_user_agent" "$http_x_forwarded_for"‘; open_file_cache max=200000 inactive=20s; open_file_cache_valid 30s; open_file_cache_min_uses 2; open_file_cache_errors on; client_max_body_size 10M; client_body_buffer_size 1m; client_body_timeout 15; client_header_timeout 15; client_header_buffer_size 32k; keepalive_timeout 2 2; send_timeout 15; sendfile on; tcp_nopush on; tcp_nodelay on; fastcgi_buffers 256 16k; fastcgi_buffer_size 128k; fastcgi_connect_timeout 3s; fastcgi_send_timeout 120s; fastcgi_read_timeout 120s; reset_timedout_connection on; server_names_hash_bucket_size 100; server_tokens off; server { listen 80; server_name localhost; index index.html index.htm index.php; root /lvtao.net/htdocs/test/; error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } location ~ .*\.(php|php5)?$ { #fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|ico)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 1h; } location ~ /\. { deny all; } } include ../sites-enabled/*.conf;}生成php测试内容,用于安装完成测试用:mkdir -p /lvtao.net/htdocs/testchmod +w /lvtao.net/htdocs/testecho "<?php phpinfo(); ?>" > /lvtao.net/htdocs/test/index.phpchown -R www:www /lvtao.net/htdocs/test编辑 fastcgi.confvi /lvtao.net/software/nginx/conf/fastcgi.conf为安全考虑,在 fastcgi.conf 底部加上以下代码:fastcgi_param PHP_VALUE "open_basedir=$document_root:/tmp/:/proc/";④ 将 Tengine 添加到服务vi /etc/rc.d/init.d/nginx在该文件中添加以下内容#!/bin/sh# Source function library.. /etc/rc.d/init.d/functions# Source networking configuration.. /etc/sysconfig/network# Check that networking is up.[ "$NETWORKING" = "no" ] && exit 0nginx="/lvtao.net/software/nginx/sbin/nginx"prog=$(basename $nginx)NGINX_CONF_FILE="/lvtao.net/software/nginx/conf/nginx.conf"[ -f /etc/sysconfig/nginx ] && . /etc/sysconfig/nginxlockfile=/var/lock/subsys/nginxmake_dirs() { # make required directories user=`$nginx -V 2>&1 | grep "configure arguments:" | sed ‘s/[^*]*--user=\([^ ]*\).*/\1/g‘ -` if [ -z "`grep $user /etc/passwd`" ]; then useradd -M -s /bin/nologin $user fi options=`$nginx -V 2>&1 | grep ‘configure arguments:‘` for opt in $options; do if [ `echo $opt | grep ‘.*-temp-path‘` ]; then value=http://www.mamicode.com/`echo $opt | cut -d"=" -f 2` if [ ! -d "$value" ]; then # echo "creating" $value mkdir -p $value && chown -R $user $value fi fi done}start() { [ -x $nginx ] || exit 5 [ -f $NGINX_CONF_FILE ] || exit 6 make_dirs echo -n $"Starting $prog: " daemon $nginx -c $NGINX_CONF_FILE retval=$? echo [ $retval -eq 0 ] && touch $lockfile return $retval}stop() { echo -n $"Stopping $prog: " killproc $prog -QUIT retval=$? echo [ $retval -eq 0 ] && rm -f $lockfile return $retval}restart() { configtest || return $? stop sleep 1 start}reload() { configtest || return $? echo -n $"Reloading $prog: " killproc $nginx -HUP RETVAL=$? echo}force_reload() { restart}configtest() { $nginx -t -c $NGINX_CONF_FILE}rh_status() { status $prog}rh_status_q() { rh_status >/dev/null 2>&1}case "$1" in start) rh_status_q && exit 0 $1 ;; stop) rh_status_q || exit 0 $1 ;; restart|configtest) $1 ;; reload) rh_status_q || exit 7 $1 ;; force-reload) force_reload ;; status) rh_status ;; condrestart|try-restart) rh_status_q || exit 0 ;; *) echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}" exit 2esacchmod +x /etc/init.d/nginxulimit -SHn 65535service nginx start注:启动参数支持:{start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}四、安装 mysqltar zxvf mysql-5.6.16-linux-glibc2.5-x86_64.tar.gzmv mysql-5.6.16-linux-glibc2.5-x86_64 /lvtao.net/software/mysqlgroupadd mysqluseradd -g mysql mysqlmkdir -p /lvtao.net/data/mysql/data/mkdir -p /lvtao.net/data/mysql/binlog/mkdir -p /lvtao.net/data/mysql/relaylog/chown -R mysql:mysql /lvtao.net/data/mysql/ /lvtao.net/software/mysql/scripts/mysql_install_db --basedir=/lvtao.net/software/mysql --datadir=/lvtao.net/data/mysql/data --user=mysql sed -i "s#/usr/local/mysql#/lvtao.net/software/mysql#g" /lvtao.net/software/mysql/bin/mysqld_safe编辑配置文件 my.cnfrm -f /lvtao.net/software/mysql/my.cnfvi /lvtao.net/software/mysql/my.cnf在 my.cnf 中输入以下内容[client]character-set-server = utf8port = 3306socket = /tmp/mysql.sock [mysqld]server-id = 1port = 3306user = mysqlbasedir = /lvtao.net/software/mysqldatadir = /lvtao.net/data/mysql/datasocket = /tmp/mysql.socklog-error = /lvtao.net/data/mysql/mysql_error.logpid-file = /lvtao.net/data/mysql/mysql.pidsql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES open_files_limit = 10240back_log = 600join_buffer_size = 1Mread_rnd_buffer_size = 16Msort_buffer_size = 1Mthread_cache_size = 300query_cache_size = 128Mquery_cache_limit = 2Mquery_cache_min_res_unit = 2kdefault-storage-engine = MyISAMthread_stack = 192Ktransaction_isolation = READ-COMMITTEDtmp_table_size = 246Mmax_heap_table_size = 246Mlong_query_time = 3log-slave-updateslog-bin = /lvtao.net/data/mysql/binlog/binlogbinlog_cache_size = 4Mbinlog_format = MIXEDmax_binlog_cache_size = 8Mmax_binlog_size = 1Grelay-log-index = /lvtao.net/data/mysql/relaylog/relaylogrelay-log-info-file = /lvtao.net/data/mysql/relaylog/relaylogrelay-log = /lvtao.net/data/mysql/relaylog/relaylogexpire_logs_days = 30key_buffer_size = 128Mread_buffer_size = 1Mread_rnd_buffer_size = 16Mbulk_insert_buffer_size = 64Mmyisam_sort_buffer_size = 128Mmyisam_max_sort_file_size = 10Gmyisam_repair_threads = 1myisam_recover interactive_timeout = 120wait_timeout = 120 skip-name-resolveslave-skip-errors = 1032,1062,126,1114,1146,1048,1396将 mysql 添加到服务vi /etc/rc.d/init.d/mysqld输入以下内容#!/bin/shbasedir=/lvtao.net/software/mysqldatadir=/lvtao.net/data/mysql/dataservice_startup_timeout=900lockdir=‘/var/lock/subsys‘lock_file_path="$lockdir/mysql"mysqld_pid_file_path=/lvtao.net/data/mysql/mysql.pidif test -z "$basedir"then basedir=/usr/local/mysql bindir=/usr/local/mysql/bin if test -z "$datadir" then datadir=/usr/local/mysql/data fi sbindir=/usr/local/mysql/bin libexecdir=/usr/local/mysql/binelse bindir="$basedir/bin" if test -z "$datadir" then datadir="$basedir/data" fi sbindir="$basedir/sbin" libexecdir="$basedir/libexec"fidatadir_set=lsb_functions="/lib/lsb/init-functions"if test -f $lsb_functions ; then . $lsb_functionselse log_success_msg() { echo " SUCCESS! $@" } log_failure_msg() { echo " ERROR! $@" }fi PATH="/sbin:/usr/sbin:/bin:/usr/bin:$basedir/bin"export PATH mode=$1 # start or stop [ $# -ge 1 ] && shift other_args="$*" # uncommon, but needed when called from an RPM upgrade action # Expected: "--skip-networking --skip-grant-tables" # They are not checked here, intentionally, as it is the resposibility # of the "spec" file author to give correct arguments only. case `echo "testing\c"`,`echo -n testing` in *c*,-n*) echo_n= echo_c= ;; *c*,*) echo_n=-n echo_c= ;; *) echo_n= echo_c=‘\c‘ ;;esac parse_server_arguments() { for arg do case "$arg" in --basedir=*) basedir=`echo "$arg" | sed -e ‘s/^[^=]*=//‘` bindir="$basedir/bin" if test -z "$datadir_set"; then datadir="$basedir/data" fi sbindir="$basedir/sbin" libexecdir="$basedir/libexec" ;; --datadir=*) datadir=`echo "$arg" | sed -e ‘s/^[^=]*=//‘` datadir_set=1 ;; --pid-file=*) mysqld_pid_file_path=`echo "$arg" | sed -e ‘s/^[^=]*=//‘` ;; --service-startup-timeout=*) service_startup_timeout=`echo "$arg" | sed -e ‘s/^[^=]*=//‘` ;; esac done} wait_for_pid () { verb="$1" # created | removed pid="$2" # process ID of the program operating on the pid-file pid_file_path="$3" # path to the PID file. i=0 avoid_race_condition="by checking again" while test $i -ne $service_startup_timeout ; do case "$verb" in ‘created‘) # wait for a PID-file to pop into existence. test -s "$pid_file_path" && i=‘‘ && break ;; ‘removed‘) # wait for this PID-file to disappear test ! -s "$pid_file_path" && i=‘‘ && break ;; *) echo "wait_for_pid () usage: wait_for_pid created|removed pid pid_file_path" exit 1 ;; esac # if server isn‘t running, then pid-file will never be updated if test -n "$pid"; then if kill -0 "$pid" 2>/dev/null; then : # the server still runs else # The server may have exited between the last pid-file check and now. if test -n "$avoid_race_condition"; then avoid_race_condition="" continue # Check again. fi # there‘s nothing that will affect the file. log_failure_msg "The server quit without updating PID file ($pid_file_path)." return 1 # not waiting any more. fi fi echo $echo_n ".$echo_c" i=`expr $i + 1` sleep 1 done if test -z "$i" ; then log_success_msg return 0 else log_failure_msg return 1 fi} # Get arguments from the my.cnf file,# the only group, which is read from now on is [mysqld]if test -x ./bin/my_print_defaultsthen print_defaults="./bin/my_print_defaults"elif test -x $bindir/my_print_defaultsthen print_defaults="$bindir/my_print_defaults"elif test -x $bindir/mysql_print_defaultsthen print_defaults="$bindir/mysql_print_defaults"else # Try to find basedir in /etc/my.cnf conf=/etc/my.cnf print_defaults= if test -r $conf then subpat=‘^[^=]*basedir[^=]*=\(.*\)$‘ dirs=`sed -e "/$subpat/!d" -e ‘s//\1/‘ $conf` for d in $dirs do d=`echo $d | sed -e ‘s/[ ]//g‘` if test -x "$d/bin/my_print_defaults" then print_defaults="$d/bin/my_print_defaults" break fi if test -x "$d/bin/mysql_print_defaults" then print_defaults="$d/bin/mysql_print_defaults" break fi done fi # Hope it‘s in the PATH ... but I doubt it test -z "$print_defaults" && print_defaults="my_print_defaults"fi ## Read defaults file from ‘basedir‘. If there is no defaults file there# check if it‘s in the old (depricated) place (datadir) and read it from there# extra_args=""if test -r "$basedir/my.cnf"then extra_args="-e $basedir/my.cnf"else if test -r "$datadir/my.cnf" then extra_args="-e $datadir/my.cnf" fifi parse_server_arguments `$print_defaults $extra_args mysqld server mysql_server mysql.server` ## Set pid file if not given#if test -z "$mysqld_pid_file_path"then mysqld_pid_file_path=$datadir/`hostname`.pidelse case "$mysqld_pid_file_path" in /* ) ;; * ) mysqld_pid_file_path="$datadir/$mysqld_pid_file_path" ;; esacfi case "$mode" in ‘start‘) # Start daemon # Safeguard (relative paths, core dumps..) cd $basedir echo $echo_n "Starting MySQL" if test -x $bindir/mysqld_safe then # Give extra arguments to mysqld with the my.cnf file. This script # may be overwritten at next upgrade. $bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args >/dev/null 2>&1 & wait_for_pid created "$!" "$mysqld_pid_file_path"; return_value=http://www.mamicode.com/$?"$lockdir" then touch "$lock_file_path" fi exit $return_value else log_failure_msg "Couldn‘t find MySQL server ($bindir/mysqld_safe)" fi ;; ‘stop‘) # Stop daemon. We use a signal here to avoid having to know the # root password. if test -s "$mysqld_pid_file_path" then mysqld_pid=`cat "$mysqld_pid_file_path"` if (kill -0 $mysqld_pid 2>/dev/null) then echo $echo_n "Shutting down MySQL" kill $mysqld_pid # mysqld should remove the pid file when it exits, so wait for it. wait_for_pid removed "$mysqld_pid" "$mysqld_pid_file_path"; return_value=http://www.mamicode.com/$?"MySQL server process #$mysqld_pid is not running!" rm "$mysqld_pid_file_path" fi # Delete lock for RedHat / SuSE if test -f "$lock_file_path" then rm -f "$lock_file_path" fi exit $return_value else log_failure_msg "MySQL server PID file could not be found!" fi ;; ‘restart‘) # Stop the service and regardless of whether it was # running or not, start it again. if $0 stop $other_args; then $0 start $other_args else log_failure_msg "Failed to stop running server, so refusing to try to start." exit 1 fi ;; ‘reload‘|‘force-reload‘) if test -s "$mysqld_pid_file_path" ; then read mysqld_pid < "$mysqld_pid_file_path" kill -HUP $mysqld_pid && log_success_msg "Reloading service MySQL" touch "$mysqld_pid_file_path" else log_failure_msg "MySQL PID file could not be found!" exit 1 fi ;; ‘status‘) # First, check to see if pid file exists if test -s "$mysqld_pid_file_path" ; then read mysqld_pid < "$mysqld_pid_file_path" if kill -0 $mysqld_pid 2>/dev/null ; then log_success_msg "MySQL running ($mysqld_pid)" exit 0 else log_failure_msg "MySQL is not running, but PID file exists" exit 1 fi else # Try to find appropriate mysqld process mysqld_pid=`pidof $libexecdir/mysqld` # test if multiple pids exist pid_count=`echo $mysqld_pid | wc -w` if test $pid_count -gt 1 ; then log_failure_msg "Multiple MySQL running but PID file could not be found ($mysqld_pid)" exit 5 elif test -z $mysqld_pid ; then if test -f "$lock_file_path" ; then log_failure_msg "MySQL is not running, but lock file ($lock_file_path) exists" exit 2 fi log_failure_msg "MySQL is not running" exit 3 else log_failure_msg "MySQL is running but PID file could not be found" exit 4 fi fi ;; *) # usage basename=`basename "$0"` echo "Usage: $basename {start|stop|restart|reload|force-reload|status} [ MySQL server options ]" exit 1 ;;esac exit 0赋予权限chmod +x /etc/init.d/mysqldservice mysqld start用root账户登录并作简单的安全设置,键入以下代码后直接回车:/lvtao.net/software/mysql/bin/mysql -uroot -p1. 修改 root 密码UPDATE mysql.user SET Password=password(‘your password here‘) WHERE User=‘root‘;2. 删除无名用户DELETE FROM mysql.user WHERE User=‘‘;3. 删除root远程访问DELETE FROM mysql.user WHERE User=‘root‘ AND Host NOT IN (‘localhost‘, ‘127.0.0.1‘, ‘::1‘);4. 删除 “test” 数据库DROP database test;5. 立即生效并退出MYSQL命令窗体FLUSH PRIVILEGES;QUIT;五、安装 php① 安装 php 所需的依赖库tar zxvf libmcrypt-2.5.8.tar.gzcd libmcrypt-2.5.8/./configuremakemake install/sbin/ldconfigcd libltdl/./configure --enable-ltdl-installmakemake installcd ../../ tar zxvf mhash-0.9.9.9.tar.gzcd mhash-0.9.9.9/./configuremakemake installcd ../ tar zxvf mcrypt-2.6.8.tar.gzcd mcrypt-2.6.8/export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH./configuremakemake installcd ../编辑 ld.so.conf:vi /etc/ld.so.conf在最下面添加:/usr/lib/usr/lib64然后:ldconfig② 安装 phptar zxvf php-5.5.12.tar.gzcd php-5.5.12/export DYLD_LIBRARY_PATH="/lvtao.net/software/mysql/lib/:/lib/:/usr/lib/:/usr/local/lib:/lib64/:/usr/lib64/:/usr/local/lib64"export LD_LIBRARY_PATH="/lvtao.net/software/mysql/lib/:/lib/:/usr/lib/:/usr/local/lib:/lib64/:/usr/lib64/:/usr/local/lib64"ln -s /lvtao.net/software/mysql/lib/libmysqlclient.so.18 /usr/lib64/libmysqlclient.so.18./configure --prefix=/lvtao.net/software/php --with-config-file-path=/lvtao.net/software/php/etc --with-mysql=/lvtao.net/software/mysql --with-mysqli=/lvtao.net/software/mysql/bin/mysql_config --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-fpm --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-opcache --with-pdo-mysql --enable-maintainer-ztsmakemake install cp php.ini-development /lvtao.net/software/php/etc/php.inicd ../③ 安装 php 扩展tar zxvf memcache-2.2.7.tgzcd memcache-2.2.7//lvtao.net/software/php/bin/phpize./configure --with-php-config=/lvtao.net/software/php/bin/php-configmakemake installcd ../ tar zxvf ImageMagick-6.8.9-1.tar.gzcd ImageMagick-6.8.9-1/./configuremakemake installcd ../ tar zxvf imagick-3.1.2.tgzcd imagick-3.1.2//lvtao.net/software/php/bin/phpize./configure --with-php-config=/lvtao.net/software/php/bin/php-configmakemake installcd ../ sed -i ‘s#; extension_dir = "./"#extension_dir = "/lvtao.net/software/php/lib/php/extensions/no-debug-zts-20121212/"\nextension = "memcache.so"\n#g‘ /lvtao.net/software/php/etc/php.inised -i "s#;date.timezone =#date.timezone = Asia/Shanghai#g" /lvtao.net/software/php/etc/php.inised -i "s#;cgi.fix_pathinfo=1#cgi.fix_pathinfo=0#g" /lvtao.net/software/php/etc/php.ini sed -i "s#expose_php = On#expose_php = Off#g" /lvtao.net/software/php/etc/php.inised -i "s#;error_log = php_errors.log#error_log=/lvtao.net/logs/php_scripts_error.log#g" /lvtao.net/software/php/etc/php.inised -i "s#allow_url_fopen = On#allow_url_fopen = Off#g" /lvtao.net/software/php/etc/php.inised -i "s#sql.safe_mode=Off#sql.safe_mode=On#g" /lvtao.net/software/php/etc/php.inised -i "s#max_input_time = 60#max_input_time = 30#g" /lvtao.net/software/php/etc/php.inised -i "s#disable_functions =#disable_functions = exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source#g" /lvtao.net/software/php/etc/php.ini编辑 /lvtao.net/software/php/etc/php.ini 在最底部添加以下内容:zend_extension=/lvtao.net/software/php/lib/php/extensions/no-debug-zts-20121212/opcache.soopcache.memory_consumption=128opcache.interned_strings_buffer=8opcache.max_accelerated_files=4000opcache.revalidate_freq=60opcache.fast_shutdown=1opcache.enable_cli=1vi /lvtao.net/software/php/etc/php-fpm.conf输入以下内容[www]user = wwwgroup = wwwlisten = 127.0.0.1:9000#listen = /tmp/php-cgi.sockpm = staticpm.max_children = 35pm.max_requests = 256pm.process_idle_timeout = 30srlimit_files = 65535env[TMP] = /tmp/env[TMPDIR] = /tmp/env[TEMP] = /tmp/php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f admin@bugxm.comphp_admin_value[open_basedir] = /lvtao.net/htdocs/:/tmp/:/var/tmp:/proc/php_admin_value[session.save_path] = /tmp/php_admin_value[upload_tmp_dir] = /tmp/slowlog = /lvtao.net/software/php/var/log/$pool.logrequest_slowlog_timeout = 3sphp_admin_value[open_basedir] = /lvtao.net/htdocs/:/tmp/:/var/tmp:/proc/添加 php-fpm 到服务cp /lvtao.net/resource/php-5.5.12/sapi/fpm/init.d.php-fpm /etc/rc.d/init.d/php-fpmchmod +x /etc/rc.d/init.d/php-fpmservice php-fpm start开放必要端口/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT/etc/rc.d/init.d/iptables save设置开机自动启动服务vi /etc/rc.localulimit -SHn 65535service php-fpm startservice nginx startservice mysqld start配置最大文件数,最下面追加vi /etc/security/limits.conf* soft nofile 65535* hard nofile 65535
tengine2+mysql-5.6+php5.5 Linux 服务器环境架构
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。