VMware Images:
|
Installing Nginx With PHP5 (And PHP-FPM) And MySQL Support On OpenSUSE 11.4
Installing Nginx With PHP5 (And PHP-FPM) And MySQL Support On OpenSUSE 11.4Version 1.0 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. This tutorial shows how you can install Nginx on an OpenSUSE 11.4 server with PHP5 support (through PHP-FPM) and MySQL support. I do not issue any guarantee that this will work for you!
1 Preliminary NoteIn this tutorial I use the hostname server1.example.com with the IP address 192.168.0.100. These settings might differ for you, so you have to replace them where appropriate.
2 Installing MySQL 5First we install MySQL 5 like this: yast2 -i mysql mysql-client mysql-community-server Then we create the system startup links for MySQL (so that MySQL starts automatically whenever the system boots) and start the MySQL server: chkconfig -f --add mysql Now check that networking is enabled. Run netstat -tap | grep mysql It should show something like this: server1:~ # netstat -tap | grep mysql If it does not, edit /etc/my.cnf and comment out the option skip-networking: vi /etc/my.cnf
and restart your MySQL server: /etc/init.d/mysql restart (If you get the message You do not have a valid vim binary package installed. Please install either "vim", "vim-enhanced" or "gvim"., please run yast2 -i vim to install vi and try again. ) Run mysql_secure_installation to set a password for the user root (otherwise anybody can access your MySQL database!): server1:~ # mysql_secure_installation
3 Installing NginxNginx is available as a package for OpenSUSE 11.4 which we can install as follows: yast2 -i nginx-0.8 Then we create the system startup links for nginx and start it: chkconfig -f --add nginx Type in your web server's IP address or hostname into a browser (e.g. http://192.168.0.100), and you should see the following page: You get a 403 forbidden error because on OpenSUSE 11.4, the default nginx document root is /srv/www/htdocs, and there's no index page in /srv/www/htdocs.
4 Installing PHP5We can make PHP5 work in nginx through 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) which we install as follows: yast2 -i php5-fpm Before we start PHP-FPM, rename /etc/php5/fpm/php-fpm.conf.default to /etc/php5/fpm/php-fpm.conf: mv /etc/php5/fpm/php-fpm.conf.default /etc/php5/fpm/php-fpm.conf Then open /etc/php5/fpm/php-fpm.conf... vi /etc/php5/fpm/php-fpm.conf ... and change error_log to /var/log/php-fpm.log and uncomment pm.min_spare_servers and pm.max_spare_servers:
Next create the system startup links for php-fpm and start it: chkconfig -f --add php-fpm PHP-FPM is a daemon process (with the init script /etc/init.d/php-fpm) that runs a FastCGI server on port 9000, as you can see in the output of netstat -tapn server1:~ # netstat -tapn
|





Recent comments
12 hours 22 min ago
13 hours 58 min ago
18 hours 18 min ago
22 hours 9 min ago
1 day 9 hours ago
1 day 16 hours ago
1 day 18 hours ago
1 day 20 hours ago
1 day 20 hours ago
1 day 20 hours ago