LNMMP
8941 단어 lnmmp
PHP(FAST-CGI):2.2.2.27
NGINX 기계
[root@localhost html]# cat /etc/nginx/nginx.conf |grep -v "#" |grep -v "^$"
user nginx;
worker_processes 2;
error_log /var/log/nginx/error.log debug;
worker_rlimit_nofile 51200;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
server {
listen 80;
resolver www.king.com;
server_name localhost;
add_header testserver $server_addr;
location / {
root /var/www/html;
index index.html index.htm;
}
location ~* \.(jpg|png|gif|jpeg|js|css)$ {
root /var/www/html;
}
location ~ \.php$ {
root /var/www/html;
fastcgi_pass 2.2.2.27:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
include fastcgi_params;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
PHP 설정:
[root@localhost ~]# cat /usr/local/php/etc/php-fpm.conf |grep -v ";" |grep -v "^$"
[global]
pid = /usr/local/php/var/run/php-fpm.pid
[www]
user = nobody
group = nobody
listen = 2.2.2.27:9000
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
[root@localhost ~]# cat /etc/php.ini |grep -v ";" |grep -v "^$"
[PHP]
extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/memcache.so
engine = On
short_open_tag = Off
asp_tags = Off
precision = 14
output_buffering = 4096
zlib.output_compression = Off
implicit_flush = Off
unserialize_callback_func =
serialize_precision = 17
disable_functions =
disable_classes =
zend.enable_gc = On
expose_php = On
max_execution_time = 30
max_input_time = 60
memory_limit = 128M
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
display_errors = Off
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
track_errors = Off
html_errors = On
variables_order = "GPCS"
request_order = "GP"
register_argc_argv = Off
auto_globals_jit = On
post_max_size = 8M
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
doc_root =
user_dir =
enable_dl = Off
file_uploads = On
upload_max_filesize = 2M
max_file_uploads = 20
allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 60
[CLI Server]
cli_server.color = On
[Date]
[filter]
[iconv]
[intl]
[sqlite]
[sqlite3]
[Pcre]
[Pdo]
[Pdo_mysql]
pdo_mysql.cache_size = 2000
pdo_mysql.default_socket=
[Phar]
[mail function]
SMTP = localhost
smtp_port = 25
mail.add_x_header = On
[SQL]
sql.safe_mode = Off
[ODBC]
odbc.allow_persistent = On
odbc.check_persistent = On
odbc.max_persistent = -1
odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1
[Interbase]
ibase.allow_persistent = 1
ibase.max_persistent = -1
ibase.max_links = -1
ibase.timestampformat = "%Y-%m-%d %H:%M:%S"
ibase.dateformat = "%Y-%m-%d"
ibase.timeformat = "%H:%M:%S"
[MySQL]
mysql.allow_local_infile = On
mysql.allow_persistent = On
mysql.cache_size = 2000
mysql.max_persistent = -1
mysql.max_links = -1
mysql.default_port =
mysql.default_socket =
mysql.default_host =
mysql.default_user =
mysql.default_password =
mysql.connect_timeout = 60
mysql.trace_mode = Off
[MySQLi]
mysqli.max_persistent = -1
mysqli.allow_persistent = On
mysqli.max_links = -1
mysqli.cache_size = 2000
mysqli.default_port = 3306
mysqli.default_socket =
mysqli.default_host =
mysqli.default_user =
mysqli.default_pw =
mysqli.reconnect = Off
[mysqlnd]
mysqlnd.collect_statistics = On
mysqlnd.collect_memory_statistics = Off
[OCI8]
[PostgreSQL]
pgsql.allow_persistent = On
pgsql.auto_reset_persistent = Off
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0
[Sybase-CT]
sybct.allow_persistent = On
sybct.max_persistent = -1
sybct.max_links = -1
sybct.min_server_severity = 10
sybct.min_client_severity = 10
[bcmath]
bcmath.scale = 0
[browscap]
[Session]
session.save_handler = files
session.use_cookies = 1
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.serialize_handler = php
session.gc_probability = 1
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.bug_compat_42 = Off
session.bug_compat_warn = Off
session.referer_check =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 0
session.hash_bits_per_character = 5
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
[MSSQL]
mssql.allow_persistent = On
mssql.max_persistent = -1
mssql.max_links = -1
mssql.min_error_severity = 10
mssql.min_message_severity = 10
mssql.compatability_mode = Off
mssql.secure_connection = Off
[Assertion]
[COM]
[mbstring]
[gd]
[exif]
[Tidy]
tidy.clean_output = Off
[soap]
soap.wsdl_cache_enabled=1
soap.wsdl_cache_dir="/tmp"
soap.wsdl_cache_ttl=86400
soap.wsdl_cache_limit = 5
[sysvshm]
[ldap]
ldap.max_links = -1
[mcrypt]
[dba]
[curl]
9 ls
8 ip r
6 service php-fpm restart
4 vi /usr/local/php/etc/php-fpm.conf
4 passwd -d root
4 dhclient
4 cd php-5.4.19
4 cd
3 rz -E
3 reboot
3 poweroff
3 make && make install
2 wget http://172.16.0.1/centos6.5.repo
2 vi /etc/ssh/sshd_config
2 vi /etc/php.ini
2 vi /etc/php.d/xcache.ini
2 /usr/local/php/bin/phpize
2 top
2 service sshd restart
2 ./configure --prefix=/usr/local/php --with-mysql=mysqlnd --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-openssl --enable-mbstring --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-sockets --enable-fpm --with-mcrypt --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-bz2
2 ./configure --help |grep "--with-bz2"
2 cd /etc/yum.repos.d/
1 yum -y install libmcrypt-devel
1 yum -y install bzip2-devel
1 yum instatll lrzsz -y
1 yum install openssl* -y
1 yum install lrzsz -y
1 yum install gcc* -y
1 vmstat 5 5
1 vmstat 5 1
1 vmstat 3 5
1 vmstat 3 2
1 vmstat 3 1
1 vmstat
1 vi /etc/ssh/sshfd
1 vi /etc/php.
1 touch /usr/local/php/var/run/php-fpm.pid
1 tar -x php-5.4.19.tar.bz2 -C /usr/local/
1 tar -x php-5.4.19.tar.bz2
1 tar xf xcache-3.1.0.tar.bz2
1 tar -xf php-5.4.19.tar.bz2
1 tar xf memcache-2.2.7.tgz
1 ss -tunl
1 service php-fpm stop
1 service php-fpm start
1 sar -u
1 sar -r
1 sar
1 rz
1 rpm -qa libmcrypt-devel
1 rpm -qa bzip2-devel
1 rm -rf *
1 ps -ef |grep 9000
1 netstat -ntlp|grep 9000
1 netstat -ntlp
1 mkdir /etc/php.d
1 man vmstat
1 man tar
1 man sar
1 lw
1 kill -l php-fpm
1 killall php-fpm
1 killall dhclient
1 iostat 1
1 iostat
1 history
1 dhcklient
1 cp xcache.ini /etc/php.d/
1 cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
1 cp sapi/fpm/init.d.php-fpm /etc/rc.d/init.d/php-fpm
1 cp sapi/fpm/init.d.php-fpm /etc/rc.d/init.d/php-fpm
1 cp php.ini-production /etc/php.ini
1 cp php.ini-production /etc/php.ini
1 ./configure --prefix=/usr/local/php --with-mysql=mysqlnd --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-openssl --enable-mbstring --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-sockets --enable-fpm --with-mcrypt --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d
1 ./configure --prefix=/usr/local/php --with-mysql=mysqlnd --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-openssl --enable-mbstring --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-sockets --enable-fpm --with-mcrypt --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d
1 ./configure --help |grep "\-\-with\-bz2"
1 ./configure --help |grep "\-\-with-bz2"
1 ./configure --help |grep '\-\-with\-bz2'
1 ./configure --help |grep '\-\-with-bz2'
1 ./configure --help |grep '\--with-bz2'
1 ./configure --help |grep '--with-bz2'
1 ./configure --help |grep --with-bz2
1 ./configure --help |grep prefix
1 ./configure --help
1 ./configure --help
1 ./configure --enable-xcache --with-php-config=/usr/local/php/bin/php-config
1 ./configure --enable-xcache --with-php-config=/usr/local/php/bin/php-config
1 ./configure --enable-memcache --with-php-config=/usr/local/php/bin/php-config
1 ./config --help
1 ./config -help
1 chmod +x /etc/rc.d/init.d/php-fpm
1 chkconfig php-fpm on
1 chkconfig --add php-fpm
1 cd xcache-3.1.0
1 cd /usr/local/
1 cd memcache-2.2.7