Install and configure nginx + postgresql + php + memcached + apc in centos

Source: Internet
Author: User
Tags apc zts


To install nginx + postgresql + php + memcached + apc in centos, follow these steps: install the software package www.2cto.com 01nginx1. 0.1302 03 wget http://nginx.org/download/nginx-1.0.13.tar.gz04 051_sql9. 1.206 07 wget http://ftp.postgresql.org/pub/source/v9.1.2/postgresql-9.1.2.tar.gz08 09php5. 3.1010 11 wget http://cn2.php.net/get/php-5.3.10.tar.gz/from/ar.php.net/mirror12 13 memcache 1.4.1314 15 wget http://code.google.com/p/memcached/downl Oads/detail? Name‑memcached-1.4.13.tar.gz & can = 2 & q = 16 17 memcached php plug-in memcache1.518 19 wget http://pecl.php.net/get/memcache-1.5.tgz20 21apc php plug-in apc3.1.922 23 wget policyum update disable selinux 2. nginx installation: install pcreyum install pcre * unzip the compilation: 1tar-zxvf nginx-1.0.13.tar.gz2 3cd nginx-1.0.134 5. /configure -- prefix =/usr/local/nginx -- with-http_flv_module -- with-http_stub_status_module -- With-pcre6 www.2cto.com 7 make & make install01yum install jpeg * 02 03yum install libjpeg * 04 05yum install libpng * 06 07yum install iconv * 08 09yum install libiconv * 10 11yum install freetype * 12 13yum install gd * change the configuration file: vi/usr/local/nginx/conf/nginx. conf remove the comment below: www.2cto.com 01 location ~ \. Php ${02 03 root html; 04 05 fastcgi_pass 127.0.0.1: 9000; 06 07 fastcgi_index index. php; 08 09 fastcgi_param SCRIPT_FILENAME/usr/local/nginx/html $ fastcgi_script_name; 10 11 include fastcgi_params; 12 13} 45 rows add index. after completing these two operations, php starts nginx/usr/local/nginx/sbin/nginx 3. postgresql installation readline yum install readline * unzip the compilation: 1tar-zxvf postgresql-9.1.2.tar.gz2 3cd postgresql-9.1.24 5. /configure -- prefix =/usr/l Ocal/postgresql6 www.2cto.com 7 make & make installpostgresql configuration: 01 useradd partition 02 03 mkdir/home/postgre/data04 05 chown-R postgre: postgre/usr/local/postgresql/06 07 chown-R postgre: postgre/home/000008 09su 000010/usr/local/postgresql/bin/initdb -- encoding = utf8-D/home/postgre/data4.php install the required software package www.2cto.com 01yum install jpeg * 02 03yum install libjpeg * 04 05yum install libpng * 06 07yum in Stall iconv * 08 09yum install libiconv * 10 11yum install freetype * 12 13yum install gd * unzip compile 01tar-zxvf php-5.3.10.tar.gz02 03cd php-5.3.1004 05. /configure -- prefix =/usr/local/php -- with-pgsql =/usr/local/postgresql -- with-06 07gd =/usr -- with-jpeg-dir =/usr -- with-png-dir =/usr -- with-zlib -- enable-mb08 09 string -- with-freetype-dir -- with-iconv -- enable-fpm10 11 make & make install copy php. ini www.2cto.com 1 Cp php. ini-production/usr/local/php/lib/php. ini2 3cd/usr/local/php/etc/4 5mv php-fpm.conf.default php-fpm.confvim php-fpm.conf this configuration can be started by default php-fpm/usr/local/php/sbin/php-fpm 5. memcached install required software package: yum install libevent * unzip the compilation: 1tar-zxvf memcached-1.4.13.tar.gz2 3cd memcached-1.4.134 5. /configure -- prefix =/usr/local/memcached6 7 make & make install6.memcachedphp plug-in install and install the required software package yum install Utoconf decompress and compile www.2cto.com 1tar-zxvf memcache-1.5.tgz2 3cd memcache-1.54 5/usr/local/php/bin/phpize6 7. /configure -- enable-memcache -- with-php-config =/usr/local/php/bin/php-config -- with-zlib-dir configure memcached and php. ini/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/vim/usr/local/php/lib/php. ini find extension_dir change path to/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/Add extensio N = memcache. so start memcached:/usr/local/memcached/bin/memcached-d m 20-u root-l localhost-p 11211 www.2cto.com start Description:-d option is to start a daemon process, -m is the amount of memory allocated to Memcache. The unit is MB. Here I am 10 MB.-u is the user who runs Memcache. Here I am root, -l is the IP address of the listening server. If there are multiple IP addresses, I have specified the Server IP address 192.168.0.200 here,-p is the port for setting the Memcache listening, and I have set 12000 here, it is best to set a port above 1024. The "-c" option is the maximum number of concurrent connections. The default value is 1024. I have set it to 256 Based on the load of your server, -P is the pid file for saving Memcache, Which is saved in/tmp/memcached. pid 7. installation of apc plug-in Press compile to install 1tar-zxvf APC-3.1.9.tgz2 3cd APC-3.1.94 5/usr/local/php/bin/phpize6 7. /configure -- enable-apc-mmap -- with-php-config =/usr/local/php/bin/php-config8 9 make & make install configure php. ini www.2cto.com ls/usr/local/php/lib/php/extension/ no-debug-non-zts-20090626/vim/usr/local/php/lib/php. ini in extension = memcache. add extension = apc under so. so and apc. enabled = 1apc. cache_by_default = onapc. shm_se Gments = 1apc. shm_size = 32apc. ttl = 600apc. user_ttl = 600apc. num_files_hint = 0 apc. write_lock = On check whether the installation is successful/usr/local/php/bin/php-m | after grep apc is installed, reboot uses phpinfo to check whether all files have been loaded 8. automatically Start www.2cto.com 1 <B> echo "/usr/local/nginx/sbin/nginx">/etc/rc. local2 3 echo "/usr/local/php/sbin/php-fpm">/etc/rc. local4 5 echo "/usr/local/memcached/bin/memcached-d m 20-u root-l localhost-p1_11">/etc/rc. local </B> 9. Set vim/etc/sysconfig/iptables to enable ports 11211 and 80 10. Test script www.2cto.com Phpinfo 1 <? Php2 3 phpinfo (); 4 5?> Memacache 01 <? Php02 03 $ mem = new Memcache; 04 05 $ mem-> connect ("192.168.10.99", 11211); 06 07 $ mem-> set ('key ', 'This is a test! ', 0, 60); 08 09 $ val = $ mem-> get ('key'); 10 11 echo $ val; 12 13?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.