LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-20-2014, 08:17 PM   #1
gogogadget2
LQ Newbie
 
Registered: Nov 2014
Posts: 4

Rep: Reputation: Disabled
Domain name seen as different domain


I'm having two separate issues that I believe have one cause, except that I'm not sure what it is (obviously). First is that our internal ajax calls are suddenly being seen as cross-domain. So if I do a javascript ajax call with an absolute URL to my own server, the browser blocks it. Second is that suddenly our Facebook login is failing because our Facebook app doesn't recognize our URLs, even though the URLs in our app settings are the same they've always been, and do match our domain.

I searched about the ajax problem and couldn't find anything, so I just ended up making the ajax calls with relative URLs. I also searched about the Facebook login problem, but all I found were posts about something I had already done, and it's still not working.

I thought this might be a nameserver problem, but those are correct. We have an EC2 Amazon Linux instance, using Route 53 nameservers. I checked our domain registrar (godaddy), and the nameservers match up. Plus, people can navigate to the site without any problems. So, it doesn't seem to be a nameserver problem, which leads me to think it might be a problem with the server itself, but I have no idea what that would be.

Does this behavior sound familiar to anyone?

I do have an .htaccess file on the server, but I don't think that's the issue. All I have in there now is the following:

RewriteEngine on
RewriteRule ^(.*)\.[\d]{10}\.(css|js)$ $1.$2 [L]

# Block Bad Bots & Scrapers
SetEnvIfNoCase User-Agent "Aboundex" bad_bot
SetEnvIfNoCase User-Agent "80legs" bad_bot
SetEnvIfNoCase User-Agent "360Spider" bad_bot
...

<Limit GET POST HEAD>
Order Allow,Deny
Allow from all

# Cyveillance
deny from 38.100.19.8/29
deny from 38.100.21.0/24
deny from 38.100.41.64/26
deny from 38.105.71.0/25
deny from 38.105.83.0/27
deny from 38.112.21.140/30
deny from 38.118.42.32/29
deny from 65.213.208.128/27
deny from 65.222.176.96/27
deny from 65.222.185.72/29

Deny from env=bad_bot
</Limit>
 
Old 11-24-2014, 02:11 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Much more likely to be your web server config rather than .htaccess

Check your ServerName and ServerAlias directives for your website and ensure that the domain name isn't being redirected or rewritten anywhere.
 
Old 11-24-2014, 04:29 AM   #3
gogogadget2
LQ Newbie
 
Registered: Nov 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
I checked the httpd.conf file, and UseCanonicalName was set to Off, so it looks like ServerName isn't going to be used, according to the documentation there. I scrolled through and didn't see ServerAlias set anywhere.

To update this, I tried an absolute URL ajax call again yesterday and it worked. Not sure why it started working again (which bugs me), but the Facebook login is still broken, so these things appear to be unrelated after all. Since the issue is just with the Facebook login, it seems a lot less likely to be a server issue.

I'm not sure what to do with the thread in this case. Do I mark it as solved since it's no longer relevant to this forum?
 
Old 11-24-2014, 05:04 AM   #4
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
You could leave it open and hope for more relevant advice
 
Old 11-24-2014, 10:52 AM   #5
gogogadget2
LQ Newbie
 
Registered: Nov 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
OK, I have more information now. The URL not permitted error was happening because of the IP whitelist in the app settings. I had the IP address of the server filled in here, but I had a suggestion to remove it, which I did, and it worked. I also removed the list of valid return URIs. Funny that in some posts I've seen, adding the return URIs actually fixes the Facebook problem.

Anyway, now I have another issue that I actually thought was related to the first but it appears not. The Facebook login is caught in an endless redirect, so the code tries to get the Facebook user ID, gets 0, goes to Facebook to log in, sees that the user is logged in, comes back and still gets 0 for the Facebook user ID.

The funny thing is that I used the exact same login code on a different server with a newly created app, so that all that was changed was the app ID and the app secret, and the login worked fine. I also set up this other server to try to log in with my original app, and it worked fine. I also created a third app and tried to log in to that with the original server, and that went into a loop. So this does appear to be something about my server, but not sure what still.
 
Old 12-01-2014, 01:32 PM   #6
gogogadget2
LQ Newbie
 
Registered: Nov 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
The issue turned out to be caused by a bad curl library. Once that was recompiled, the Facebook login started working again.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Samba4 domain not seeing imported users ,Groups and Machine Accounts from samba3 domain treedstang Linux - Server 0 01-06-2013 11:45 PM
[SOLVED] HTTPS in sub domain serves content from main domain. Wildcard SSL installed. amit.roy Linux - Server 17 11-25-2012 01:56 PM
Using sed regex to remove the top level domain from a fully qualified domain name linux2man Programming 6 12-01-2011 03:38 PM
Sendmail doubling sender domain- ex. hostname.domain.net.domain.net halborr Slackware 7 08-23-2010 08:37 AM
IPtables - block subdomains (a.domain.com, b.domain.com, c.domain.com,...) benjalien Linux - Networking 6 06-24-2009 07:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration