Skip to content

Instantly share code, notes, and snippets.

@jacques
Forked from mariocesar/README.md
Last active August 29, 2015 14:06
Show Gist options
  • Save jacques/f22e94e2fe6e1f8764b1 to your computer and use it in GitHub Desktop.
Save jacques/f22e94e2fe6e1f8764b1 to your computer and use it in GitHub Desktop.

Revisions

  1. @mariocesar mariocesar revised this gist Sep 21, 2014. 1 changed file with 13 additions and 0 deletions.
    13 changes: 13 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -9,3 +9,16 @@ Login and install dropbox.

    sudo -s su - websites
    cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -

    Logged as the `websites` user, install the dropbox cli tool

    mkdir bin
    cd bin
    wget https://www.dropbox.com/download?dl=packages/dropbox.py
    chmod +x dropbox.py

    ## Setup your DNS

    ## Add a Website

    ## Share a Website
  2. @mariocesar mariocesar revised this gist Sep 21, 2014. No changes.
  3. @mariocesar mariocesar revised this gist Sep 21, 2014. 1 changed file with 11 additions and 0 deletions.
    11 changes: 11 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    Install
    =======

    Create a `websites` user.

    sudo adduser --disabled-password --home /src/websites websites

    Login and install dropbox.

    sudo -s su - websites
    cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
  4. @mariocesar mariocesar revised this gist Jul 30, 2014. 1 changed file with 5 additions and 6 deletions.
    11 changes: 5 additions & 6 deletions nginx_default.conf
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,8 @@
    map $http_accept_language $lang {
    default es;
    ~en en;
    }

    server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;
    @@ -6,12 +11,6 @@ server {
    server_name ~^(www\.)?(?P<domain>.+)$;
    root /srv/websites/Dropbox/Hosts;

    map $http_accept_language $lang {
    default es;
    ~en en;
    }


    location = /favicon.ico {
    access_log off;
    log_not_found off;
  5. @mariocesar mariocesar revised this gist Jul 30, 2014. 1 changed file with 32 additions and 35 deletions.
    67 changes: 32 additions & 35 deletions nginx_default.conf
    Original file line number Diff line number Diff line change
    @@ -1,38 +1,35 @@
    server {
    listen 80;
    listen [::]:80 default ipv6only=on;

    server_name ~^(?P<app>[a-z0-9]+)\.app\.c1\.com\.bo$;
    root /var/www;

    location / {
    access_log /var/log/nginx/access.$app.log;
    error_log /var/log/nginx/error.apps.log error;
    uwsgi_pass unix:///home/apps/Apps/$app.app.c1.com.bo/var/run/$app.socket;
    include uwsgi_params;
    }
    }
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;

    server {
    index index.html index.htm;
    server_name ~^(www\.)?(?P<domain>.+)$;
    root /srv/websites/Dropbox/Hosts;

    location = /favicon.ico {
    access_log off;
    log_not_found off;
    }

    location ~ /[._]+ {
    deny all;
    return 404;
    }

    location / {
    index index.html index.php;
    access_log /var/log/nginx/access.website-$domain.log;
    error_log /var/log/nginx/error.website-$domain.log error;
    root /srv/websites/Dropbox/Hosts/$domain;
    try_files $uri $uri/ =404;
    }
    index index.html index.htm;
    server_name ~^(www\.)?(?P<domain>.+)$;
    root /srv/websites/Dropbox/Hosts;

    map $http_accept_language $lang {
    default es;
    ~en en;
    }


    location = /favicon.ico {
    access_log off;
    log_not_found off;
    }

    location ~ /[._]+ {
    deny all;
    return 404;
    }

    location / {
    root /srv/websites/Dropbox/Hosts/$domain;
    index index.html index.$lang.html;
    autoindex on;

    access_log /var/log/nginx/access.website-$domain.log;
    error_log /var/log/nginx/error.website-$domain.log error;

    try_files $uri $uri/ =404;
    }
    }
  6. @mariocesar mariocesar revised this gist Jul 30, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions nginx_default.conf
    Original file line number Diff line number Diff line change
    @@ -14,7 +14,7 @@ server {
    }

    server {
    index index.html index.php index.htm;
    index index.html index.htm;
    server_name ~^(www\.)?(?P<domain>.+)$;
    root /srv/websites/Dropbox/Hosts;

    @@ -33,6 +33,6 @@ server {
    access_log /var/log/nginx/access.website-$domain.log;
    error_log /var/log/nginx/error.website-$domain.log error;
    root /srv/websites/Dropbox/Hosts/$domain;
    try_files $uri $uri/;
    try_files $uri $uri/ =404;
    }
    }
  7. @mariocesar mariocesar revised this gist Jul 30, 2014. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions nginx_default.conf
    Original file line number Diff line number Diff line change
    @@ -23,16 +23,16 @@ server {
    log_not_found off;
    }

    location ~ /[._]+ {
    deny all;
    return 404;
    }

    location / {
    index index.html index.php;
    access_log /var/log/nginx/access.website-$domain.log;
    error_log /var/log/nginx/error.website-$domain.log error;
    root /srv/websites/Dropbox/Hosts/$domain;
    try_files $uri $uri/;
    }

    location ~ /[._]+ {
    deny all;
    return 404;
    }
    }
  8. @mariocesar mariocesar revised this gist Jul 30, 2014. 1 changed file with 38 additions and 0 deletions.
    38 changes: 38 additions & 0 deletions nginx_default.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,38 @@
    server {
    listen 80;
    listen [::]:80 default ipv6only=on;

    server_name ~^(?P<app>[a-z0-9]+)\.app\.c1\.com\.bo$;
    root /var/www;

    location / {
    access_log /var/log/nginx/access.$app.log;
    error_log /var/log/nginx/error.apps.log error;
    uwsgi_pass unix:///home/apps/Apps/$app.app.c1.com.bo/var/run/$app.socket;
    include uwsgi_params;
    }
    }

    server {
    index index.html index.php index.htm;
    server_name ~^(www\.)?(?P<domain>.+)$;
    root /srv/websites/Dropbox/Hosts;

    location = /favicon.ico {
    access_log off;
    log_not_found off;
    }

    location / {
    index index.html index.php;
    access_log /var/log/nginx/access.website-$domain.log;
    error_log /var/log/nginx/error.website-$domain.log error;
    root /srv/websites/Dropbox/Hosts/$domain;
    try_files $uri $uri/;
    }

    location ~ /[._]+ {
    deny all;
    return 404;
    }
    }
  9. @mariocesar mariocesar created this gist Jul 30, 2014.
    14 changes: 14 additions & 0 deletions dropbox.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    # dropbox
    description "starts the dropbox client"

    start on runlevel [2345]
    stop on shutdown

    respawn

    umask 0027

    script
    export LANG=en_US.UTF-8
    exec su -s /bin/sh -c /srv/websites/.dropbox-dist/dropboxd websites
    end script