Make sure that you have followed the steps in Installing Software via YAST in SUSE Environment install the necessary software.
Start the nginx with the following command:
service nginx restart
Test with the following command:
wget http://127.0.0.1
If the result is as shown below and displays "'index.html' saved" at the end, it means the nginx service is working properly.
--2013-02-20 17:07:26-- http://127.0.0.1/
Connecting to 127.0.0.1:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 151 [text/html]
Saving to: 'index.html'
100%[==========================================================================================>] 151 --.-K/s in 0s
2013-02-20 17:07:26 (37.9 MB/s) - 'index.html' saved [151/151]
The appearance of the following page indicates that nginx has been installed and configured successfully.
vim /etc/php5/fpm/php-fpm.conf
Write the following:
[global]
error_log = /var/log/php-fpm.log
[www]
user = nobody
group = nobody
listen = 127.0.0.1:9000
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
Start all services with the following commands:
/etc/init.d/mysql start; /etc/init.d/php-fpm start; /etc/init.d/nginx start
Example:
Create index.php under a web directory using the following command:
vim /usr/share/nginx/html/index.php
Write the following:
<?php
echo "<title>Test Page</title>";
echo "hello world";
?>
In the browser, visit the Public IP of SUSE CVM to check whether the environment configuration is successful. If the webpage shows "hello world", it means the configuration is successful.
Was this page helpful?