apache localhost sites opening in Firefox, but not IE or Safari? - apache

I'm running WAMP on Vista and have Apache virtual hosts and my hosts file all set up to allow me to test sites locally using an address like this:
http://testsitex.localhost:8080
Only problem is, it only works in Firefox. IE and Safari (currently the only other browsers I've tried, and the two I'm most concerned about) display an an error.
I'm not currently in front of my machine but the error is something along the lines of:
502 Bad Gateway
Problem with DNS Host Lookup
Can anybody tell me what's going on?

I would try changing it from testsitex.localhost to testsite.loc and see if you have the same problem. Alternatively, try pinging it from the command prompt, and see if you're seeing the same problem.
Another thing might be that Firefox ignores the windows proxy, whereas IE and Safari likely use the default windows proxy (settings -> control panel -> internet -> connections -> lan settings). If your proxy doesn't have the hosts file, this would explain it.

Have you put testsitex.localhost into your HOSTS files?

Related

Is it possible to block cookies in IE11

I am testing(on localhost on Windows 7 64 Bit) the behaviour of my web application when cookies are blocked.
When testing on IE11, it seems you cannot block cookies, even when the IE11 settings show that I have blocked cookies.(I have also tried uninstalling & re-installing IE11, just in case something was broken, but cannot block cookies.)
I have researched and been to the following places but no answers;
Cookies disable doesn't work in Internet Explorer 11 using advance setting
Cookie disabled issue in IE
document.cookie is still accessible on IE11, even though cookies are disabled
https://superuser.com/questions/1000545/internet-explorer-11-cant-disable-localhost-cookies
Or may be I should just forget about Internet Explorer ?
(Thanking the coding community in advance)
I think you are facing the same issue with me. i searched a lot too.
What i figure out is that Cookies setting only impact on websites which contains real domain (ie: examples.com, abc.net,...)
you can change the localhost domain by editing a host file in (C:\Windows\System32\drivers\etc)
Include one line at the end of that text file like below:
127.0.0.1 testweb.net
Now, whenever you type testweb.net, it will return the page as same as the localhost does.

ERR_CONNECTION_REFUSED exclusively in browsers

I was working on a website on my local computer (mac OS High Sierra) and had put some redirects in the websites .htaccess file (in order to get images from the remote server instead of downloading them). After this it seemed that I could no longer access the website from my Chrome browser. Chrome would answer to any URL leading to the remote server with ERR_CONNECTION_REFUSED.
I tried other browsers on my computer such as Firefox, Chrome Canary, Chromium and Opera. None of them could provide a connection.
Next I checked with a different internet access via TOR-Browser on the same computer whether I could access the website, and it worked.
Next I checked via Terminal whether I could connect to the remote server with ping, nslookup and traceroute. All connecting to the server as expected.
I googled up possible solutions to this problem but could not find one so far. I had read that resetting the DNS cache could help and tried sudo killall -HUP mDNSResponder but it did not.
I did not edit the /etc/hosts file; a restart of the computer did not help; a reset of the .htaccess to the previous state did not help; resetting the caches in the browsers did not help.
How can I access the remote website from my browsers normally again?
EDIT1: Related question: Failed to load resource: net::ERR_CONNECTION_REFUSED for only selective images from instagram API
EDIT2: After about one day I was able to access the remote website again with no further incidents of ERR_CONNECTION_REFUSED even after putting the redirects into the .htaccess file. So it seems to me of being some sort of caching on my computer which prevents the browsers from accessing the remote website. However I have no clue what caused the error message in the first place and what kind of cache it might be.
Shortly after EDIT2 when I was able to access the remote website again, the ERR_CONNECTION_REFUSED appeared again - this time I tested another device with the same internet connection and I had encountered the connection error too. Now I believe it has something to do with the router and/or it's firewall - not the ISP since I could connect to the remote website with shell commands (named above). The image requests to the remote website seem to cause the router to block further access from browsers, probably as a security measure similar to the situation in this article https://www.cnet.com/forums/discussions/can-t-access-a-specific-website-going-thru-my-router-274637/

Chrome (and ONLY Chrome) Suddenly Can't Connect to Localhost Domains

Well this is odd. As of this morning, Chrome is responding with ERR_CONNECTION_REFUSED when it attempts to connect to web pages at various {subdomain}.localhost domains. Firefox and Safari both connect as normal. I am using Vagrant/Virtualbox running Debian and Apache. Chrome does connect to local domains which ARE NOT using localhost in the domain name. Wondering if chrome released some sort of local firewall?? But not seeing anything about that in release notes.
UPDATE: running curl {subdomain}.localhost in terminal gives me the output as expected (response from web server).
UPDATE 2: I did just find this: https://news.ycombinator.com/item?id=9210484 (Chrome team planning to block all access from browser to localhost wss) -- but I do not see that this was implemented yet.
The answer is in my second update. No more .localhost.
you can try using the port explicitly -> xxx.localhost:8080

Apache CentOS HTTP Test Page displays - but only for my specific browser

A client's website was working fine, until they had some problems with their web host. Temporarily, the Apache CentOS Test Page was visible. The host claim the problem is fixed - and it seems to be - for everyone but me...
I'm using Safari 7 on OS X Mavericks and every single time when I visit their site I still see the test page.
When anyone else uses their own computer with any browser, it works fine...
When I use Chrome on my Mac it works fine... So the problem is just with Safari.
I've tried clearing Safari's cache
I've tried clearing the DNS cache
I've tried a restart
But I've got no idea why I can't access it. I need to access the site to work on it - yes I can use Chrome, but Safari is my primary browser. Any ideas?
It turned out this was caused by an issue in a Regex within Apache's Mod_Security. The Regex falsely identified a string contained within a cookie as being an SQL injection (it wasn't - purely coincidental).

HTTP/MAMP connection between VirtualBox and host system extremely slow

I develop on a Mac with MAMP Pro, and I am running Windows 7 in VirtualBox VM so I can test my WordPress sites in Internet Explorer. The problem is that when I try to load the page in a browser in the VM (http://10.0.2.2:8888) it takes about 30 seconds to load the page.
Most of that time is "Connecting to..." in Firefox and "Waiting for..." in IE, so it seems to be having a long delay finding the host system. If I reload the page and/or browser to another page, it takes just as long for every page.
If I use Safari/Chrome/Firefox on the host system to access localhost:8888 it runs fine. If I access outside sites on the VirtualBox system (including an exact copy of the same website on an outside server) it runs fine. The lengthy delay only occurs when I try to access the host's WordPress site from the VM.
Host: Mac OSX Snow Leopard, MAMP Pro (Apache) on port 8888 running WordPress.
VM: Windows 7 accessing with Firefox 9 and Internet Explorer 9.
Any ideas?
I found the problem, but I thought I ought to leave this here in case others encounter the same thing:
In my case, the problem was a WordPress plugin called "cforms". The plugin has a bug where it tries to load its CSS files without the correct port, so it was trying to load //domain/path/cforms.css instead of //domain:8888/path/cforms.css. The 30 second delay was just the browser timeout for those files.
The problem didn't occur when loading the copy of the site on an outside server because it was just the default port 80. I'm not sure why the site still loaded quickly when loading //localhost:8888, but that's irrelevant.