[ECODP-dev] URL Rewrite

Dimitrios Mexis dimitrios.mexis at tenforce.com
Tue Feb 12 09:39:51 UTC 2013


Attached I have what I changed in order to put off the open-data over URL.

The p_ecodp is the diff output from ecodp.conf in conf.d folder
The p_nginx.conf the relevant of the nginx changes

The .htaccess is from Drupal.

Can you validate the changes ?
If there are more to do, please give me your possible feedback with some
detailing on what to change.

Regards,
Dimitrios
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.okfn.org/mailman/private/ecodp-dev/attachments/20130212/d2850c42/attachment.html>
-------------- next part --------------
[root at ecodp-perf3 conf.d]# diff -Naur ecodp.conf.orig ecodp.conf > p_ecodp_conf
[root at ecodp-perf3 conf.d]# cat p_ecodp_conf
--- ecodp.conf.orig     2013-02-11 11:14:21.264807041 +0100
+++ ecodp.conf  2013-02-11 12:43:35.288809721 +0100
@@ -13,7 +13,7 @@
           ## This is because CKAN is mounted at /open-data/data, so the locale must come
           ## after the mount point in order that CKAN can see it.
     RewriteEngine on
-    RewriteRule ^/open-data/(..)/data($|/(.*))$ /open-data/data/$1/$3 [L,QSA,PT]
+    RewriteRule ^/(..)/data($|/(.*))$ /data/$1/$3 [L,QSA,PT]

 #    <Directory />
 #        Options Indexes FollowSymLinks MultiViews
@@ -36,20 +36,20 @@
           # for the ckanext-qa and ckanext-datastorer extensions,
           # both of which don't allow access to resources requiring
           # authentication.
-          <Location /open-data/data/api/action>
+          <Location /data/api/action>
             allow from all
             Order allow,deny
             Satisfy Any
           </Location>

-          <Location /open-data/data/api/data>
+          <Location /data/api/data>
             allow from all
             Order allow,deny
             Satisfy Any
           </Location>

     # this is CKAN app
-    WSGIScriptAlias /open-data/data /applications/ecodp/users/ecodp/ckan/lib/ecodp/wsgi.py
+    WSGIScriptAlias /data /applications/ecodp/users/ecodp/ckan/lib/ecodp/wsgi.py
     WSGIDaemonProcess ecodp display-name=ecodp processes=4 threads=15 maximum-requests=2000
     WSGIProcessGroup ecodp

@@ -72,7 +72,7 @@
         allow from all
     </Directory>

-Alias /open-data/data/uploads /applications/ecodp/users/ecodp/www/uploads
+Alias /data/uploads /applications/ecodp/users/ecodp/www/uploads

 #    Alias /open-data /var/www/drupal

@@ -83,8 +83,8 @@
         Order allow,deny
         Allow from all
     </Directory>
-    Alias /open-data/apps/cubeviz /applications/ecodp/users/ecodp/www/cubeviz
-    Alias /open-data/apps/semmap /applications/ecodp/users/ecodp/www/semmap
+    Alias /apps/cubeviz /applications/ecodp/users/ecodp/www/cubeviz
+    Alias /apps/semmap /applications/ecodp/users/ecodp/www/semmap

 <Proxy *>
 Order allow,deny
-------------- next part --------------
root at ecodp-perf3 conf.d]# diff -Naur default.conf.ecodp.original default.conf > p_nginx
[root at ecodp-perf3 conf.d]# cat p_nginx
--- default.conf.ecodp.original 2013-02-11 11:30:06.572808068 +0100
+++ default.conf        2013-02-11 11:30:28.841817744 +0100
@@ -3,14 +3,14 @@
   server_name publications.europa.eu;
   access_log /var/log/nginx/publications.europa.eu.access.log main;

-  location /open-data/elastic/ {
+  location /elastic/ {
     internal;
     proxy_pass http://ecodp-perf1:9200/;
     proxy_set_header Host $host;
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
   }

-  location /open-data/data {
+  location /data {
      proxy_pass http://0.0.0.0:8008;
      proxy_set_header Host $host:80;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@@ -23,7 +23,7 @@
      proxy_ignore_headers "Cache-Control";
   }

-  location ~ /open-data/[a-zA-z][a-zA-z]/data/.* {
+  location ~ /[a-zA-z][a-zA-z]/data/.* {

      proxy_pass http://0.0.0.0:8008;
      proxy_set_header Host $host:80;
@@ -37,7 +37,7 @@
      proxy_ignore_headers "Cache-Control";
   }

-  location /open-data/ {
+  location / {
      proxy_pass http://0.0.0.0:8008;
      proxy_set_header Host $host:80;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
[root at ecodp-perf3 conf.d]#
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .htaccess
Type: application/octet-stream
Size: 5305 bytes
Desc: not available
URL: <https://lists.okfn.org/mailman/private/ecodp-dev/attachments/20130212/d2850c42/attachment-0001.obj>


More information about the ecodp-dev mailing list