-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Guillaume Charmetant edited this page Mar 29, 2015
·
3 revisions
Here is my nginx vhost:
server {
listen 80;
server_name slimtest.lxc;
root /path/to/slimtest;
access_log /path/to/slimtest/log/access.log;
error_log /path/to/slimtest/log/error.log notice;
index index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
location /index.php {
try_files $uri =404;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/slimtest.sock;
}
}
Here is my pool configuration:
[slimtest]
user = www-data
group = www-data
listen = /var/run/slimtest.sock
listen.owner = www-data
listen.group = www-data
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
Here is how I created the MySQL database:
CREATE DATABASE `slimtest` CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL ON `slimtest`.* TO `slimtest`@localhost IDENTIFIED BY 'slimtest';
FLUSH PRIVILEGES;
CREATE TABLE IF NOT EXISTS users (
id INTEGER NOT NULL AUTO_INCREMENT,
role VARCHAR(50) DEFAULT 'member',
email VARCHAR(255) NOT NULL,
password VARCHAR(255) NULL,
display_name VARCHAR(255) NULL,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (id),
UNIQUE KEY unique_email (email)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
Here is a little bash gist to dump its structure:
DB_NAME=slimtest
DB_USER=slimtest
DB_PASS=slimtest
mysqldump \
--add-drop-database \
--no-data \
-u"${DB_USER}" -p"${DB_PASS}" \
--databases "${DB_NAME}"