===========================================================================
$NetBSD: MESSAGE,v 1.7 2015/05/31 02:16:11 ryoon Exp $

To use concrete5 with nginx, you will need to perform the following steps.

1. Install www/nginx and www/php-fpm with following in your mk.conf.

	APACHE_USER=nginx
	APACHE_GROUP=nginx

2. Setup PHP. At least, /usr/pkg/etc/php.ini should have date.timezone line.
   If your machine are located in Tokyo, Japan, you should get the following.

	# cat /usr/pkg/etc/php.ini | grep date.timezone
	date.timezone ="Asia/Tokyo"

3. Install MySQL database server.

	# cd databases/mysql55-server
	# make install

4. Start MySQL server, and setup MySQL server

	# /etc/rc.d/mysqld start
	And see messages.

5. Add MySQL user, concrete5

	$ mysql -u root -p
	Enter password: YOUR_MYSQL_ROOT_PASSWORD
	> create user concrete5 identified by 'concrete5_user_password';
	> quit

6. Create database for concrete5

	$ mysql -u root -p
	Enter password: YOUR_MYSQL_ROOT_PASSWORD
	> create database concrete5_db;
	> grant SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER
	on concrete5_db.* to concrete5@localhost identified by 'concrete5_password';
	> quit

7. Be sure to have the following lines in /usr/pkg/etc/php.ini.

	extension=gd.so
	extension=dom.so
	extension=pdo.so
	extension=pdo_mysql.so
	extension=iconv.so
	extension=mbstring.so
	extension=curl.so
	extension=mcrypt.so
	extension=json.so
	extension=zip.so

	default_charaset = UTF8
	mbstring.language = neutral
	mbstring.internal_encoding = UTF-8
	mbstring.http_input = auto
	mbstring.http_output =  UTF-8
	iconv.input_encoding = UTF-8
	iconv.internal_encoding = UTF-8

8. Be sure to have the following lines in /usr/pkg/etc/nginx/nginx.conf

	http {
		include /usr/pkg/etc/nginx/mime.types;

		upstream php-handler {
			server 127.0.0.1:9000;
	}

	server {
		listen 80;
		server_name YOUR_SERVER_NAME;
		client_max_body_size 20m;

	location / {
		root   /usr/pkg/share/concrete5;
		index  index.php index.html index.htm;
		try_files $uri $uri/ @rewrite;
	}

	location @rewrite {
		rewrite ^/(.*)$ /index.php/$1 last;
	}

	location ~ \.php($|/) {
		root    /usr/pkg/share/concrete5;
	        fastcgi_pass   127.0.0.1:9000;
		fastcgi_index  index.php;
		fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
		include        fastcgi_params;
	}

	}
	}

9. Start php-fpm and nginx.

	# /etc/rc.d/php_fpm start
	# /etc/rc.d/nginx start

10. Access http://localhost/
   And setup with the following information.

	database name:	concrete5_db
	user name:	concrete5
	password:	concrete5_password
===========================================================================
