Webserver cant find its own webaddress - windows-server-2008

I got a Windows Server 2008, with 2 webapplications running on it, www.myapp.com and update.myapp.com. When Im not on my webserver, the urls works fine, but they doesnt work when my server request those urls. However, localhost works on webserver. The server can also reach other websites just fine.
Now I need www.myapp.com to be able to talk to update.myapp.com, but since my server doesnt want to talk to itself, it wont work. How can I solve this?

Strange. This is hacky, but I'd edit your hosts file to point those two domains to localhost (127.0.0.1).
The windows hosts file should be in :
%SystemRoot%\system32\drivers\etc\
There should be an example in there. Just add two lines for those two addresses.

Related

Use Windows 2016 server with Xampp to host more than 1 website

I have tried all kinds of things, read all answers, and configured the bananas out of it, but I cannot seem to get the following working:
A windows 2016 server with XAMPP, to host more websites than 1.
What have I done:
I have altered the httpd-vhosts.conf as described all over the web with allowing NameVirtualHost, and setting up virtual host with documentroot, servername etc.
I have pointed a domain with the a-record to this server
installed the latest XAMPP release to date
changed the windows hosts file, as described everywhere (127.0.0.1 domainname.com)
What works:
I can get the domain working on my server's browser. When I enter the specific domainname.com it shows the hello world page I made in the specified folder. The domain resolves and shows the page that is in de directory accordingly
Besides that, the localhost of apache is also working, I have 2 sites working, but only on the browser of the server, on the machine itself.
What does not work:
Only 1 thing. when I want to access the domain from any other machine than the server (from outside so to say), it will not work, but when I ping the domain on my home-pc it resolves to the server.
I am at a loss. Been at this for hours, and beginning to question if it is even possible.
Can anyone tell me what I am doing wrong here, or if it is even possible to have more than 1 website to work on XAMPP and resolve form the outside?
Thank you in advance.
It was windows firewall that stopped all inbound connections. I finally figured it out!

Apache - hosts file point subdomain

I have a site I developed locally for a client. They have an existing live site (at www.livesite.com). I want to move the developed site to their server, but I want to test it on their server before it's live.
I thought I'd install the site in a sub directory on their server (www.livesite.com/dev), and then using my hosts file, make my browser think it's viewing the final live URL (www.livesite.com).
However, I've tried various combination of things in my hosts file, and I can't seem to get it to work. The server ip followed by the domain / sub-domain.
I'm running on MAMP on OSX. Anyone have experience with this?

How can I test a comet ajax site on a single host and work around browser simultaneous connection limit?

I am using the comet long-polling technique with apache, php, jquery.
I've got a basic comet update running and it works great. I'm now attempting to build a more complex comet script, and I want a better way to debug.
My comet scripts use $.ajax() with a long timeout, and the server side just sleeps until it either runs up to the timeout or has an event to send to the client. The comet requests go to a different subdomain than the main ajax requests.
For normal pages I edit and test on a linux laptop. I've got apache, mysql, and php with a test database and mirror image of the site. I can edit, save, and see the changes with no upload step. For the comet stuff I've been having to upload to a server to test. This requires me to set up a few fake servers, but mostly it requires me to upload changed files for each test. I've got a mostly automatic upload script, but it's still too slow.
The problem testing locally is the long timeout. The browser won't open another connection to the same server while the comet request is still open. I don't have a subdomain locally so I have all the requests going to the same server so they basically block each other.
I've tried a number of things to make this work and none really do it. I tried first to change my browser setting for number of simultaneous connections. This didn't work in firefox on linux, and I didn't find anything about changing this limit on other browsers.
I tried setting my hosts file to give me two names that map to my ip address. Then I tried configuring VirtualHost conf directives in apache, but that didn't work. I think because apache is looking for an actual dns server to tell it the hostname, not just my /etc/hosts file. Maybe I can run a local dns server to fool apache into thinking my box has two names, but that just seems like a real long way around this problem.
So, does anyone have an idea of how to make this work on one ip address/host?
I'm new to the comet thing, so maybe I've just got the wrong idea about something. Maybe this isn't even possible. Either way, it's time to just ask if this is already a solved problem.
It really should be possible to use /etc/hosts to fool Apache. It certainly does work on Ubuntu Hardy with Apache 2.2.
Try to give different hostname to you local address. Simply add a line like this to /etc/hosts:
127.0.0.1 a.example.com b.example.com c.example.com d.example.com
(Note: use a tab after IP)
Validate this with a ping
ping a.example.com
In you apache configuration, you may use a wildcard alias together with a named virtual host:
<VirtualHost *:80>
ServerName example.com
ServerAlias *.example.com
## snip ##
<VirtualHost>
Instead of using example.com, you might want to use something that's under your control. I use local subdomain of our company's domain (i.e. something.local.molindo.at).
Now you can use different subdomains for your test, each with its own limitation on concurrent connections.
You may need to restart your browser to get this working.
I have made something similar and my hosting gives my max queries limit reached which actually should not happen. But I have read that if my php code is in infinite loop.. ie the sleep mode the hosting detects it and makes db connection user as to be using more queries than allowed. That is alot to presume but I have found a solution to that with same speculations.

Basic apache server, mapping 127.0.0.1, to 10.0.0.7:8000

I'm working on this project where the client has a virtual server setup. I installed apache and such and got everything working fine on localhost. But in order for it to show up on the internets, the people that run this virtual server needs me to:
"If you try and reach 10.0.0.7:8000 you do not come to the index page but if you do localhost the index page is shown. You need to configure so that it listens to it´s Local IP 10.0.0.7."
Now I am kinda new to this court (I am just a simple webdev that likes to put everything together localhost and uploads his stuff with regular ftp). I bet the answer is simple, but their hotline is closed because they are accross the atlantic. Can someone tell me how to go round and do this? (I am almost blushing because for my not knowing). The virtual server is running on Windows 2003 OS
I believe you should find it relatively easy to do: Listen Directive
Go to the httpd.conf file in your apache/conf dir and change the port and address in the listen directive as:
Listen 10.0.0.7:8000
Don't forget to restart the service.

My Apache setup alongside IIS

I am trying to learn PHP. I am having trouble getting Apache working correctly on my Vista Home Premium machine.
I have IIS7 running and I would like to have Apache running along with it. I was looking around on the web and some say that it would be fine having the two together as long as they are looking at different ports.
I left IIS looking listening on port 80 and I edited the httpd.conf file in the apache2triad/conf folder to listen on port 8080 and changed the server name to localhost:8080. When I go to localhost:8080/phpmyadmin the page that allows me to create a database looks like all the page styling is off so I know that something is already wonky.
I enter a database name and click the Create button, then receive a 404 error from IIS. It says that it is looking for a file at:
Requested URL:
http://localhost:80/phpmyadmin/db_create.php
Physical Path:
C:\inetpub\wwwroot\phpmyadmin\db_create.php
It's pointing to my inetpub folder but all of my PHP stuff is in the c:\apache2triad folder.
Can someone please tell me what I am doing wrong? Thanks.
If you want to get a URL from your Apache server, you need to use port 8080 instead of port 80 (which is where you say IIS is running) - so your URL should be http://localhost:8080/phpmyadmin/db_create.php
As Shawn said, if you're not familiar with apache at all, you're probably better off setting up PHP under IIS - see http://www.php.net/install.windows