Hi,

I've searched for an answer w/o success.

The email that users get directing them to a one time login ([user:one-time-login-url]) sends them to localhost instead of my domain.

I don't know if this also applies to other emails from my site b/c I'm a very new user and just getting started.

I can't find a place to specify my domain. Home » Administration » Configuration » System doesn't have a place for a domain name (which I thought would be a logical place for it).

Any help would be greatly appreciated.

Thanks,

CC

Comments

gforce301’s picture

Just out of curiosity. Is the site installed locally?

CharlieCastle’s picture

Yes, It's on my Windows 7 machine. I'm just getting started and trying to learn b4 I go public.

Thanks,

CC

gforce301’s picture

So your domain is "localhost". Problem solved :).

CharlieCastle’s picture

No, no, no.

I can easily reach my Drupal site from the WAN with http://<mydomain.com>/

Just because it's on my PC (localhost) doesn't mean it doesn't have a domain (FQDN).

CC

gforce301’s picture

Home » Administration » Configuration » System » Site Information

CharlieCastle’s picture

Thanks for the feedback.

I see a text box at Home » Administration » Configuration » System » Site Information labeled "Default front page" but that text box seems to be prefixed with http://localhost/drupal/ .

Wouldn't whatever I enter in that box be prepended with the above?

What am I missing?

Thanks,

CC

gforce301’s picture

So as I stated earlier. Drupal sees itself installed at http://localhost/drupal meaning your domain name is localhost like I said. Those tokens in the system emails use that as the domain name and that is why the emails generate url's to localhost.

You can try un-commenting and changing the $base_url setting in settings.php as a possible fix.

CharlieCastle’s picture

Well that totally doesn't work.

By changing $base_url to my FDQN I can't get to Drupal at all. Not from the WAN or locally.

Locally I still use localhost/drupal b/c my router won't permit redirection of my FDQN back to the site.

But that wouldn't be too big an issue if remote users could connect; and they can't.

I suspect this is probably more an Apache issue than Drupal because when I tried to connect from the WAN using the FDQN I got an XAMPP message rather than a Drupal one.

I know I can't be the only one facing this problem. Surely others use a local system for development even if they later move it to a hosting site. And an integral part of that development is to make sure WAN users are able to connect.

Just to be clear, b4 the change to $base_url WAN uses COULD connect using my FDQN. It's just that the email sent to new users points them to the wrong place!

My guess is I need to set up a virtual domain in Apache; but I've never done that and don''t know the precise syntax.

Any ideas?

Thanks,

CC

CharlieCastle’s picture

On further thought I DO think this is a Drupal and not Apache issue.

I feel that way b/c when Drupal is set for localhost via $base_url users from the WAN (and LAN and localhost) can connect. And WAN users are using my FDQN.

So if Apache allows incoming connections directed to my FDQN, it must be Drupal that won't accept them when I change $base_url to point to my FDQN.

Thanks

CC

CharlieCastle’s picture

Anyone? There must be a fix for this.

Thanks,

CC

gforce301’s picture

It's a server configuration issue. I'm sure there is an answer but it deals with apache (or whatever flavor of web server you use) and how to configure your domain to do what you want.

CharlieCastle’s picture

You could be right but I don't think so.

See my post above "On further thought I DO think..." for my reason.

CC

gforce301’s picture

Lets try a different approach. Make a file. Name it php_info.php and put this in it:

<?php
    phpinfo();

Put that file in the root directory of your Drupal installation. Go to your site locally and to that file in a browser and see what php says your host name is. Then go to the same location via http://yoursite.com/php_info.php and see what php says your host name is.

I'm willing to bet in both cases it will be some version of "localhost". Like "localhost/drupal" or something along those lines. If it is, it is a server configuration issue, plain and simple. Once we establish that, then we can move forward trying to configure your server properly to do what you want it to do.

CharlieCastle’s picture

OK, phpinfo gives me a bit of a mixed bag. Though I don't think it's necessarily incorrect.

Here's what I find:

Section: Configuration - apache2handler
Server Administrator postmaster@localhost
Hostname:Port :80

Section: Apache Environment
HTTP_HOST localhost:90
This is strange. Why port 90 here and port 80 in the Hostname field? I'm listening on both 80 and 90 so I don't think it matters. But it still seems odd.)

SERVER_SIGNATURE SERVER_SIGNATURE
Apache/2.2.17 (Win32) mod_ssl/2.2.17
OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1 Server at localhost Port 90

Here's port 90 again.

SERVER_NAME localhost
SERVER_ADMIN postmaster@localhost

Section: HTTP Headers Information
Host localhost:90

Section: Core Local Master
SMTP localhost localhost

Section: PHP Variables
_SERVER["HTTP_HOST"] localhost:90
_SERVER["SERVER_SIGNATURE"]
Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o
PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1 Server at localhost Port 90

_SERVER["SERVER_NAME"] localhost
_SERVER["SERVER_ADMIN"] postmaster@localhost

OK, so assuming I have to change Apache to put the FDQN in place of "localhost"; where do I do that?
Same for port 80. I guess it would be better to use port 90 since that's how WAN users will have to connect. The only place 80 shows up is in the Configuration - apache2handler section. So where do I change this?

Thanks,

CC

gforce301’s picture

So the host name is "localhost" and this is a server configuration problem. One piece of advice about asking for help about something you don't really understand, especially when you find someone willing to donate their time to help you. Don't argue about the answer unless you know what you are talking about. It doesn't make people really want to help you. If you actually knew enough about the answer to argue about it, then why are you asking the question?

The answer to configuring apache to serve your site properly lies in the httpd-vhosts.conf file typically found at /apache/conf/extra/. There are general instructions in that file and an example about setting up virtual hosts. You will most likely have to modify your windows hosts file also, found at windows\system32\drivers\etc\, in order for you to access your site locally by FQDN. After you make the changes you will have to restart apache.

bravadomizzou’s picture

I was having the same issue, I just fixed it. This will help anyone to fix it. Make sure that if you are accessing the site via the url you just set up and not localhost or else it will still show as being from localhost/.

jonc113’s picture

I am obviously late to this party, but the same happened to me and I tried all of the above and the answer is:

1) It is not related to the Drupal configuration OR the Apache configuration
2) It's entirely due to how you access the site.

Because I hadn't installed encryption, I didn't want to broadcast my admin password over the internet.
So, to do admin work, I accessed my site via localhost/drupal - so drupal puts localhost/drupal into the email links it creates

If you access your site with your domain name, then Drupal properly puts the domain into the email links

By putting my domain name in the windows hosts file and directing it to 127.0.0.1, I think I have my cake and eat it too!
In other words the hosts file should direct my browser to the website locally, so my admin password isn't broadcast, but the proper domain name will still be in the email.

Hope this helps someone...