Frequently Asked Questions
Jan 27, 2023 - 06:59pm
Frequently Asked Questions Operational Questions
How can I Allow (or restrict) Access by IP Address?
Rate This FAQ
(Not yet rated)
Created On: 7 Dec 1999 11:38 am
Last Edited: 14 Feb 2005 11:25 am
I'm running a test server and would like to restrict access to just my machine.
I would like to restrict a certain IP from Accessing Web Crossing
In recent versions of Web Crossing, you can simply use the Allow/Deny list in the Web Services Control Panel to access to your site.
For earlier versions without this, you can control access at your firewall/network level, or use something like the following in WebX:
The following example uses authenticateFilter macro to restrict access to just the local machine ("127.0.0.1") and puts up a "404" page otherwise. Use this as a basis for other IP restriction schemes.
If you don't care about 404s, then just add your IP or range of IPs to the allow/deny list in the web services control panel, and then deny all others (example: a=22.214.171.124.5 or perhaps a=1.2.3.*.* is all you need to do because the d=* is implicit).
%% macro authenticateFilter %%
%% if envir.remote_addr == "127.0.0.1" %%
%% user %%
%% else %%
<h2>HTTP Error 404</h2>
<p><strong>404 Not Found</strong></p>
<p>The Web server cannot find the file or script you asked for. Please check the URL to ensure that the path is correct.</p>
<p>Please contact the server's administrator if this problem persists.</p>
%% endif %%
%% endmacro %%