Skip to content

Commit 342b842

Browse files
committed
nginx and static dev; geodash placeholders
1 parent 76b1509 commit 342b842

File tree

7 files changed

+145
-2
lines changed

7 files changed

+145
-2
lines changed

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,12 @@ paver setup
181181
paver start -b 0.0.0.0:8000 # Launches Django and GeoServer. Listens to all addresses on port 8000.
182182
```
183183

184+
If the fixtures are not loaded, use the following:
185+
186+
```
187+
python manage.py loaddata geonode/base/fixtures/initial_data.json
188+
```
189+
184190
## Fabric
185191

186192
[Fabric](http://www.fabfile.org/) provides an easy command line interface for executing remote shell commands and for transferring files between machines. For GeoNode, Fabric can be used to import large files, `updatelayers`, manage GeoServer restart cron jobs, and backup a remote GeoNode locally.

Vagrantfile

+8-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,19 @@ Vagrant.configure(2) do |config|
55

66
config.vm.box = "bento/ubuntu-16.04"
77

8-
config.vm.network "forwarded_port", guest: 8000, host: 8000
8+
config.vm.network "forwarded_port", guest: 8000, host: 8000 # Use guest's NGINX proxy
9+
config.vm.network "forwarded_port", guest: 8001, host: 8001
910
config.vm.network "forwarded_port", guest: 8080, host: 8080
1011

1112
config.vm.synced_folder "~/workspaces/public/geonode.git", "/home/vagrant/geonode"
13+
#config.vm.synced_folder "~/workspaces/public/geodash-framework-django.git", "/home/vagrant/geodash-framework-django.git"
14+
#config.vm.synced_folder "~/workspaces/public/geodash-plugin-geonode-dashboards.git", "/home/vagrant/geodash-plugin-geonode-dashboards.git"
15+
#config.vm.synced_folder "~/workspaces/public/geodash-plugin-navbars.git", "/home/vagrant/geodash-plugin-navbars.git"
16+
#config.vm.synced_folder "~/workspaces/public/geodash.js.git", "/home/vagrant/geodash.js.git"
17+
#config.vm.synced_folder "~/workspaces/public/geodash-base.git", "/home/vagrant/geodash-base.git"
1218

1319
config.vm.provider "virtualbox" do |vb|\
14-
vb.gui = true
20+
vb.gui = false
1521
vb.cpus = 2
1622
vb.memory = 4096
1723
end

ansible/extra_roles/common/ubuntu/common_webserver_django_ubuntu/tasks/main.yml

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#- libgeos-c1 # see https://groups.google.com/forum/#!topic/cartodb/CuDJs5Nm0ww
2828
- libgeos-c1v5 # see https://groups.google.com/forum/#!topic/cartodb/CuDJs5Nm0ww
2929
- libpq-dev
30+
#- libsqlite3-mod-spatialite # Not default. If using Django spatialite backend, install this.
3031

3132
- name: Install Other Libraries
3233
become: yes

ansible/extra_roles/common/ubuntu/common_webserver_proxy_ubuntu/tasks/main.yml

+15
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
---
22

3+
- name: Install NGINX
4+
become: yes
5+
become_user: root
6+
apt: name="{{ item }}" state=latest
7+
with_items:
8+
- nginx
9+
310
- name: Install Node.js & NPM
411
become: yes
512
become_user: root
613
apt: name="{{ item }}" state=latest
714
with_items:
15+
- nginx
816
- nodejs
917
- npm
1018

@@ -15,3 +23,10 @@
1523
with_items:
1624
- bower
1725
- grunt-cli
26+
- gulp
27+
- yarn
28+
29+
- name: Alias node & nodejs
30+
become: yes
31+
become_user: root
32+
file: "src=/usr/bin/nodejs dest=/usr/bin/node state=link owner=root"

ansible/roles/geonode/tasks/main.yml

+10
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,13 @@
3838
shell: "{{ VENV_PATH }}/bin/pip install -e geonode"
3939
args:
4040
chdir: "/home/vagrant"
41+
42+
- name: "Configure NGINX"
43+
become: yes
44+
become_user: root
45+
template:
46+
src: "templates/etc.nginx.default.j2"
47+
dest: "/etc/nginx/sites-available/default"
48+
owner: "root"
49+
group: "root"
50+
mode: "u=rw,g=r,o=r"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
##
2+
# You should look at the following URL's in order to grasp a solid understanding
3+
# of Nginx configuration files in order to fully unleash the power of Nginx.
4+
# http://wiki.nginx.org/Pitfalls
5+
# http://wiki.nginx.org/QuickStart
6+
# http://wiki.nginx.org/Configuration
7+
#
8+
# Generally, you will want to move this file somewhere, and start with a clean
9+
# file but keep this around for reference. Or just disable in sites-enabled.
10+
#
11+
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
12+
##
13+
14+
# Default server configuration
15+
#
16+
server {
17+
listen {{ NGINX_PORT }} default_server;
18+
listen [::]:{{ NGINX_PORT }} default_server;
19+
20+
# SSL configuration
21+
#
22+
# listen 443 ssl default_server;
23+
# listen [::]:443 ssl default_server;
24+
#
25+
# Note: You should disable gzip for SSL traffic.
26+
# See: https://bugs.debian.org/773332
27+
#
28+
# Read up on ssl_ciphers to ensure a secure configuration.
29+
# See: https://bugs.debian.org/765782
30+
#
31+
# Self signed certs generated by the ssl-cert package
32+
# Don't use them in a production server!
33+
#
34+
# include snippets/snakeoil.conf;
35+
36+
root /var/www/html;
37+
38+
# Add index.php to the list if you are using PHP
39+
index index.html index.htm index.nginx-debian.html;
40+
41+
server_name _;
42+
43+
#location / {
44+
# First attempt to serve request as file, then
45+
# as directory, then fall back to displaying a 404.
46+
# try_files $uri $uri/ =404;
47+
#}
48+
49+
location / {
50+
proxy_set_header X-Forwarded-Host $host;
51+
proxy_set_header X-Forwarded-Server $host;
52+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
53+
proxy_pass http://127.0.0.1:{{ DJ_PORT }}/;
54+
}
55+
56+
location /geoserver/ {
57+
proxy_set_header X-Forwarded-Host $host;
58+
proxy_set_header X-Forwarded-Server $host;
59+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
60+
proxy_pass http://127.0.0.1:{{ GS_PORT }}/geoserver/;
61+
}
62+
63+
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
64+
#
65+
#location ~ \.php$ {
66+
# include snippets/fastcgi-php.conf;
67+
#
68+
# # With php7.0-cgi alone:
69+
# fastcgi_pass 127.0.0.1:9000;
70+
# # With php7.0-fpm:
71+
# fastcgi_pass unix:/run/php/php7.0-fpm.sock;
72+
#}
73+
74+
# deny access to .htaccess files, if Apache's document root
75+
# concurs with nginx's one
76+
#
77+
#location ~ /\.ht {
78+
# deny all;
79+
#}
80+
}
81+
82+
83+
# Virtual Host configuration for example.com
84+
#
85+
# You can move that to a different file under sites-available/ and symlink that
86+
# to sites-enabled/ to enable it.
87+
#
88+
#server {
89+
# listen 80;
90+
# listen [::]:80;
91+
#
92+
# server_name example.com;
93+
#
94+
# root /var/www/example.com;
95+
# index index.html;
96+
#
97+
# location / {
98+
# try_files $uri $uri/ =404;
99+
# }
100+
#}

ansible/roles/geonode/vars/main.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
3+
NGINX_PORT: 8000
4+
DJ_PORT: 8001
5+
GS_PORT: 8080

0 commit comments

Comments
 (0)