Lnmp source code installation and simple configuration-waited nginx software:
A: openssl-1.0.1r.tar.gz tar zxf openssl-1.0.1r.tar.gzb: pcre-8.32.tar.gz tar zxf openssl-1.0.1r.tar.gz cd pcre-8.32. /configure -- prefix =/usr/local/lanmp/lib/pcre # installation directory make & make installc: zlib-1.2.7.tar.gz tar zxf zlib-1.2.7.tar.gz cd zlib-1.2.7. /configure -- prefix =/usr/local/lanmp/lib/zlib # installation directory make & make installd: nginx-1.8.0.tar.gz tar zxf nginx-1.8.0.tar.gz cd nginx # -- user = www-data specify user # -- group = www-data specify user group -- prefix =/usr/local/lanmp/nginx -- with-http_ssl_module # Enable HTTP SSL module, support HTTPS requests -- with-openssl =/usr/local/src/openssl-1.0.1r # Source code path -- with-zlib =/usr/local/src/zlib-1.2.7 # Source code path --- pcre =/usr/local/src/pcre-8.32 # Source code path -- conf-path =/etc/lanmp/nginx. conf # path of the configuration file make & make install/usr/local/lanmp/nginx/sbin/nginx # start nginx, you can also add cp/usr/local/lanmp/nginx/sbin/nginx/etc/init. d/
Simple nginx configuration:
Global: worker_processes 2; # Number of processes worker_rlimit_nofile 65535; # maximum number of open files events {use epoll; # event model worker_connections 10240; # maximum number of connections for each process} http: keepalive_timeout 0; # timeout gzip on; # Support for gzip_buffers 16 8 K; # apply for memory size gzip_comp_level 6; # compression level gzip_min_length 4 K; # The minimum number of bytes that can be compressed gzip_types text/html, text/css; # compression type gzip_vary on; # determine whether to compress the server according to the http header: location ~ . * (Gif | jpg | png | bmp | swf) $ {# cache type expires 1d; # cache time}
Mysql software:
Mysql-5.6.15.tar.gztar zxf mysql-5.6.15.tar.gzcd mysql-5.6.15 # The following package must be installed, otherwise cmake will have errors yum-y install ncurses-devel or apt-get install libncurses5-dev cmake. \-DCMAKE_INSTALL_PREFIX =/usr/local/lanmp/mysql \-DMYSQL_DATADIR =/usr/local/lanmp/mysql/data \ # Database storage path-DSYSCONFDIR =/etc/lanmp/mysql \ # conf path-example = 1 \ # MYISAM engine support-DWITH_INNOBASE_STORAGE_ENGINE = 1 \ # INNODB engine support-example = 1 \ # MEMORY engine support-DWITH_READLINE = 1 \-DMYSQL_UNIX_ADDR =/ var/lib/mysql. sock \-partition = 3306 \-DENABLED_LOCAL_INFILE = 1 \ # Allow local data import-partition = 1 \ # Partition Support-DEXTRA_CHARSETS = all \-DDEFAULT_CHARSET = utf8 \-DDEFAULT_COLLATION = utf8_general_ci # Character set make & make installgroupadd mysql # Create a mysql User Group useradd-r-g mysql # Create a mysql User, belong to the mysql User Group, and this user is not displayed on the logon interface (the role of the-r parameter) chown-R mysql: mysql/usr/local/lanmp/mysqlcd/usr/local/lanmp/mysql/scripts. /mysql_install_db -- user = mysql -- basedir =/usr/local/lanmp/mysql -- datadir =/usr/local/lanmp/mysql # initialize and install cd/usr/local/lanmp/mysql /support-files # register the cp mysql service. server/etc/init. d/mysqld # use the default configuration file cp my-default.cnf/etc/lanmp/mysql/my. cnf # start service mysqld start/usr/local/lanmp/mysql/bin/mysqladmin-u root password "123456" # set the password
Simple mysql configuration:
innodb_buffer_pool_size = 128Mport = 3306server_id = 1socket = /var/lib/mysql/mysql.sockback_log = 384key_buffer_size = 128Mmax_connections = 500thread_concurrency = 2
Php software:
A: freetype-2.4.10.tarb: jpegsrc.v8b.tar.gz c: libpng-1.5.14.tar.gzd: libxml2-2.9.0.tar.gze: the libiconv-1.7.tar.gz is also unzipped and installed/usr/local/lanmp/lib/f: php-7.0.3.tar.gz tar zxf php-7.0.3.tar.gz cd php-7.0.3. /configure -- prefix =/usr/local/lanmp/fcgphp -- with-config-file-path =/etc/lanmp/fcgphp. ini -- with-mysqli =/usr/local/lanmp/mysql/bin/mysql_config # mysqli -- enable-mbstring -- with-freetype-dir =/usr/local/lanmp/lib/ freetype -- with-jpeg-dir =/usr/local/lanmp/lib/libjpeg # jpg -- with-png-dir =/usr/local/lanmp/lib/libpng # png -- with-zlib-dir =/usr/local/lanmp/lib/zlib -- with-libxml-dir =/usr/local/lanmp/lib/libxml -- enable-xml # xml support -- with-iconv-dir =/usr/local/lanmp/lib/libiconv # Support for character set conversion -- enable-fpm # Support for fcgi -- with-pdo-mysql =/usr/local /lanmp/mysql # pdo support # -- with-apxs2 =/usr/local/lanmp/apache2/bin/apxs # apache module make & make install cp php. ini-development/etc/lanmp/fcgphp. ini
Cd/usr/local/lanmp/fcgphp/etc/php-fpm.d/
Cp www. conf. default www. conf # configuration
# Start
/Usr/local/lanmp/fcgphp/sbin/php-fpm
Php-fpm configuration parameters
Pm = dynamic # process mode, static is static pm. max_children = 300 # maximum number of processes pm. start_servers = 20 # process pm created at startup. min_spare_servers = 5 # minimum number of processes pm. max_spare_servers = 35 # maximum number of idle processes