Connections to external website going to local webserver
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
My issue is that sometimes when programs on the local machine try to connect to an external website, that external website goes to the local webserver instead.
I can't reproduce this problem by using commandline utilities such as wget or curl. This issue causes some repo's when using yum to not work because they 404. Other processes that try to access data on external websites get redirected to the local webserver as well. I can see in access_log all of the logs of the 404's..
This issue started happening pretty recently, within the last week or two that I have noticed. What are some things that I can look at to determine what's wrong or how to go about fixing this?
it sounds like you are behind a router
if so
have you configured CentOS and the network for it ?
but there is not enough information in the post to say
Quote:
My issue is that sometimes when programs on the local machine try to connect to an external website, that external website goes to the local webserver instead.
what programs?
what errors ? if any?
Quote:
I can't reproduce this problem by using commandline utilities such as wget or curl
so wget DOSE work ??
and you can grab files from the internet using it ?
Quote:
This issue causes some repo's when using yum to not work because they 404.
??????????
yum will NEVER give a internet web "404" error
NEVER
This machine has been up for over half a year with no problems until the last week or two. By programs, I mean programs that try to connect to any external website and get data from it. It seems that it just happens when using a domain name (like google.com) as opposed to just using an IP address. It's not program specific. I started noticing this when a Minecraft server running on the machine started showing up in apache access_log when it tried to verify a player's session with the actual Minecraft login webserver. Also started noticing it when the Minecraft server started sending heartbeat requests to the local webserver instead of Minecraft's as well.
I don't literally mean that yum displays a 404 page.. that would be absurd to think such a thing could happen. When I "yum update", this is the output:
Code:
Loaded plugins: aliases, changelog, downloadonly, fastestmirror, kabi, presto, security, tmprepo,
: verify, versionlock
Loading support for CentOS kernel ABI
Loading mirror speeds from cached hostfile
epel/metalink | 11 kB 00:00
Could not retrieve mirrorlist http://apt.sw.be/redhat/el6/en/mirrors-rpmforge error was
14: PYCURL ERROR 22 - "The requested URL returned error: 404"
* base: mirrors.easynews.com
* epel: mirrors.kernel.org
* extras: centos-distro.cavecreek.net
* remi: iut-info.univ-reims.fr
* rpmforge: mirror.hmc.edu
* updates: mirrors.xmission.com
adobe-linux-x86_64 | 951 B 00:00
http://mirrors.easynews.com//linux/centos/6.3/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"
Trying other mirror.
base | 3.7 kB 00:00
http://mirrors.kernel.org/fedora-epel/6/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"
Trying other mirror.
epel | 4.0 kB 00:00
epel/primary_db | 4.6 MB 00:00
http://centos-distro.cavecreek.net/centos/6.3/extras/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"
Trying other mirror.
extras | 3.0 kB 00:00
http://nginx.org/packages/centos/6/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"
Trying other mirror.
remi | 2.9 kB 00:00
remi/primary_db | 277 kB 00:00
http://mirror.hmc.edu/repoforge/redhat/el6/en/x86_64/rpmforge/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"
Trying other mirror.
rpmforge | 1.9 kB 00:00
http://mirrors.xmission.com/centos/6.3/updates/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"
Trying other mirror.
updates | 3.5 kB 00:00
Setting up Update Process
No Packages marked for Update
Those pages don't 404 when navigating to them on my own web browser..
Here's the log that shows up in the local webserver's access_log after running "yum update":
The output from "yum update" is really the only error message I've gotten. Other results, like those from the Minecraft server is just handled by not letting the player login (since it doesn't get the 'OK' from login server), no error is thrown.
I don't know why I can use "wget http://google.com" and get the correct webpage, but from a program it gets a 404 page and that access attempt shows up in access_log.
If I add for instance, "173.194.77.139 google.com" to /etc/hosts, a program will then get the proper page from Google's servers. Without adding anything to /etc/hosts, I can ping google.com all day long and get their IP.. The machine uses Google's public DNS servers in /etc/resolv.conf and can properly resolve hostnames with host or nslookup.
The machine is hosted in a datacenter on the west coast of the US. The Minecraft server is available to anyone, as are the websites on the webserver running on the machine.
remi repo was primarily added I believe to use updated packages of mysql and php. rpmforge for packages like unrar, libyaml, and a few others. Over about the last month, nothing has really updated except for from CentOS 6.2 to CentOS 6.3, and those packages were all from CentOS base or extras repos.
As for your commands, I ran them, then did "yum repolist all", here is the output:
Code:
Loaded plugins: aliases, changelog, downloadonly, fastestmirror, kabi, presto,
: security, tmprepo, verify, versionlock
Loading support for CentOS kernel ABI
Loading mirror speeds from cached hostfile
* base: centos.fastsoft.net
* epel: mirrors.kernel.org
* extras: centos.sonn.com
* remi: iut-info.univ-reims.fr
* rpmforge: mirror.hmc.edu
* updates: mirrors.arpnetworks.com
repo id repo name status
C6.0-base CentOS-6.0 - Base disabled
C6.0-centosplus CentOS-6.0 - CentOSPlus disabled
C6.0-contrib CentOS-6.0 - Contrib disabled
C6.0-extras CentOS-6.0 - Extras disabled
C6.0-updates CentOS-6.0 - Updates disabled
C6.1-base CentOS-6.1 - Base disabled
C6.1-centosplus CentOS-6.1 - CentOSPlus disabled
C6.1-contrib CentOS-6.1 - Contrib disabled
C6.1-extras CentOS-6.1 - Extras disabled
C6.1-updates CentOS-6.1 - Updates disabled
C6.2-base CentOS-6.2 - Base disabled
C6.2-centosplus CentOS-6.2 - CentOSPlus disabled
C6.2-contrib CentOS-6.2 - Contrib disabled
C6.2-extras CentOS-6.2 - Extras disabled
C6.2-updates CentOS-6.2 - Updates disabled
adobe-linux-x86_64 Adobe Systems Incorporated enabled: 2
base CentOS-6 - Base enabled: 6,344+2
c6-media CentOS-6 - Media disabled
centosplus CentOS-6 - Plus disabled
contrib CentOS-6 - Contrib disabled
debug CentOS-6 - Debuginfo disabled
epel Extra Packages for Enterprise Linux 6 - enabled: 7,676
epel-debuginfo Extra Packages for Enterprise Linux 6 - disabled
epel-source Extra Packages for Enterprise Linux 6 - disabled
epel-testing Extra Packages for Enterprise Linux 6 - disabled
epel-testing-debuginfo Extra Packages for Enterprise Linux 6 - disabled
epel-testing-source Extra Packages for Enterprise Linux 6 - disabled
extras CentOS-6 - Extras enabled: 4
nginx nginx repo enabled: 25
remi Les RPM de remi pour Enterprise Linux 6 enabled: 549
remi-test Les RPM de remi en test pour Enterprise disabled
rpmforge RHEL 6 - RPMforge.net - dag enabled: 4,403
rpmforge-extras RHEL 6 - RPMforge.net - extras disabled
rpmforge-testing RHEL 6 - RPMforge.net - testing disabled
updates CentOS-6 - Updates enabled: 409
repolist: 19,412
I've still got this issue.. I don't know what to try and research to figure out what's doing this. Any info at all on where I might look to to figure out whats going on would be amazing.
Well the problem isn't isolated to just yum, I wish that was the case. I do still get the pycurl 22 errors (it seems like it's not always the same repo's where it happens). This is a dedicated server, not a VPS, do you think it could be some sort of routing thing that the company I'm renting from could have changed? I don't see it as being an issue with something they changed, but I don't really know all of what goes on beyond outside of my servers pvlan. I have noticed that it's not always consistent. I have recently noticed that sometimes accessing the external website will work, but most of the time it doesn't, which seems really weird.
I will look into the yum plugins in a second when I can get access to terminal.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.