just to not wrestle with sudo and exec
$ sudo apt-get update
$ sudo apt-get install gosu| location ~ / { | |
| #Change [SITE] by your site.com | |
| proxy_pass http://[SITE]:3000; | |
| proxy_redirect off; | |
| proxy_set_header Host $host; | |
| proxy_set_header X-Real-IP $remote_addr; | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| proxy_set_header X-Forwarded-Host $server_name; | |
| } |
| #!/usr/bin/env python | |
| from optparse import OptionParser | |
| from xml.dom.minidom import parse | |
| import os | |
| import sqlite3 | |
| datatypeMap = { | |
| 'integer': 'INT', | |
| 'datetime': 'DATETIME', |
| @servers(['production' => 'productionserver', 'local'=> '[email protected] -p 2222']) | |
| {{-- Configuration section --}} | |
| @setup | |
| /* | |
| |-------------------------------------------------------------------------- | |
| | Git Config | |
| |-------------------------------------------------------------------------- | |
| | |
| <?php | |
| use Illuminate\Support\Facades\Schema; | |
| use Illuminate\Database\Schema\Blueprint; | |
| use Illuminate\Database\Migrations\Migration; | |
| class LaravelConditionalIndexMigration extends Migration | |
| { | |
| /** | |
| * Run the migrations. |
For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.
Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.
You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.
| [Unit] | |
| Description=supervisord - Supervisor process control system for UNIX | |
| Documentation=http://supervisord.org | |
| After=network.target | |
| [Service] | |
| Type=forking | |
| ExecStart=/usr/bin/supervisord -c /etc/supervisord.conf | |
| ExecReload=/usr/bin/supervisorctl reload | |
| ExecStop=/usr/bin/supervisorctl shutdown |
| #server side: | |
| #server live directory: /var/www/domain.com | |
| #server repository: /var/repo/site.git | |
| 1. clone project from git/bitbucket into /var/www/domain.com or init the folder by "git init". | |
| 2. go to /var/repo/site.git and init the folder as git bare | |
| $git init --bare | |
| --bare means that our folder will have no source files, just the version control. |
nginx.conf
http {
vhost_traffic_status_zone;
vhost_traffic_status_dump /var/log/nginx/vts.db;