I have one problem with Ubuntu and Drupal, which is taking my nights and nights...

I have domain registrationg with GoDaddy.com
I am using Dynamic IP address so I used No-ip.com account.
so my current setup is like...

GoDaddy holds www.tigerinamerica.com registration
No-ip.com holds tiger.no-ip.com registration and it knows my Dynamic IP Address for server running at home.

GoDaddy.com ( www.tigerinamerica.com) points to http://tiger.no-ip.com:5555/drupal

and No-IP.com forwards it to my router and Webserver which is running at home.

In GoDaddy option, I hav used Mask Option...

Problem is when someone try to visit www.tigerinamerica.com forwarding works ok and visitor can see my Drupal site. Address bar is also saying www.tigerinamerica.com but in all the pages if I place my mouse pointer on the link, all the link ref. reads at http://tiger.no-ip.com:5555/drupal instead of www.tigerinamerica.com

Due to this user can not login because cookie is created for tiger.no-ip.com and it needs to be for www.tigerinamerica.com

I tried Apatche's URL Rewriting, but it does not resolves the links generated inside the page page.

My HTTP_HOST variables value holds tiger.no-ip.com:5555 which needs to be hold www.tigerinamerica.com

Is there way, I can update HTTP_HOST variable for Drupal site?

I tried to set $base_url in settings.php file for Drupal but it didn't resolve problem.

Any clue or help will be appriciated.

Thanks in Advance.

Comments

sin’s picture

to alter HTTP_HOST at the beginning of index.php or at the end of settings.php with something like: $_SERVER['HTTP_HOST'] = 'www.tigerinamerica.com';

tigerinamerica’s picture

I tried to place
$_SERVER['HTTP_HOST'] = "www.tigerinamerica.com" ;

in settings.php file and also in index.php file but it didn't took it. I mean, it didn't complain and URLs on the page are still refering to http://tiger.no-ip.com......

I also verified that above variable gets updated but I believe, this variable is not playing role to generate URLS on the page.

Any one who has seen Drupal code in detail can guide??

I also tried to use headers('Location:....) in php but didn't solved the problem. Thanks for helping.

sin’s picture

If you se no http://tiger.no-ip.com inside href urls and html is rendered by Drupal with relative paths this may be not a Drupal problem, but something wrong on HTTP/Apache level with your redirect, so it may be more resultative to ask no-ip support, search their forums/faq's, search for apache forums for such redirect examples.

tigerinamerica’s picture

Yes, Looks like problem was with No-IP forwarding setting....I have submitted domain forwarding with Go Daddy..so I will know in next hour...but initial test shows that: Drupal builds href URLs based on whatever No-IP pass to it...I am too happy that this problem is close to resolve....I will update this message after final testing, but the tip given by you solved my problem.

THANK YOU SO MUCH...SIN

tigerinamerica’s picture

I am still working to figure this out, I have around 6 domain names and I am experimenting setting them differently to resolve this issue, for testing purpose I took-out No-IP from picture, I just simply pointed GoDaddy domain to my dynamic ip address...I used it with mask option and also without mask option but either way, now it's showing my IP address in the url on the pages. I thought it may be because I use different port then port 80, so I also try to use port 80 directly but still it's showing IP address in the url..I am still working ...I did google and looks like problem is with having "Name Server" because till I do not set name server in GoDaddy, it will not resolve the name

sin’s picture

Typically domain name record stores two records of DNS servers names or IPs, this servers resolve domain name to IP-address. DNS servers is typically a service of a hosting provider from which you buy domain name, maybe GoDaddy has some paid DNS service? Anyway this DNS-servers must point to your dynamical IP somehow. I never use dynamical IP config, so final solution is very interesting.

If Drupal renders relative links and all works fine when type addresses directly in browser isn't it possible to alter Drupal to render absolute links (with http://tiger...) with your domain name?

tigerinamerica’s picture

First of thank you so much Sin, to give me hint, that gave me a direction to solve this problem.

Problem is: I was not using Name Server settings at GoDaddy, I was using forwarding option, and whenever I use forwarding option it's showing ip address in the URL inside pages.

Now question is how can I get fix name server (like ns1.zoneedit.com is name server address for ZoneEdit).

When I went thru whole this process to solve this problem, I FELT like I have been cheated by GoDaddy and No-IP. Here is the reason, why.....

(1) I purchased domain from GoDaddy by thinking that their service will be best but it's not (1) Even they are holding my domain and settings to forward it, they do not provide a client tool which can report my Dynamic IP address to them time to time whenever it gets change. So, I have to stay depend on other 3rd party server who can take care of forwarding my domain to my dynamic IP address, so I got account with No-IP.

(2) Generally, No-IP has free service for domain forwarding, but after using their free service, I decided to pay them for NO-IP plus service by thinking that I will get more features. Yesterday, I find-out that even after paying them for NO-IP Plus, they do not offer you "name server" service in it. To host your "Name Server" forwarding I need to pay them $15 more.

So, Here is what I did finally...

www.ZoneEdit.com offers Free Service to provide you "Name Server" Registration. First Five registration is Free. I registered my account with ZoneEdit.com for Free, Went thru very easy process to register my "Name Server", Actually, it's not call registering "Name Server" because they already have fix name server link like ns1.zoneedit.com and ns10.zoneedit.com but in this process, you tell ZoneEdit that here is my domain name for example "tigerinamerica.com", whenever your name server, receive a request for tigerinamerica.com (from GoDaddy), please forward it to my this IP Address (which is my Dynamic IP of Router running at home), and at home, On router, I have set port forwarding for port 80 to my Linux Server. so here is how whole process works:

when you type www.tigerinamerica.com in your Browser....
- Go Daddy forwards it to ns1.zoneedit.com with lable "tigerinamerica.com"
-ZoneEdit name server, looks in to their database and finds that "tigerinamerica.com" is bound with this ip address xxx.xxx.xxx.xxx and it forwards that request to my router at home on default port 80,
- When my router receives request on port 80, it's just forwards it to my Linux server...
- and Linux servers reponds...
In all Drupal webpages, url is refering "http://tigerinamerica.com/........"

Now to Turn http://tigerinamerica.com into http://www.tigerinamerica.com automatically, I can use Apatche's URL Rewring 2 line code in config file.

Problem Resolved....

(1) My domain Registration is still with GoDaddy.com (2) No-IP is not in the picture anymore (3) ZoneEdit is in the picture now for it's Free Service (4) Now I will have to set Dynamic IP update Client for ZoneEdit to update my Dynamic IP time to time

How to setup Name Server setting perfactly on GoDaddy? check this link, it's even also tells you how to run your own Name Server if you have Static IP Address http://howtoforge.com/ispconfig_dns_godaddy

Worth to mention that when I called, GoDaddy customer service, their Customer Service Rep tried to make me fool, first of all he was saying that when he enter my url, it's talking him to Google page, when I was entering same URL on my different machine it was taking me to my Server...finally to get rid of me, their customer rep placed me on hold for long long time so I get bored and hang-up my phone... When I called NO-IP customer service, they just say to leave message...and then never call you back...I am telling this because when I purchased their service, I was not known about this..

Thanks,

sin’s picture

I just interesded how "Dynamic IP update Client for ZoneEdit" works and found elegant solution for linux at http://www.zoneedit.com/doc/dynamic.html#faq3:
wget -O - --http-user=username --http-passwd=password 'http://dynamic.zoneedit.com/auth/dynamic.html?host=www.mydomain.com'
Just run command when IP changes and thats all -- no need for client!
I didn't know that there are free DNS services. So now I can register example.net.ru for free + free DNS and host all at home for free!