Forum Moderators: phranque

Message Too Old, No Replies

problem with https

         

sorcerer

2:23 am on May 3, 2012 (gmt 0)

10+ Year Member



Hello all,
I have a web base app which I can access within my home network through a url such as:
[192.168.0.101...]

Suppose my external IP is 12.123.1234.12.

I want to access this app from the outside with something like this: [12.123.1234.12...]

I configured the file httpd.conf and httpd-ssl.conf successfully with the instructions from [rubayathasan.com...]

I created a certificate and a private key. I also forwarded port 9999 on my router and created an exception of port 9999 on the firewall (OS is WinXP Pro). After I done all these, I can access this web application using this url:
[12.123.1234.12:9999...]

However, when I typed this url (i.e. same external IP without https and port number): [12.123.1234.12...]
I can access this app too. This is not what I want.

So, I am trying to find a way to access this web based app from the outside using https only (i.e. banning the external access using regular http such as the example above:
[12.123.1234.12...] I played around with the settings on the firewall and those on the router but without success. Can anyone give me some ideas/hints how to resolve this problem?

Thanks in advance.

phranque

5:19 am on May 3, 2012 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



you could use mod_rewrite to respond to http: or non-port-9999 requests with a 301 external redirect or 403 Forbidden status code.

sorcerer

2:12 pm on May 3, 2012 (gmt 0)

10+ Year Member



Thanks for the feedback. I am ignorance and absolutely not familiar to scripting - but I am learning.
Background: the web app is a 3rd party app. Before I can use it, I installed Apache server and a database and the php engine. So I cannot access or touch any php files from this web app (It is a scientific equipment monitoring app).
So the only places I can act on is through Apache’s script files such as httpd.conf, httpd-ssl.conf, changing the settings of the router, firewall etc.
I googled mod_rewrite and “403 forbidden”. It seemed to me the instructions of how to use mod_rewrite is through the content of a html page or php page of the web app.
Is there a way to implement mod_rewrite in script files that I can access such as httpd.conf? Or do you know of a reference tutorial page where there are examples how I can achieve this: stopping external access to http://example.com but allows [example.com...] or [example.com:9999...] to get through?
Thank you.

phranque

8:06 pm on May 3, 2012 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Using mod_rewrite to control access:
http://httpd.apache.org/docs/2.2/rewrite/access.html [httpd.apache.org]

http://httpd.apache.org/docs/2.2/rewrite/flags.html#flag_f:
Using the [F] flag causes the server to return a 403 Forbidden status code to the client.

sorcerer

3:04 pm on May 5, 2012 (gmt 0)

10+ Year Member



Thank you phranque! All is well. Learn something new & useful.
Case can be closed.