Hosting Website - windows

I'm hosting a website on Windows Server 2012 R2. I'm able to access the site with no problem via the assigned ip address and as long as I'm on my home network. However, when I try to access the site using a public ip address, it defaults to my NAS (MyBookLive).
Baffled.
Thanks.

This is intentional.
When a user connects to your ip address, any inbound requests are blocked for security. You would need to open ports on your home router (most likely 80 and 443) and direct the traffic to an internal ip address.
Even if you do this, it is very likely that it would not work. Most residential internet providers do not allow you to host web/mail servers on the internet. If someone compromises your webserver, they would have access to your entire network.
You are better off with a dedicated hosting provider (AWS, Amazon, Google Cloud).

Related

Why is wamp Apache not allowing APIs to access my www folder?

I have a piece of code where an external API needs to access my "www" folder for images. When I load the url, "http://localhost:8001/images/1.jpg" from the browser, it does show the image. But when I access it through the code it says, "connection refused". I have turned off the firewall as well. I also tried using the IP address instead of the "localhost".That doesn't work either. Please help.
Remember the domain name localhost has a special meaning. It always means this PC, or more accurately this network cards loopback address.
I cannot access your PC from here using the domain name localhost, as it will always be looped back to my PC.
If you want an external site to make a call to your PC then there are a number of things you will have to do.
Buy yourself an domain name, you either buy a real one or use a Dynamic DNS service like dyndns.com or or noip.com
Or you use your routers WAN ip address.
Then you must amend the httpd.conf file so that Apache allows access
from all ipaddress's
Then you must Port Forward your Router so the the NAT firewall allows
external accesses on port 80 to be forwarded to the internal PC
running Apache, and only that PC.
And possibly amend your software firewall on the Apache PC to allow access from external sources on port 80

java socket server hosting

I am creating an android client app connected to a Java server using sockets. At the moment I am working both on my pc. How can I upload my Java server to an online server so I can set my app to friends and test it?
I used OpenShift but could figure our how and if I can use it for what I want.
Also I looked at Amazon ec2, but they need credit card information, something that I would prefer not sharing for this.
Is there any way I can do this for free?
Thanks
Make sure you have a computer able to connect to the internet, and that can run 24/7. Then run your server on that computer, assume you run it on port 8080. Make sure that your host computer's IP address is it to static, otherwise DHCP will give it a different IP every time it connects to the router.
To allow your friends to connect, unless if they're on the same LAN as your host, you will need to port forward port 80 -> ComputerIP:8080 on your router. Once that's done, you will need to retrieve your router's global IPv4 address from it's configuration page and then send that to your friends.
If they're on the same LAN as your host, then you can just give them the IP address of your host computer.
If you port forwarded your server and you would like to get a host name, like stackoverflow.com, you're going to need to buy that from whoever owns the host name you would like to use. I don't know many details about how to update the DNS servers though.
If your server is local and you would like a host name, then just go onto your router configurations page and tell it to automatically assign each computer the default gateway as the primary DNS and then add a mapping in the router's DNS settings to map the host name to your computer's local IPv4 address. Note that not all routers support this feature.
Edit: You'll also need a good bandwidth to support multiple simultaneous connections.

DNS resolution fails in web browser but nslookup succeeds

We are a small, 300-seat organization with a mixed BYOD and Active Directory environment (Windows Server 2012 Standard, Windows 7 Enterprise) and we are having a very strange problem involving very specific-scope failures to resolve our organization's domain name on our domain-joined, company-controlled machines. For the purpose of this discussion, I'll use company.com instead of our domain name.
Background:
Active Directory Domain Controller is located at 172.16.1.3
The AD/DC machine is also running DHCP, DNS, and HTTP (IIS)
Our organizations websites at company.com and subdomain.company.com are hosted by IIS on the AD/DC machine
We have a split-DNS scenario in which the AD/DC server is used for internal DNS resolution but a different, off-site server provides DNS resolution for public queries
The IP address corresponding to company.com and subdomain.company.com is the public IP address used by a firewall at the edge of our network (both on the AD/DC DNS server and the off-site DNS server)
The firewall is correctly configured for NAT to pass HTTP and HTTPS requests it receives on its public IP address to the internal IP of the AD/DC server and reflects
Scenario 1:
A user on a domain-joined Windows 7 Enterprise machine is connected directly to our local network with local address 172.16.6.100 /16, issued by the DHCP server.
The DNS server entry is provided by DHCP (172.16.1.3)
This user is able to access the websites hosted at company.com and subdomain.company.com
Edit: nslookup has been run in this scenario and correctly returns the proper DNS record from the internal DNS server (172.16.1.3)
Scenario 2:
The same user on the same domain-joined Windows 7 Enterprise machine goes home and connects to the Internet using their residential ISP
The IP and DNS server entries for the client machine are provided by DHCP
This user can access any internet resources, such as google.com
This user cannot access the website at company.com or subdomain.company.com (a "host not resolved" error is returned)
When this user runs nslookup on company.com they DO receive the correct public IP address provided by DNS
HTTP/HTTPS requests to the IP address succeed and a webpage is returned properly by the server
This issue prevails across all web browsers
Using tracert company.com returns "unable to resolve target system name"
Using ping company.com returns "could not find host company.com"
When running Wireshark on the client before/during a failed request, no packets are sent by the client machine (either for DNS resolution or for an initial HTTP/ping/tracert request)
Restarting the DNS Client service does not resolve the problem
Stopping the DNS Client service does not resolve the problem
Using ipconfig /flushdns does not resolve this issue
Using route /f does not resolve this issue
Resetting the network connections using netsh int ip reset does not resolve this issue
Edit: nslookup has been run in this scenario and correctly returns the proper DNS record from the DNS server specified by the DHCP settings of the network used by the user
Scenario 3:
This same user on a personal (not domain-joined) Windows 7 Professional computer is able to access the websites at company.com and subdomain.company.com when connected to our local network
Edit: nslookup has been run in this scenario and correctly returns the proper DNS record from the internal DNS server (172.16.1.3)
Scenario 4:
This same user on a personal (not domain-joined) Windows 7 Professional computer is able to access the websites at company.com and subdomain.company.com when connected their home network
Edit: nslookup has been run in this scenario and correctly returns the proper DNS record from the DNS server specified by the DHCP settings of the network used by the user
Final Notes:
This issue seems to be generalized to affect all company-owned computers. We are using a common system image for all company-owned computers, which was just loaded in August. I have been scouring the internet in search of possible solutions and have come up empty handed so far -- I really appreciate any suggestions or advice you may have.
This is quite an interesting scenario. Looking at your scenario 3, user with personal computer can access the services but why is the DNS entry coming from your corporate IP and not users home DNS. Is the machine on company network?
Verify this:
When user tries to access service from home on company computer, is the IP details from home internet router or company network via VPN?

How I can access FTP server based on different network

I have set up a FTP server with Apache FTP server on local machine, this machine can access internet but its IP address cannot be accessed externally.
I also have another machine in a different city - it can access the internet but it is same in that its IP address cannot be accessed externally. The two computers are not on the same network so they are unable ping each other.
How I can use FTP client from another machine to access the FTP server, I know it should be impossible but do you guys have any workarounds (whatever code change or other approaches)
I am in the US - do you guys have idea how I can make my home IP publicly accessible?
it is very possible if you control the firewall that the server is behind. this is standard network configuration, and you can find hundreds of tutorials online, but the most important bit of information is the firewall, not the ftp server. you configure port forwarding on your firewall to forward incoming ftp requests to your internal ftp server. also, you will want to use "passive" ftp from the client because the client is also behind a firewall.

setting up home ftp server using filezilla

I googled, followed all the instructions but still stuck, and unable to create a home ftp server.
My internet is from dsl modem -> vonage router -> wifi router
FileZilla server ip is 127.0.0.1 and it works fine when tried from command prompt. But I need it to be accessible from outside.
I enabled ftp on wifi router's web settings page using virtual server setting.
I am stuck at this point, I don't know what else to do further. Any help is greatly appreciated.
Also, if you are planning on accessing your server remotely, (not in your network) you will have to enable port forwarding on your router. (Use the ip address of the machine running the server and use port 21) Otherwise, you only be able to connect while in your LAN.
This pretty much summarizes your needs(via lifehacker.com)
If you're FTP'ing across your home
network (like from your upstairs PC to
your bedroom PC), you can reach the
server by using its internal network
address (most likely something like
192.168.xx.xx.) From the command line, type ipconfig to see what that address
is. If you want to log into your FTP
server over the internet, set up a
memorable URL for it and allow
connections from outside your network.
To do so, check out how to assign a
domain name to your home server and
how to access your home server behind
a router and firewall.
Original Article
How to assign a domain name to your home server
How to access a server behind a router and firewall
You need to be able to access your internal network from the internet. Consider using a service like dynDNS if your router supports it.

Resources