lnmpp==linux nginx mysqld php postgresql

  • - apt-get clean
  • apt-get update
  • apt-get upgrade -y
  • apt-get install -y mysql-server
  • apt-get install -y build-essential libpcre++-dev libssl-dev libxslt1-dev libbz2-dev libmcrypt-dev libc-client2007e-dev libcurl4-gnutls-dev libreadline-dev libedit-dev libgmp3-dev libvpx-dev libjpeg62-dev libpng12-dev libxpm-dev libfreetype6-dev libt1-dev libgeoip-dev
  • wget -c http://nginx.org/download/nginx-1.2.4.tar.gz
  • wget -c http://www.php.net/distributions/php-5.4.7.tar.bz2
  • wget -c http://ftp.postgresql.org/pub/source/v9.2.1/postgresql-9.2.1.tar.bz2
  • tar xf nginx*gz
  • tar xf php*bz2
  • tar xf postgresql*bz2
  • rm -f nginxgz phpbz2 postgresql*bz2
  • mv nginx-* nginx
  • mv php-* php
  • mv postgresql-* postgresql
  • cd ./nginx
  • ./configure --group=nginx --user=nginx --with-ipv6 --with-file-aio --with-select_module --with-http_xslt_module --with-http_geoip_module --with-poll_module --with-rtsig_module --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_stub_status_module --with-mail --with-mail_ssl_module
  • make
  • make install
  • groupadd nginx
  • useradd -g nginx nginx
  • cd ../postgresql
  • ./configure --with-openssl --with-libxslt --with-libxml
  • make
  • make install
  • groupadd postgres
  • useradd -g postgres postgres
  • mkdir /home/postgres
  • chown postgres:postgres /home/postgres
  • chmod 0777 /home/postgres
  • mkdir /usr/local/pgsql/data
  • chown postgres:postgres /usr/local/pgsql/data
  • chmod 0777 /usr/local/pgsql/data
  • su postgres -c 'cd /home/postgres;/usr/local/pgsql/bin/initdb -E UTF8 -D /usr/local/pgsql/data;'
  • cd ../php
  • ./configure --enable-fpm --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-sockets --enable-mbstring --enable-bcmath --enable-ftp --enable-zip --enable-wddx --enable-pcntl --enable-soap --enable-shmop --enable-calendar --enable-exif --with-bz2 --with-zlib --with-openssl --with-gettext --with-mcrypt --with-gd --with-vpx-dir --with-jpeg-dir --with-png-dir --with-xpm-dir --with-freetype-dir --with-t1lib --with-imap --with-kerberos --with-imap-ssl --with-curl --with-curlwrappers --with-xmlrpc --with-xsl --with-readline --with-libedit --with-gmp --with-ldap --with-pgsql --with-pdo-pgsql --enable-mysqlnd --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-mysql-sock=/var/run/mysqld/mysqld.sock
  • make
  • make install
  • groupadd wwwroot
  • useradd -g wwwroot wwwroot
  • cp ./sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
  • chmod +x /etc/init.d/php-fpm
  • cp ./php.ini-pro* /usr/local/lib/php.ini
  • cp /usr/local/etc/php-fpm.conf.default /usr/local/etc/php-fpm.conf
  • mkdir /home/wwwroot
  • chown wwwroot:wwwroot /home/wwwroot
  • chmod 0777 /home/wwwroot
  • cd ../
  • 复制代码

以上命令执行完毕环境基本算ok了,接下来就是配置php-fpm,nginx,postgresql了。
我自己的环境还在做各种测试,后天我来总结一下。