Debian+Nginx+PHP.doc_第1页
Debian+Nginx+PHP.doc_第2页
Debian+Nginx+PHP.doc_第3页
Debian+Nginx+PHP.doc_第4页
Debian+Nginx+PHP.doc_第5页
免费预览已结束,剩余14页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Debian+Nginx+PHP(FastCGI)+MySQLLNMPDebian5Debian 5/2010_05_1056.htmlSSHapt-get install sshcat /proc/versionLinux version 2.6.26-2-686 (Debian 2.6.26-21lenny4) () (gcc version 4.1.3 20080704 (prerelease) (Debian 4.1.2-25) #1 SMP Tue Mar 9 17:35:51 UTC 2010cat /etc/issueDebian GNU/Linux 5.0 n luname -aLinux nginx 2.6.26-2-686 #1 SMP Tue Mar 9 17:35:51 UTC 2010 i686 GNU/Linuxfreetotal used free shared buffers cachedMem: 256400 70700 185700 0 7256 46400-/+ buffers/cache: 17044 239356Swap: 409616 0 409616mysql apachenetstat -ntlpActive Internet connections (only servers)Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program nametcp 0 0 :47074 :* LISTEN 1977/rpc.statdtcp 0 0 :111 :* LISTEN 1966/portmaptcp 0 0 :22 :* LISTEN 3036/sshdtcp 0 0 :25 :* LISTEN 2453/exim4tcp 0 0 :6010 :* LISTEN 3046/0tcp6 0 0 :22 :* LISTEN 3036/sshdtcp6 0 0 :1:6010 :* LISTEN 3046/0DebainLNMPapt-get install build-essential libncurses5-dev libfreetype6-dev libxml2-dev libssl-dev libcurl4-openssl-dev libjpeg62-dev libpng12-dev libfreetype6-dev libsasl2-dev libpcre3-dev autoconf libperl-dev20090414 mkdir /root/softcd /root/softvim down.sh wget http:/sysoev.ru/nginx/nginx-0.8.36.tar.gzwget /get/php-5.2.13.tar.gz/from/this/mirrorwget /downloads/php-5.2.13-fpm-0.5.13.diff.gzwget /get/Downloads/MySQL-5.5/mysql-5.5.3-m3.tar.gz/from//wget /pub/gnu/libiconv/libiconv-1.13.tar.gzwget /mcrypt/libmcrypt-2.5.8.tar.gz?modtime=1171868460&big_mirror=0wget /mcrypt/mcrypt-2.6.8.tar.gz?modtime=1194463373&big_mirror=0wget /get/memcache-2.2.5.tgzwget /mhash/mhash-.tar.gz?modtime=1175740843&big_mirror=0wget ftp:/ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.01.tar.gzwget /source/0.9.6/eaccelerator-0.9.6.tar.bz2wget /get/PDO_MYSQL-1.0.2.tgzwget /soft/linux/nginx_php/imagick/ImageMagick.tar.gzwget /get/imagick-2.3.0.tgzchmod +x down.sh./down.sh PHP 5.2.13FastCGI/root/soft1PHP 5.2.13tar zxvf libiconv-1.13.tar.gzcd libiconv-1.13./configure Cprefix=/usr/localmake & make installcd .tar zxvf libmcrypt-2.5.8.tar.gzcd libmcrypt-2.5.8/sbin/ldconfigcd libltdl/./configure Cenable-ltdl-installmake & make installcd ./configuremake & make installcd .tar zxvf mhash-.tar.gzcd mhash-/./configuremake & make installcd ./ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.laln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.soln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.aln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.laln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.soln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-configtar zxvf mcrypt-2.6.8.tar.gzcd mcrypt-2.6.8/sbin/ldconfig./configuremake & make installcd ./2MySQL 5.5.2-m2/usr/sbin/groupadd mysql/usr/sbin/useradd -g mysql mysqltar zxvf mysql-5.5.3-m3.tar.gzcd mysql-5.5.3-m3/./configure Cprefix=/usr/local/webserver/mysql/ Cenable-assembler Cwith-extra-charsets=complex Cenable-thread-safe-client Cwith-big-tables Cwith-readline Cwith-ssl Cwith-embedded-server Cenable-local-infile Cwith-plugins=partition,innobase,myisammrgmake & make installchmod +w /usr/local/webserver/mysqlchown -R mysql:mysql /usr/local/webserver/mysqlcd ./MySQLmkdir -p /data0/mysql/3306/data/mkdir -p /data0/mysql/3306/binlog/mkdir -p /data0/mysql/3306/relaylog/chown -R mysql:mysql /data0/mysql/mysql/usr/local/webserver/mysql/bin/mysql_install_db Cbasedir=/usr/local/webserver/mysql Cdatadir=/data0/mysql/3306/data Cuser=fvi /data0/mysql/3306/fclientcharacter-set-server = utf8port = 3306socket = /tmp/mysql.sockmysqldcharacter-set-server = utf8replicate-ignore-db = mysqlreplicate-ignore-db = testreplicate-ignore-db = information_schemauser = mysqlport = 3306socket = /tmp/mysql.sockbasedir = /usr/local/webserver/mysqldatadir = /data0/mysql/3306/datalog-error = /data0/mysql/3306/mysql_error.logpid-file = /data0/mysql/3306/mysql.pidopen_files_limit = 10240back_log = 600max_connections = 5000max_connect_errors = 6000table_cache = 614external-locking = FALSEmax_allowed_packet = 32Msort_buffer_size = 1Mjoin_buffer_size = 1Mthread_cache_size = 300#thread_concurrency = 8query_cache_size = 512Mquery_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 = /data0/mysql/3306/binlog/binlogbinlog_cache_size = 4Mbinlog_format = MIXEDmax_binlog_cache_size = 8Mmax_binlog_size = 1Grelay-log-index = /data0/mysql/3306/relaylog/relaylogrelay-log-info-file = /data0/mysql/3306/relaylog/relaylogrelay-log = /data0/mysql/3306/relaylog/relaylogexpire_logs_days = 30key_buffer_size = 256Mread_buffer_size = 1Mread_rnd_buffer_size = 16Mbulk_insert_buffer_size = 64Mmyisam_sort_buffer_size = 128Mmyisam_max_sort_file_size = 10Gmyisam_repair_threads = 1myisam_recoverinteractive_timeout = 120wait_timeout = 120skip-name-resolve#master-connect-retry = 10slave-skip-errors = 1032,1062,126,1114,1146,1048,1396#master-host = #master-user = username#master-password = password#master-port = 3306server-id = 1innodb_additional_mem_pool_size = 16Minnodb_buffer_pool_size = 512Minnodb_data_file_path = ibdata1:256M:autoextendinnodb_file_io_threads = 4innodb_thread_concurrency = 8innodb_flush_log_at_trx_commit = 2innodb_log_buffer_size = 16Minnodb_log_file_size = 128Minnodb_log_files_in_group = 3innodb_max_dirty_pages_pct = 90innodb_lock_wait_timeout = 120innodb_file_per_table = 0#log-slow-queries = /data0/mysql/3306/slow.log#long_query_time = 10mysqldumpquickmax_allowed_packet = 32MMySQLshellvi /data0/mysql/3306/mysql#!/bin/shmysql_port=3306mysql_username=adminmysql_password=12345678function_start_mysql()printf Starting MySQLn/bin/sh /usr/local/webserver/mysql/bin/mysqld_safe Cdefaults-file=/data0/mysql/$mysql_port/f 2&1 /dev/null &function_stop_mysql()printf Stoping MySQLn/usr/local/webserver/mysql/bin/mysqladmin -u $mysql_username -p$mysql_password -S /tmp/mysql.sock shutdownfunction_restart_mysql()printf Restarting MySQLnfunction_stop_mysqlsleep 5function_start_mysqlfunction_kill_mysql()kill -9 $(ps -ef grep bin/mysqld_safe grep $mysql_port awk printf $2)kill -9 $(ps -ef grep libexec/mysqld grep $mysql_port awk printf $2)if $1 = start ; thenfunction_start_mysqlelif $1 = stop ; thenfunction_stop_mysqlelif $1 = restart ; thenfunction_restart_mysqlelif $1 = kill ; thenfunction_kill_mysqlelseprintf Usage: /data0/mysql/$mysql_port/mysql startstoprestartkillnfishellchmod +x /data0/mysql/3306/mysql MySQL/data0/mysql/3306/mysql start MySql root()/usr/local/webserver/mysql/bin/mysqladmin -u root password 123456789 MySQL/usr/local/webserver/mysql/bin/mysql -u root -p -S /tmp/mysql.sock123456789mysqlSQLrootadmin12345678GRANT ALL PRIVILEGES ON *.* TO adminlocalhost IDENTIFIED BY 12345678;GRANT ALL PRIVILEGES ON *.* TO admin IDENTIFIED BY 12345678;quit;MySQL/data0/mysql/3306/mysql stop 3PHPFastCGItar zxvf php-5.2.13.tar.gzgzip -cd php-5.2.13-fpm-0.5.13.diff.gz | patch -d php-5.2.13 -p1cd php-5.2.13/./configure Cprefix=/usr/local/webserver/php Cwith-config-file-path=/usr/local/webserver/php/etc Cwith-mysql=/usr/local/webserver/mysql Cwith-mysqli=/usr/local/webserver/mysql/bin/mysql_config Cwith-iconv-dir=/usr/local Cwith-freetype-dir Cwith-jpeg-dir Cwith-png-dir Cwith-zlib Cwith-libxml-dir=/usr Cenable-xml Cdisable-rpath Cenable-discard-path Cenable-safe-mode Cenable-bcmath Cenable-shmop Cenable-sysvsem Cenable-inline-optimization Cwith-curl Cwith-curlwrappers Cenable-mbregex Cenable-fastcgi Cenable-fpm Cenable-force-cgi-redirect Cenable-mbstring Cwith-mcrypt Cwith-gd Cenable-gd-native-ttf Cwith-openssl Cwith-mhash Cenable-pcntl Cenable-sockets Cwith-ldap Cwith-ldap-sasl Cwith-xmlrpc Cenable-zip Cenable-soapmake ZEND_EXTRA_LIBS=-liconvmake installcp php.ini-dist /usr/local/webserver/php/etc/php.inicd ./4PHP5tar zxvf memcache-2.2.5.tgzcd memcache-2.2.5/usr/local/webserver/php/bin/phpize./configure Cwith-php-config=/usr/local/webserver/php/bin/php-configmake & make installcd ./tar jxvf eaccelerator-0.9.6.tar.bz2cd eaccelerator-0.9.6/usr/local/webserver/php/bin/phpize./configure Cenable-eaccelerator=shared Cwith-php-config=/usr/local/webserver/php/bin/php-configmake & make installcd ./tar zxvf PDO_MYSQL-1.0.2.tgzcd PDO_MYSQL-1.0.2/usr/local/webserver/php/bin/phpize./configure Cwith-php-config=/usr/local/webserver/php/bin/php-config Cwith-pdo-mysql=/usr/local/webserver/mysqlmake & make installcd ./tar zxvf ImageMagick.tar.gzcd ImageMagick-6.5.1-2/./configuremake & make installcd ./tar zxvf imagick-2.3.0.tgzcd imagick-2.3.0/usr/local/webserver/php/bin/phpize./configure Cwith-php-config=/usr/local/webserver/php/bin/php-configmake & make installcd ./5php.ini/usr/local/webserver/php/etc/php.iniextension_dir = ./extension_dir = /usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/extension = memcache.soextension = pdo_mysql.soextension = imagick.sooutput_buffering = Offoutput_buffering = On sed -i s#extension_dir = ./#extension_dir = /usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/nextension = memcache.sonextension = pdo_mysql.sonextension = imagick.son# /usr/local/webserver/php/etc/php.inised -i s#output_buffering = Off#output_buffering = On# /usr/local/webserver/php/etc/php.inised -i s#; always_populate_raw_post_data = On#always_populate_raw_post_data = On#g /usr/local/webserver/php/etc/php.ini6eAcceleratorPHPmkdir -p /usr/local/webserver/eaccelerator_cachevi /usr/local/webserver/php/etc/php.inieacceleratorzend_extension=/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.soeaccelerator.shm_size=64eaccelerator.cache_dir=/usr/local/webserver/eaccelerator_cacheeaccelerator.enable=1eaccelerator.optimizer=1eaccelerator.check_mtime=1eaccelerator.debug=0eaccelerator.filter=eaccelerator.shm_max=0eaccelerator.shm_ttl=3600eaccelerator.shm_prune_period=3600eaccelerator.shm_only=0press=1press_level=97/usr/sbin/groupadd www/usr/sbin/useradd -g www wwwmkdir -p /data0/htdocs/wwwchmod +w /data0/htdocs/wwwchown -R www:www /data0/htdocs/www8php-fpmphp-fpmPHPFastCGIphp.iniphp-cgirm -f /usr/local/webserver/php/etc/php-fpm.confvi /usr/local/webserver/php/etc/php-fpm.confNginx+PHP01PHPNginx 500All relative paths in this config are relative to phps install prefixPid file/usr/local/webserver/php/logs/php-fpm.pidError log file/usr/local/webserver/php/logs/php-fpm.logLog levelnoticeWhen this amount of php processes exited with SIGSEGV or SIGBUS 10 in a less than this interval of time, a graceful restart will be initiated.Useful to work around accidental curruptions in accelerators shared memory.1mTime limit on waiting childs reaction on signals from master5sSet to no to debug fpmyesName of pool. Used in logs and stats.defaultAddress to accept fastcgi requests on.Valid syntax is ip.ad.re.ss:port or just port or /path/to/unix/socket:9000Set listen(2) backlog-1Set permissions for unix socket, if one used.In Linux read/write permissions must be set in order to allow connections from web server.Many BSD-derrived systems allow connections regardless of permissions.0666Additional php.ini defines, specific to this pool of workers./usr/sbin/sendmail -t -i0Unix user of processeswwwUnix group of processeswwwProcess manager settingsSets style of controling worker process count.Valid values are static and apache-likestaticSets the limit on the number of simultaneous requests that will be served.Equivalent to Apache MaxClients directive.Equivalent to PHP_FCGI_CHILDREN environment in original php.fcgiUsed with any pm_style.128Settings group for apache-like pm styleSets the number of server processes created on startup.Used only when apache-like pm_style is selected20Sets the desired minimum number of idle server processes.Used only when apache-like pm_style is selected5Sets the desired maximum number of idle server processes.Used only when apache-like pm_style is selected35The timeout (in seconds) for serving a single request after which the worker process will be terminatedShould be used when max_execution_time ini option does not stop script execution for some reason0s means off0sThe timeout (in seconds) for serving of single request after which a php backtrace will be dumped to slow.log file0s means off0sThe log file for slow requestslogs/slow.logSet open file desc rli

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论