Install Linux with Nginx, PHP5 (And PHP-FPM) And MySQL Support On CentOS (Part 2)

After doing the Part 1 article, now I continue installing and configuring other server softwares.

2. Install Nginx.

What is Nginx? Nginx (pronounced "engine x") is a free, open-source, high-performance HTTP server. Nginx is known for its stability, rich feature set, simple configuration, and low resource consumption.

I already add the additional repo in Part 1 to install Nginx.
yum install nginx
then create start up link and start it
chkconfig --levels 235 nginx on
/etc/init.d/nginx start
make confirmation of Nginx installation by typing server IP address ( or hostname into my browser, and I got Nginx welcome page. Thats all for installing Nginx :)

3. Install PHP5

Nginx need PHP-FPM to work with PHP5. PHP-FPM (PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites). I install php-fpm together with php-cli and some PHP5 modules like php-mysql which I need to use MySQL from PHP.
yum install php-fpm php-cli php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-magickwand php-magpierss php-mbstring php-mcrypt php-mssql php-shout php-snmp php-soap php-tidy
I also install APC, a free and open PHP opcode cacher for caching and optimizing PHP intermediate code. It's similar to other PHP opcode cachers, such as eAccelerator and Xcache. It is strongly recommended to have one of these installed to speed up PHP page.
yum install php-pecl-apc 
Open /etc/php.ini find and set cgi.fix_pathinfo=0:
I look in my system time zone and then set the same value in date.timezone in /etc/php.ini to avoid error in php error log.
cat /etc/sysconfig/clock
Create the system startup links for php-fpm and start it
chkconfig --levels 235 php-fpm on
/etc/init.d/php-fpm start
PHP-FPM is a daemon process (with the init script /etc/init.d/php-fpm) that runs a FastCGI server on port 9000

End of Part 2 

No comments: