DotNetNuke portal alias localhost problem - dotnetnuke-8

I deployed a website using DNN 8.0, everything works fine except that it cannot be accessed from outside, as it always redirect to “http://127.0.0.1/dnn”, and i’ve added alias “192.168.20.38/dnn”, it still redirect to localhost, and also try different alias mode, and changed the primary flag in between, but still failed. Any clues?

192.168.20.38 is a local IP address that is not routed. You need either a public IP address or a host name for that.

Related

Access virtual host without domain pointing to it

I have a domain which pointed to an IP address (A). This IP address hosts several other websites with their domains. I now forwarded this domain to another host but I also need to access the old site which now does not have a domain pointing to it. Of course I can't just access the old site by typing the IP address into the browser. How can I do it instead?
If you're on unix, you should modify the /etc/hosts file; C:\Windows\System32\Drivers\etc\hosts if you're on Windows. (This will likely require admin privileges.)
This overrides the public DNS which would otherwise map an IP to a domain name. The change tells your machine that the old IP address is the location of example.com, where your hosts file has a line that reads:
xxx.xx.xx.xx example.com www.example.com
And xxx.xx.xx.xx is your old server's IP.
Remember to comment out or remove the line when you're done! You may confuse your future self, otherwise!
"Host" Header in HTTP is used to identify which of the many websites to visit on a virtual hosting web server. Virtual hosting is when a single IP address hosts websites(http content) for many different domains.
For eg. "Host: www.example.com"
You will find such a header in all virtual hosting websites.
Use an extension like Tamper chrome to add Host to the header. Specify your domain name in this header.
Illustration -
The university in which I studied uses virtual hosting, hence using Host header is imperative.
See the following image.
Now, if I type the IP address (obtained from ping utility) directly. You see a default page.
Now If I use tamper chrome extension to add Host header.
We can see that it lands on a page on bvcoend.ac.in domain.
I have to polish it further so that the landing page is the home page, but this process captures the essence of Host header used in virtual hosting.
Update : Using Fiddler to modify Host header seems to work fine for me, somehow tamper chrome isn't doing it's job perfectly (miss the good old Firefox Tamper data days).

How to change IP of your server access from 0.0.0.0:8181 in Perfect 2.0?

I'm new to server side programming, Since Perfect is out for Swift i am trying to get started with it.
I started PerfectTemplate and it's working on http://0.0.0.0:8181 but not accessible using my public ip i.e. say for example http://123.45.67.89:8181
Command+Click property "serverPort" it will take you to the implementation of HTTPServer.swift. There is another property "serverAddress" which is set to "0.0.0.0" by default.
you can change this by adding the following line
server.serverAddress ="123.45.67.89"
just above where you set
server.serverPort = 8181
However the new IP must be you're localhost IP found in system network preference. public IP address won't work in this case.
See the attached screen shot.

Redirecting a subdomain to AWS instance

I have a domain example.com that is being host on webfaction. However i would like to redirect its subdomain (e.g sub.example.com) to one of my AWS instance which has public DNS of:
https://ec2-xx-xxx-xxx-xxx.ap-southeast-1.compute.amazonaws.com:8083 (please note the port number).
This instance is then assigned with elastic IP address.
So far, the solution that i tried is:
Using CNAME redirection, however it does not work because of this: https://forums.aws.amazon.com/thread.jspa?threadID=55995
Then i proceed to use the old fashion .htaccess:
Redirect permanent / http://ec2-xx-xx-x-xxx.compute-1.amazonaws.com
order deny,allow
However, i want to keep the sub.example.com on the address bar instead of changing it AWS public dns.
Does anyone know what is the best way to solve this? Thanks
If you have assigned an elastic ip to the instance, you should be able to just setup a new 'A' record in your DNS that points directly to that IP address, no?
The listening on the specific port should be handled by the bindings on the instance (either thru apache or IIS)

Facebook Apps: Allowing a single Facebook App to run on arbitrary private network address

I have a development server (Java servlet container) running on my computer inside my private network (IP range 192.168.0.0 to 192.168.255.255). This development server executes my integration testing environment. This testing environment has its own Facebook App ID. Having the server run in the 192.168.x.y range allows my colleagues to test the website, login to my local website with their Facebook accounts etc..
At https://developers.facebook.com -> in the Facebook Apps settings -> located under "Basic settings" -> in the "Website with Facebook Login" field, I have set http://192.168.2.106:8080, as this is the address-port combination that my development server binds to.
Due to DHCP, my computer now has a slightly different IP address, namely 192.168.2.109. Whenever I start up my server and then try to do anything Facebook-API related (e.g. Facebook Login), I get the following error message from Facebook
{
"error": {
"message": "Invalid redirect_uri: Given URL is not allowed by the Application configuration.",
"type": "OAuthException",
"code": 191
}
}
Is there a way to have a Facebook App allow a "range of IP address websites with Facebook Login"? What other solutions can you suggest?
My colleagues shall be able to also start up the development server on their own machines, with their own private network addresses. Therefore, the same Facebook App ID shall work on different machines with different IP addresses and still be accessible to everybody inside the private network.
Notice that setting "Website with Facebook Login" to localhost makes the development server only available to the same machine it is running on. This unfortunately prevents colleagues from accessing this development server instance.
Update
Filed bug: https://developers.facebook.com/bugs/606277079382609
If you could get away of using localhost, then there is a very simple way:
Make the facebook app redirect to http://lvh.me:3000/ (or whatever port your server is listening on localhost). A benevolent developer owns the lvh.me domain and had the DNS setup to point to localhost. I've tried this and that's what I used for development testing.
Similarly, you could do stuff like that and points a DNS record of a domain you own to a range of local ip. I am not familiar with DNS so I am not sure how to set it up or if it's possible.
If you're running on Windows you could try changing your hosts file in C:\Windows\System32\drivers\etc
and add your IP to an imaginary domain (your colleagues should do it too) and put that domain in Facebook Settings panel.
I'm not sure about this so tell me if it works :)
As far as i know you cannot setup an IP range in your application setting, the redirect_uri is typically meant to handle urls with domain names, which is usually the case with with public websites.
The best way to avoid this problem is to make sure you local development server has always gets the same IP, which is generally a good practice if you are writing a server.
there are several ways to do it depending on the network setup, here are two option:
Setup your DHCP server to always assign the same IP to your dev server MAC address
Bend the rules a little bit and setup your computer to claim an unused IP address. DHCP servers typically assign IPs in order (will start from 192.168.1.1 and work up to 192.168.254.254) so have your computer claim an IP in the higher part of the range (Ping the IP first to make sure it's not being used)
Instead of using an IP address, use localhost.
So hxxp://192.168.1.20 would become hxxp://localhost
(replace xx with tt)
This resolves back to the local machine, whatever its IP address is. I am assuming that your development server is running on your PC, using WAMP or something similar. I draw this assumption because you state that it must run on any laptop in any network environment.
If you own a domain you could create a subdomain test.mydomain.com pointing to 192.168.2.109.
When your address should change again, you can change the entry accordingly.
There is no reason why a DNS entry could not point to a IP address from the 192.168 range. For someone outside your network it will not be of much use, because he can't access your IP address from the outside, but for your co-workers within the network it will work.
If a coworker wants to run the web app on his own PC, he can of course override this setting using his own hosts file.

Binding to alternative IP in HttpWebRequest doesn't work in Windows Server 2008

I am trying to bind a HttpWebRequest call to a specific IP on my server (which has many IPs). I have successfully written this code using BindIPEndPointDelegate and it works well on my local machine (Windows 7)
My issue is with Windows Server 2008. When I run the same console app on Windows Server 2008 it fails to bind to the IP when using the delegate. To complicate matters further, it seems to work for some destination URLs (http://www.microsoft.com) and doesn't work for some (http://www.google.com, http://www.facebook.com)
If I remove the IP specific binding (delegate) and run the app it works for all URLs.
The IP I am binding to is the default server IP address - meaning, in both scenarios the same IP should be used. I have verified this and it uses the same IP if I don't bind using the delegate. If I explicitly specific the IP it fails as described above.
I have tried turning off firewall, IIS & Antivirus - the problem persists.
Alright finally figured it out.
Upon testing again I found that specifying IPAddress.Any did not work either. On the other hand, IPAddress.IPv6Any worked fine.
Finally, I unchecked the IPv6 protocol in network adapter settings and the app starting working properly for all URLs and binding for all local IPv4 addresses.
Not sure if this is a bug in .NET code or feature - but disabling IPv6 fixed it for me.
Lastly, if anyone is facing "The requested address is not valid in its context" while making calls with binding, try disabling your antivirus.