Hi,
I'm in need of a desperate help to resolve this sub domain error. My main domain and subdomain has different ip address
When i ping localhost.com i get 127.0.0.1 and when i ping subdomain i get 64.64.99.32.
When i go to configuration ->subdomain settings i get above error.
i'm wamp on windows 8 server with drupal 7.10 and domain access 7.x-2.17
$cookie_domain = '.localhost.com';
$base_url = 'http://www.localhost.com';

Host file has
127.0.0.1 www.localhost.com
127.0.0.1:80 www.localhost.com
64.64.99.32 *.localhost.com
64.64.99.32:80 *.localhost.com
127.0.0.1 localhost.com
127.0.0.1:80 localhost.com

and my virtual host is set to


DocumentRoot "D:/wamp/www/ms/"
ServerName www.localhost.com
ServerAlias localhost.com*.localhost.com

Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all

I have been trying to resolve this since two days going through all forums and issues on this site. not able to resolve please help me.

Comments

rwohleb’s picture

Assigned: Unassigned » rwohleb
Status: Active » Postponed (maintainer needs more info)

You say it's not working because your domain and subdomain resolve to two different IPs. Well, you have it setup that way in your hosts file. Maybe I'm not understanding your issue.

srikar-1’s picture

yes, When i click on sub domain settings i get the error message in subject line. How do i set it in hosts file. Could you please help me.

I see this error as well \SUBDOMAIN\INCLUDES\SUBDOMAIN.ADMIN.INC(455) : EVAL()'D CODE ON LINE 1
1 0.0005 676472 {main}( ) ..\index.php:0
2 0.3334 27945352 menu_execute_active_handler( ) ..\index.php:21
3 0.3358 28125328 call_user_func_array ( ) ..\menu.inc:503
4 0.3358 28125648 drupal_get_form( ) ..\menu.inc:503
5 0.3358 28126456 drupal_build_form( ) ..\form.inc:123
6 0.3358 28129064 drupal_retrieve_form( ) ..\form.inc:329
7 0.3359 28130472 call_user_func_array ( ) ..\form.inc:785
8 0.3359 28130872 subdomain_admin_settings( ) ..\form.inc:785
9 0.4421 28251056 _subdomain_validate_cookie_domain( ) ..\subdomain.admin.inc:179

I tried with 127.0.0.1 for both domain and sub domain, after wamp restart it still gives two different ip's when i ping.

Host file has
127.0.0.1 www.localhost.com
127.0.0.1:80 www.localhost.com
127.0.0.1: *.localhost.com
127.0.0.1:80 *.localhost.com
127.0.0.1 localhost.com
127.0.0.1:80 localhost.com

Do i need to edit code in anyplace not to get different ip for sub domains.

Thanks
Srikar

rwohleb’s picture

What subdomain are you testing? Just 'www'? I'm pretty rusty on the Windows side, but your host file looks off. I don't know about using a wildcard (*) or ports (:80). You should also try restarting the machine as Windows may be cacheing the DNS lookup.

lovelykaushik86’s picture

I got same errors when I tried to use this module. Here is the solution if u r using this module on your local setup
Host file:-
127.0.0.1 localhost.com
127.0.0.1 subdomain-test.localhost.com

vhosts file:-
DocumentRoot "D:/wamp/www/ms/"
ServerName www.localhost.com
ServerAlias *.localhost.com

for error(\SUBDOMAIN\INCLUDES\SUBDOMAIN.ADMIN.INC(455) : EVAL()'D CODE ON LINE 1) make changes in line 453
replace
if (strpos($setting, '$cookie_domain') !== FALSE)
with
if (strpos($setting, '$cookie_domain =') !== FALSE)

and if you are using proxy server so you have to make an entry of subdomain-test.localhost.com in proxy setting.

I hope this issue has been resolved

Sam Straub’s picture

For anyone else looking at this and using Windows (at least with XP, not sure about 7), see this post and comment #1: http://drupal.org/node/444088

Wildcard subdomains don't work in Win XP etc/hosts file. You would have to explicitly set the subdomain up in your hosts file to test with. I learned this the hard way until someone pointed it out to me :)

ElZipo’s picture

Issue summary: View changes

#lovelykaushik86: thank you.