WebFaction
Community site: login faq

I have a CGI app, UMN Mapserver, run by apache on my WebFaction account. To test my build and install, the Static App is tied to a Website that is publicly visible. All good! Moving forward I would like to run this CGI privately, other apps in my WF install would query it, but it should not be externally visible.

I do this on my elsewhere by serving Mapserver on an off-port and firewalling it. Is this possible to configure on WebFaction? Or is there a way that makes more sense on WebFaction?

Thanks!

asked 11 Feb '15, 03:12

bill
135
accept rate: 0%


You could use mod_rewrite to check HTTP_REFERER and/or REMOTE_ADDR, and reject any requests that don't come from the referrer and IP you specify.

permanent link

answered 11 Feb '15, 14:20

seanf
12.2k41836
accept rate: 37%

This worked, thank you:

RewriteEngine on RewriteCond %{REMOTE_ADDR} !^2607:X:X::::X$ RewriteRule ^(.*)$ - [F,L]

Before reading this, I tried using Limit which is preferable for maintaining a whitelist, but could not successfully specify localhost or the local interface. It looked like:

<Limit GET POST> Order deny,allow Deny from all Allow from 199.XX.XX.XX Allow from 2607:X:X::::X </Limit>

My external IP address would be allowed, but not the local ipv6 address shown as my test wget client, nor 127.0.0.1, nor ::1, would hit for Allow. The syntax is fine, an "Allow all" would serve the local test client. Any idea why, does this have to do with the WF config?

(11 Feb '15, 20:11) bill

You would have to build an apache server to do this without it being public. Or call the script in shell.

permanent link

answered 11 Feb '15, 05:52

johns
5.3k312
accept rate: 23%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×225
×31
×9
×5
×4

question asked: 11 Feb '15, 03:12

question was seen: 1,277 times

last updated: 11 Feb '15, 20:13

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM