Which server will be best for website Xampp or Windows Server 2008 - server

I'm using Xampp server (Apache server ) for my website however it has some connectivity issues with the internet and I can't access it online. So I was advised that I must use Windows server 2008. Let me know if this is a good idea or not. The Xampp has issue with port forward through Dynamic IP. Let me know the best option that I have.

To connect your Apache webserver to the internet you don't need to do any local port-forwarding, you should try port-forwarding with your router. If you're runing linux, you should type ifconfig and look for your default gateway, that's the ip your router is using.
Some ISP's force you to use their own website to port-forward though. Standard, apache always runs on port 80, which you should allow in your firewall using the TCP protocol.
Perhaps you could explain your situation more, Windows Server won't make the hosting easier though. You will most likely encounter the same problems.

Related

Unable to access jetty server with local IP address

I have configured jetty-maven-plugin in my eclipse Mars and I can run the server using jetty start and stop goals. I can able to access the website using http://localhost:8080/myapp but not using local IP address(i.e., http://192.168.0.5:8080/myapp) from my own computer or other computers connected in the same network via LAN and Wi-Fi.
As mentioned as a solution in these posts,
how to make jetty server accessible from LAN?
Configuring Jetty to accept connections from all hosts
I configured the server host to 0.0.0.0 from localhost to listen on all hosts. With this setting I can see on server start log,
INFO:oejs.AbstractConnector:Started SelectChannelConnector#0.0.0.0:8080
and it works only on http://localhost:8080 but it's not accessible from http://192.168.0.5:8080.
I also tried running that if the interface is accessible using the Networks Interface Listing as mentioned in this comment. and I got,
Display name: NETGEAR WNA1000M N150 Wireless USB Micro Adapter
Name: wlan4
InetAddress: /192.168.0.5
I also tried turning off my Windows Firewall/antivirus but din't help. My jetty version is <jetty.version>9.3.0.M1</jetty.version> and JDK 1.7. What could be the problem? Any help is appreciated.
McAfee Endpoint Security was the culprit here. It was blocking the requests with IP addresses from my very own computer. Turned off the firewall inside the Antivirus and I was able to access the site with http://192.168.0.5:8080/mysite from the browser and other devices connected through the network.
Sometimes some other program opens your port on external address before you do that with Jetty. It will receive all traffic instead. On Windows you will not know it if you reuse port (that is Jetty's default behavior). Check with netstat -ano what is the IP of the process that is indeed listening on 0.0.0.0:8080. Verify if it is your Jetty process only.
Then try connecting with telnet or netcat and see if you can open the connection and what is the response.

gethostbyname not working for external server

I am writing an application with C++ to connect to my server.
I am using gethostbyname(). It is working fine when I give host name as 'localhost'. but if i try any other site like google.com, it fails.
Can anyone please tell me what could be going wrong.
I can access those websites through browser. Note: I have proxy set up in my browser.
Is thr proxy causing issue with gethostbyname()? if yes, how can I mention proxy in my C++ code?
Based on what you describe in your question, it appears that your machine is on a corporate network that is firewalled off the Internet, all access to the web is via a web proxy, and that your network does not have Internet DNS resolution.
Even if you managed to succeed in resolving an IP address, you will not be able to make an outbound connection, unless your firewall offers a Socks proxy, or an equivalent.
If your intent is to write a client that accesses web sites via HTTP, you will need to use your corporate HTTP proxy to do that. Contact your system administrator for more information.

How do I access the database from my browser?

I noticed with Postgres and other databases, the database itself runs a local version of a server.
For example, mine is running on localhost:5432.
Curiously, I went to my web browser and tried typing in that address to see what I'd get, but I got a response that "This Web Page is Not Available".
I also tried things like localhost:5432/mydata but also to no avail.
Shouldn't I be able to see something if I visit the database through my web browser? If yes, how do you do it? If not, why not?
Postgres is a service running on a port. A web server is also a service running on a port (80 and/or 443 usually). There are a lot of things running on various ports on any server, heck, on any single computer. That doesn't mean that everything is interchangeable. Ports 80 and 443 are commonly agreed to serve HTTP(S) connections. HTTP is a specific protocol which specifies how two things can communicate on a specific port. Postgres is not speaking HTTP; you need to speak Postgres' particular protocol if you want to talk to it. The browser does not speak that protocol, and Postgres doesn't by default offer communication in any protocol a browser understands.
A web browser expects to "talk" to servers using a protocol it supports. Webbrowsers support obviously http. Some do support other protocols, like ftp. But your postgres does not speak http. So you don't see anything. The port number is just telling over which channel the server is accessible. Any protocol can be routed over any port, but usually http can be reached over port 80. Your postgress over port 5432.

Is there a way to make it look like two programs are listening to port 80

I do know that I can't have two programs listening to the same port, but I am wondering if it is possible to fake it somehow, for an example:
My machine has two applications, one listening to port 80 and the other to port 6653.
If I get an incoming connection, let's say mysite.com:80/chat then it would be forwarded internally to the application listening on port 6653 and the data returned from that server would be forwarded back to port 80 somehow.
The reason I want to accomplish this is because there are many firewalls that seem to block connections to ports other than 80.
I have a chat server that I want to run on port 80, perhaps I could get another IP and machine for that, but it feels like too much trouble for a single chat server.
Any helpful feedback would be appreciated. Thanks!
You can probably do this with mod_rewrite if you're running Apache. That link has plenty of examples, including what you want (I think).
EDIT: I see you've updated the tags to say "asp.net". I'm guessing that you're not running Apache, then. I'm sure there is a similar tool for IIS, or you can use a proxy server that does the same thing.
There is a module called URL Rewrite that you can install on Windows Server 2008 (and R2) that is functionally the same as Mod_Rewrite. Download it here: http://www.iis.net/download/URLRewrite

TCP Ports when Web Server communicates with SQL Server Express

We have a asp.net 3.5 web application running on a hosting company's web server that's got a very strict firewall setup. The web application communicates with our sql server express 2005 which is on a completely different network.
The problem is that the web applications sends our sql server a random port number to connect to when it connects to our sql server on port 1433. Hence the web application can not connect to our sql server because then they have to open a whole range off port numbers on the firewall which they are not prepared to do.
My question is the following. Can you specify either in your connection string or somewhere in your web.config the port the client sends to sql server to connect back to on?
Thanks
If I'm getting you right, you want to do something that goes against how TCP/IP port handling is supposed to work.
You want the web application to always use the same port when connecting to your SQL server? This would mean you can only have one connection open at any given time, and so only one user at any given time. The client is supposed to communicate with a server from a "random" port. It's the basics of networking. At least how I learned it.
I'm not sure you can even force it to use the same port every time, and even if you can I'd advice against it.
I'd say the problem is the firewall, and not your application. I can understand that the SQL server only wants to speak to the IP address that your site is on, but it shouldn't really care which port the client wants to talk over (something like [website-ip]:* -> [sql-ip]:1433). To me, it seems like who ever set up the firewall has some kind of crazy firewall ideas, but maybe that's just me.
Is it possible that your SQL Server Express is configured to listen on dynamic ports? If the 'TCP Dynamic Ports' value is 0, I think it will be dynamic even if you have a specific port configured. That value should be cleared completely.
You can specify port if you are using TCP/IP.
For ex:
Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;
where DBMSSOCN=TCP/IP