From 6c9c04a85d93c51f65310a92bf4f576946ee59e4 Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Sat, 14 Dec 2013 17:25:29 -0500 Subject: [PATCH] Set up all that basic shit --- conf/nginx.conf | 57 +++++++++++++++ config.php | 125 +++++++++++++++++++++++++++++++++ public/index.php | 9 +++ templates/__shared/index.phtml | 6 ++ templates/home.phtml | 1 + 5 files changed, 198 insertions(+) create mode 100644 conf/nginx.conf create mode 100644 config.php create mode 100644 public/index.php create mode 100644 templates/__shared/index.phtml create mode 100644 templates/home.phtml diff --git a/conf/nginx.conf b/conf/nginx.conf new file mode 100644 index 0000000..2fa77d2 --- /dev/null +++ b/conf/nginx.conf @@ -0,0 +1,57 @@ +server +{ + listen 80; + server_name *.leaderbin.com; + + if ($host ~* "^(.+)\.leaderbin\.com$") + { + rewrite ^(.*)$ http://leaderbin.com$1 permanent; + } +} + +server +{ + listen 80; + server_name local.leaderbin.com leaderbin.com; + + access_log /var/log/nginx/leaderbin.com.access.log; + error_log /var/log/nginx/leaderbin.com.error.log; + + root /var/www/leaderbin.com/public; + + rewrite_log on; + + # Rewrites static content with an appended timestamp + location ~ ^/(.+)\.(\d+)\.(css|js|gif|png|jpg|jpeg)$ + { + rewrite ^/(.+)\.(\d+)\.(css|js|gif|png|jpg|jpeg)$ /$1.$3 break; + expires max; + } + + location / + { + index index.php; + + # Strips the trailing slash + rewrite ^/(.*)/$ /$1 permanent; + + # If file exists return it right away + if (-f $request_filename) + { + expires max; + break; + } + + # and the rest + rewrite ^/(.+)$ /index.php?request=$1 last; + } + + location ~ \.php$ + { + try_files $uri =404; + include /etc/nginx/fastcgi_params; + fastcgi_pass 127.0.0.1:9000; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME /var/www/leaderbin.com/public$fastcgi_script_name; + } +} diff --git a/config.php b/config.php new file mode 100644 index 0000000..da462d5 --- /dev/null +++ b/config.php @@ -0,0 +1,125 @@ + array( + 'local' => 'local.leaderbin.com', + 'production' => 'leaderbin.com', + ), + + // }}} + // {{{ PHP Options + + 'php' => array( + 'local' => array( + 'date.timezone' => 'Universal', + 'display_errors' => true, + 'error_reporting' => -1, + 'session.gc_maxlifetime' => 86400, + ), + 'production' => array( + 'date.timezone' => 'Universal', + 'display_errors' => false, + 'error_reporting' => -1, + 'session.gc_maxlifetime' => 86400, + ), + ), + + // }}} + // {{{ PICKLES Stuff + + 'pickles' => array( + 'disabled' => false, + 'session' => 'files', + 'template' => 'index', + 'module' => 'home', + //'404' => 'error/404', + 'datasource' => 'mysql', + 'cache' => 'memcached', + 'profiler' => array( + 'local' => false, + 'production' => false, + ), + 'logging' => array( + 'local' => true, + 'production' => false, + ), + 'minify' => array( + 'local' => true, + 'production' => false, + ), + ), + + // }}} + // {{{ Datasources + + 'datasources' => array( + 'local' => array( + 'memcached' => array( + 'type' => 'memcache', + 'hostname' => 'localhost', + 'port' => 11211, + 'namespace' => 'ELLBEE', + ), + 'mysql' => array( + 'type' => 'mysql', + 'driver' => 'pdo_mysql', + 'hostname' => 'localhost', + 'username' => 'root', + 'password' => '', + 'database' => 'leaderbin', + 'cache' => false, + ), + 'redis' => array( + 'type' => 'redis', + 'hostname' => 'localhost', + 'port' => 6379, + 'database' => '0', + 'namespace' => 'lb', + ), + ), + 'production' => array( + 'memcached' => array( + 'type' => 'memcache', + 'hostname' => 'localhost', + 'port' => 11211, + 'namespace' => 'ELLBEE', + ), + 'mysql' => array( + 'type' => 'mysql', + 'driver' => 'pdo_mysql', + 'hostname' => 'localhost', + 'username' => 'leaderbin', + 'password' => '9f48580930bdcaf13c1888cd946e809e75ab8d90', + 'database' => 'leaderbin', + 'cache' => false, + ), + 'redis' => array( + 'type' => 'redis', + 'hostname' => 'localhost', + 'port' => 6381, + 'database' => '0', + 'namespace' => 'lb', + ), + ), + ), + + // }}} + // {{{ Security Options + + 'security' => array( + 'login' => 'login', + 'model' => 'User', + 'column' => 'role', + 'levels' => array( + 0 => 'ANONYMOUS', + 10 => 'USER', + 20 => 'ADMIN', + ), + ), + + // }}} +); + +?> diff --git a/public/index.php b/public/index.php new file mode 100644 index 0000000..daa7d24 --- /dev/null +++ b/public/index.php @@ -0,0 +1,9 @@ + diff --git a/templates/__shared/index.phtml b/templates/__shared/index.phtml new file mode 100644 index 0000000..f8713fc --- /dev/null +++ b/templates/__shared/index.phtml @@ -0,0 +1,6 @@ + + + + template; ?> + + diff --git a/templates/home.phtml b/templates/home.phtml new file mode 100644 index 0000000..2fb5194 --- /dev/null +++ b/templates/home.phtml @@ -0,0 +1 @@ +

LeaderBin