httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Wingfield <>
Subject Re: [users@httpd] Override a File to Same Name in Another Directory
Date Sun, 13 Mar 2016 15:25:21 GMT
First, thanks for your quick reply.  I suspected there was no “magic” in 
Apache to accomplish my task. My concern is the fact that the inclusion 
of configure.php is embedded in the application system, which by-the-way 
is . . .Joomla.  Aside from being a totally php based application (there 
are no executable binaries, etc.), the Joomla people will tell you that 
an “instance” of Joomla does not support multiple domains. In my 
opinion, this is a serious design oversight by omission. What is 
advertised as a major leading CMS, can only support one domain.  In 
other words, Joomla is designed with only the “bed-room blogger” or 
“mom-and-pop cupcake bakery” in mind.

If your installation is to serve multiple domains, for example a 
corporate headquarters with dozens of branch offices where each branch 
is semi-autonomous and requires a separate MySQL database, then this can 
get ugly.  Each instance of the Joomla core requires approximately 58MB, 
not including the MySQL database tables.  The latter regarding the DB 
tables is OK because we want to keep the data segregated . . .easier to 
backup and restore; however, if you are serving dozens of branch domains 
(virtual hosts) where each branch requires a separate instance of the 
Joomla core system, the system objects are redundant . . .parallel 
systems . . .each requiring individual attention every time a new “ball 
is rolled down the ally”.  This is where a symbolic link to this common 
core would be/is practical.  Problem is that a configuration file, 
./joomla3/configure.php, is embedded within the core objects.

This configuration file contains about fifty-eight parameters that 
include arguments such as

    public $sitename = 'Corporate Home Office';
    public $db = 'CorpHQ';
    public $dbprefix = 'joom_';

Alternately, another virtual host could be:

    public $sitename = 'Little Rock Branch';
    public $db = 'LIT';
    public $dbprefix = 'joom_';

Why is Joomla designed this way?  Seems that yet another MySQL DB table 
could have been designed into the system and the configuration extracted 
from the same, rather than reading the content of a configuration.php 
file.  Regardless, this configuration file customizes each instance 
(virtual host).  Were there a way (method) to create this custom 
configuration, ./parent(vhost)/configuration.php and override the 
./parent/child(joomla3 default instance)/configuration.php); then Joomla 
could easily support multiple domains with only one instance of the core 
code.  (By the way, the MySQL DB table schema exists in 
./installation/sql/mysql/joomla.sql.  Execute [ mysql> ./ joomla.sql ] 
to generate the tables; then use phpMyAdmin to change the database names 
as appropriate.)

Which brings us full-circle to why the need to override the 
configuration file.  I have read the Linux document,

(BTW, I’m working with FreeBSD v10.2), and yes, the “upper” and “lower” 
directory scenario does sound analogous to the OS/400 override 
concepts.  Also keep in mind that OS/400 is not a hierarchal file system 
but rather what is described as single level storage.  Analogous to 
directories are libraries, but all on the same level – think of taking a 
roll of pennies(libraries) and scattering them over the shop floor . . 
.all at the same level. Paths or search orders to these libraries are 
arranged in library lists.  These lists can be defined by user profiles, 
job descriptions, etc.  Another way to avoid the override action is to 
simply rearrange the library list.  For example, given the following 
library list:


. . .should programmer John want to test his version of a configuration 
file, then he simply moves his library containing the file to the top of 
(or up) the list.    . . .sweet!

My apologies if this is a little wordy; I still don’t have a solution, 
but perhaps this will help others understand the Joomla task and problems.

Thanks again,
Ron W.

On 3/13/2016 12:57 AM, Marat Khalili wrote:
> If you want client requests to be served 
> by ./parent/config.php , then the answer is yes -- I'd start with 
> mod_rewrite for instance. If config.php is invoked by PHP, not by 
> Apache, then you cannot fix it using Apache features -- you really 
> need to change that symbolic link or PHP configuration or something in 
> the system. Actual analogue of OVRDBF as I understand it in Linux is 
> OverlayFS, but it's overkill for your task.
> -- 
> With Best Regards,
> Marat Khalili
> On 12/03/2016 23:14, Ron Wingfield wrote:
>> I don’t know if and how this can be accomplished.
>> Scenario:
>> Two directories, parent and child.
>> parent is in a virtual host “container”.
>> child is a symbolic link to an application default core distribution 
>> directory (php objects).
>> ./parent/child contains a default config.php file.
>> ./parent contains a custom config.php file.
>> DocumentRoot points to ./parent/child.
>> Can the various features of Apache, .htaccess, <Directory>, <File>, 
>> Alias, etc., be configured to effectively override ./child/config.php 
>> to ./parent/config.php?
>> In other words, I want to substitute the custom file for the default 
>> version.  In IBM OS/400 world, this can be easily accomplished with 
>> the Override with DataBase File command . . .something like:
>>      OVRDBF FILE(child/config.php) TOFILE(parent/config.php)
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> For additional commands, e-mail:
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message