summaryrefslogtreecommitdiff
path: root/www/php-concrete5/MESSAGE
blob: efb96f0a3e4336fee997a2470c01aac01155c26f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
===========================================================================
$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, ${PREFIX}/etc/php.ini should have date.timezone line.
   If your machine are located in Tokyo, Japan, you should get the following.

	# cat ${PREFIX}/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

	# ${RCD_SCRIPTS_DIR}/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 ${PREFIX}/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 ${PREFIX}/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   ${PREFIX}/share/concrete5;
		index  index.php index.html index.htm;
		try_files $uri $uri/ @rewrite;
	}

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

	location ~ \.php($|/) {
		root    ${PREFIX}/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.

	# ${RCD_SCRIPTS_DIR}/php_fpm start
	# ${RCD_SCRIPTS_DIR}/nginx start

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

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