Skip to content

Instantly share code, notes, and snippets.

@jmdobry
Last active August 31, 2021 18:21

Revisions

  1. jmdobry revised this gist Jul 25, 2013. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions Instructions.md
    Original file line number Diff line number Diff line change
    @@ -31,13 +31,15 @@ server {
    ```
    where `domain.com` is the host name (or IP address) of the server running the RethinkDB Admin UI.

    Create username and password (make sure you have apache2-utils installed `sudo apt-get install apache2-utils):
    Create username and password (make sure you have apache2-utils installed `sudo apt-get install apache2-utils`):
    `cd /etc/nginx/`
    `htpasswd -c .rethinkdb.pass <username>` where `<username>` is the username you want.
    The command will ask you to enter the password for the username you chose.

    start/restart nginx
    `sudo service nginx start` or `sudo service nginx restart`
    `sudo service nginx start`
    or
    `sudo service nginx restart`

    Verify it works:
    Navigate to `http://domain.com/rethinkdb_admin` where domain.com is the host name (or IP address) of the server running the RethinkDB Admin UI.
  2. jmdobry created this gist Jul 25, 2013.
    43 changes: 43 additions & 0 deletions Instructions.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,43 @@
    Start your rethinkdb instance with this flag:
    `--bind all` (or `bind=all` in the configuration file for your instance)

    Block external access to the web UI with these two commands:
    `sudo iptables -A INPUT -i eth0 -p tcp --dport 8080 -j DROP`
    `sudo iptables -I INPUT -i eth0 -s 127.0.0.1 -p tcp --dport 8080 -j ACCEPT`

    Install nginx:
    `sudo apt-get install nginx`

    Create a new virtual host (server block):
    `sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/rethinkdb_admin`

    Edit this file:
    `sudo vi /etc/nginx/sites-available/rethinkdb_admin`

    to say:
    ```
    server {
    listen 80;
    server_name domain.com;
    location /rethinkdb-admin/ {
    auth_basic "Restricted";
    auth_basic_user_file /etc/nginx/.rethinkdb.pass;
    proxy_pass http://127.0.0.1:8080/;
    proxy_redirect off;
    proxy_set_header Authorization "";
    }
    }
    ```
    where `domain.com` is the host name (or IP address) of the server running the RethinkDB Admin UI.

    Create username and password (make sure you have apache2-utils installed `sudo apt-get install apache2-utils):
    `cd /etc/nginx/`
    `htpasswd -c .rethinkdb.pass <username>` where `<username>` is the username you want.
    The command will ask you to enter the password for the username you chose.

    start/restart nginx
    `sudo service nginx start` or `sudo service nginx restart`

    Verify it works:
    Navigate to `http://domain.com/rethinkdb_admin` where domain.com is the host name (or IP address) of the server running the RethinkDB Admin UI.