What is Live Site for

Need help with the Administration of your Joomla! 4.x site? This is the spot for you.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Locked
User avatar
ceford
Joomla! Hero
Joomla! Hero
Posts: 2300
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

What is Live Site for

Post by ceford » Fri Apr 15, 2022 9:57 am

The FPA sometimes reports Live Site is not empty and experts here say it should be and to edit configuration.php to make it empty. I have looked through the core Joomla code and can see that Live Site is reported in the System Information / Configuration tab. And it is used to prefix all urls so 'garbage' makes the site unusable. But there is no place where it is set within Joomla.

I guess this is for some special purpose known only to a few. Can anyone explain the intended use of this parameter? How is it set other than by editing configuration.php?

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 43233
Joined: Sat Apr 05, 2008 9:58 pm

Re: What is Live Site for

Post by Webdongle » Fri Apr 15, 2022 10:19 am

Always thought it depended on the server configuration. Thinking there were, at one time, servers that didn't map the site root to the htdocs (www) folder.

but found
https://docs.joomla.org/Security_Checkl ... nvironment
Running on a non-vhost environment

When you are running Joomla on a non-vhost environment please make sure that you set the live_site setting within the configruation.php to your domain in order to protect you against potential Host Header Injection. All sites that are running within an vhost setup are not affected by this issue.
and
https://docs.joomla.org/J1.5:IIS7_and_SEF_URLs
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30482
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: What is Live Site for

Post by Per Yngve Berg » Fri Apr 15, 2022 10:34 am

In Joomla 1.0 it was needed to be set for the site to work. In later versions Joomla reads it from the server.

SharkyKZ
Joomla! Hero
Joomla! Hero
Posts: 2774
Joined: Fri Jul 05, 2013 10:35 am
Location: Parts Unknown

Re: What is Live Site for

Post by SharkyKZ » Fri Apr 15, 2022 11:23 am

It's required for URLs to work correctly when running from CLI. It can also be used to define a canonical base URL.

User avatar
ceford
Joomla! Hero
Joomla! Hero
Posts: 2300
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: What is Live Site for

Post by ceford » Fri Apr 15, 2022 1:10 pm

I can see one use: if I have a development site on localhost on my laptop I could use the url of the Live Site to fetch scripts, style sheets and images from the live server. That could be handy for testing.

SharkyKZ wrote:
Fri Apr 15, 2022 11:23 am
It's required for URLs to work correctly when running from CLI. It can also be used to define a canonical base URL.
I am unclear on these suggestions. I use crons, formerly calling urls and latterly using the new cli interface. Is there an example CLI usage where setting Live Site would be needed? I guess the canonical base thing would fix a situation where I am sharing a hosting service between two domains. For example domain.org and domain.com could both point to the same code with the same base - thanks for making me think about that,

Webdongle wrote:
Fri Apr 15, 2022 10:19 am
Always thought it depended on the server configuration. Thinking there were, at one time, servers that didn't map the site root to the htdocs (www) folder.

but found
https://docs.joomla.org/Security_Checkl ... nvironment
Running on a non-vhost environment

When you are running Joomla on a non-vhost environment please make sure that you set the live_site setting within the configruation.php to your domain in order to protect you against potential Host Header Injection. All sites that are running within an vhost setup are not affected by this issue.
and
https://docs.joomla.org/J1.5:IIS7_and_SEF_URLs
There are holes in my education - I don't know what a non-vhost environment is. I guess that is because I have only ever used vhost environments (this century).

Anyway, thank you all for the clarification.

User avatar
brian
Joomla! Master
Joomla! Master
Posts: 12728
Joined: Fri Aug 12, 2005 7:19 am
Location: Leeds, UK
Contact:

Re: What is Live Site for

Post by brian » Fri Apr 15, 2022 1:46 pm

It has no current use in core. Any comment saying anything else is plain wrong.
"Exploited yesterday... Hacked tomorrow"
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 43233
Joined: Sat Apr 05, 2008 9:58 pm

Re: What is Live Site for

Post by Webdongle » Fri Apr 15, 2022 3:35 pm

So why has it not been removed?
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

sozzled
I've been banned!
Posts: 13639
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: What is Live Site for

Post by sozzled » Fri Apr 15, 2022 5:04 pm

+1 @Webdongle

User avatar
brian
Joomla! Master
Joomla! Master
Posts: 12728
Joined: Fri Aug 12, 2005 7:19 am
Location: Leeds, UK
Contact:

Re: What is Live Site for

Post by brian » Fri Apr 15, 2022 8:49 pm

It has no current use in core
"Exploited yesterday... Hacked tomorrow"
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/

sozzled
I've been banned!
Posts: 13639
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: What is Live Site for

Post by sozzled » Fri Apr 15, 2022 9:35 pm

Because (as many people have observed and pointed out that I know nothing) I have never properly understood the purpose of $live_site in J! but, for some reason, a non-null value seems to have strange side-effects and because I could not possibly guess how all of the millions of lines of code in the core CMS may interoperate with one another, I should probably not write anything in this discussion.

There are a couple of references to this configuration setting in the J! CMS core but there's probably only one condition that is actually tested for anything and that is in ../libraries/src/Uri/Uri.php (in J! 4.x and J! 3.x).


Locked

Return to “Administration Joomla! 4.x”