ElkArte Community

Project Support => Support => Topic started by: sshagent on September 24, 2014, 07:07:18 am

Title: 127.0.0.1 as host links
Post by: sshagent on September 24, 2014, 07:07:18 am
So having spotted this today and eager to find somewhere to migrate my smf forum to i gave this a whirl.  I'm just doing the base installation.  Even used defaults where possible.

Everything looks great during the installation process but once done and i go to look at the forum for some reason all the urls in the html are prefixed with 127.0.0.1 and not my domain name.  Which understandably makes a fugly page.  I'm using the currently .zip download from the front page of this domain. 

Anyone got any clues to what is going on here?  Thanks for your time.
Title: Re: 127.0.0.1 as host links
Post by: Allan on September 24, 2014, 08:04:43 am
A link to the forum would be great, sometimes it will show the IP address if installed on a local host.
Title: Re: 127.0.0.1 as host links
Post by: emanuele on September 24, 2014, 08:39:37 am
Hello sshagent and welcome! :D

127.0.0.1 is the default "url" showed during the installation, usually you have to change it during the installation (2nd step).
Can you check (via ftp) in your Settings.php what is the value of $boardurl?
If it is http://127.0.0.1 you can change it to your domain.
Title: Re: 127.0.0.1 as host links
Post by: sshagent on September 24, 2014, 08:40:39 am
http://eternalrising.net/forum/

And here are the mentions of eternalrising.net from my Settings.php in case that helps

grep eternalrising forum/Settings.php
$boardurl = 'http://eternalrising.net/forum';
$webmaster_email = 'mail@eternalrising.net';
$cachedir = '/var/www/eternalrising/forum/cache';
$boarddir = '/var/www/eternalrising/forum';
$sourcedir = '/var/www/eternalrising/forum/sources';
$extdir = '/var/www/eternalrising/forum/sources/ext';

Title: Re: 127.0.0.1 as host links
Post by: emanuele on September 24, 2014, 08:43:24 am
and if you try a grep for 127.0.0.1?
Title: Re: 127.0.0.1 as host links
Post by: sshagent on September 24, 2014, 08:46:03 am
nothing.

root@Ubuntu-1404-trusty-64-minimal:/var/www/eternalrising/forum# grep 127.0.0.1 Settings.php
root@Ubuntu-1404-trusty-64-minimal:/var/www/eternalrising/forum# grep -i localhost Settings.php
$db_server = 'localhost';

Thanks for your time with this
Title: Re: 127.0.0.1 as host links
Post by: emanuele on September 24, 2014, 08:52:56 am
Okay, another small test, try a simple script like this:
Code: [Select]
<?php
echo $_SERVER['HTTP_HOST'] . '<br />';
echo $_SERVER['SERVER_NAME'];
what are the two values?
Title: Re: 127.0.0.1 as host links
Post by: sshagent on September 24, 2014, 08:59:23 am
output =
eternalrising.net
eternalrising.net

Showing here... http://eternalrising.net/a.php

Title: Re: 127.0.0.1 as host links
Post by: emanuele on September 24, 2014, 10:00:45 am
I was looking at the wrong side of the problem.
It's just the themes that has a wrong url.


Go here:
http://eternalrising.net/forum/index.php?action=admin;area=theme;sa=list

don't worry about the missing styles and stuff, go all the way down to the end of the page, you'll find an input named "Base URL to the same directory", in that one you put
Code: [Select]
http://eternalrising.net/forum/themes
and save.
Title: Re: 127.0.0.1 as host links
Post by: sshagent on September 24, 2014, 10:04:29 am
That fixed it.  Thanks.
Any idea what went wrong?  If there is a bug of some sort I'm more than happy to supply any info from my end that might be needed.
Title: Re: 127.0.0.1 as host links
Post by: emanuele on September 24, 2014, 10:16:53 am
Short answer: no. Not the slightest.
In theory the theme url is set based on the $boardurl variable:
Code: [Select]
(1, 'theme_url', '{$boardurl}/themes/default'),

The value in Settings.php is correct, so it should have been correct at that point as well because when the database is populated, Elk already relies on Settings.php... odd.
If you have some spare time, you may try again to install and see if the problem appears again. I'll give it a try before night.
Title: Re: 127.0.0.1 as host links
Post by: sshagent on September 24, 2014, 10:25:39 am
I tried a few times before posting
Title: Re: 127.0.0.1 as host links
Post by: sshagent on September 24, 2014, 10:54:13 am
Just to add, if you end up wanting me to try anything different or such to track this down.  Let me know and i'll get to it.  I'm in the office tomorrow (no working from home) so won't have much time to be messing about, but on Friday i should have plenty of time
Title: Re: 127.0.0.1 as host links
Post by: emanuele on September 24, 2014, 10:57:43 am
Thanks!

I'll try to think where the problem can be. ;D