Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Framework » Location of new (Sub-) System
Location of new (Sub-) System [message #7588] Mon, 26 April 2021 05:12 Go to next message
htManager is currently offline  htManager
Messages: 339
Registered: May 2014
Senior Member
Hi Toni,
I want to create a new application and I am not sure how to handle this best. I have one application under www.htmanager.de. Now I want to create a new System/Subsystem under www.hartz.biz. Can I integrate this system as subsystem in my existing environment? Even if it is in a different domain? As far as I understand your system, the prefix is relevant to distinguish and I only have to get connection to the databases, isn't it?
If yes, do I have to consider something special in the config file?
Re: Location of new (Sub-) System [message #7589 is a reply to message #7588] Tue, 27 April 2021 04:44 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2272
Registered: April 2006
Location: Surrey, UK
Senior Member
Are the two domains (www.htmanager.de and www.hartz.biz) being run on the same server with the same DOCROOT? Is this second subsystem going to be available on the same menu system as the first subsystem? Is the first (existing) subsystem going to be only available on www.htmanager.de and the second (new) subsystem only available on www.hartz.biz?

It is possible to have both domains running in the same DOCROOT but still treated as different entities with different databases. In your config.inc file you can detect which domain is being accessed by looking at $_SERVER['SERVER_NAME'], then you can set the credentials you need, including the database prefix, for that particular domain. I do this all the time on my development PC where I have a different set of databases for each client that I support, but they all share the same code base.


Re: Location of new (Sub-) System [message #7590 is a reply to message #7589] Tue, 27 April 2021 09:58 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 339
Registered: May 2014
Senior Member
Yes, both the two domains and the includes directory are located under the DOCROOT.
Yes, both subsystems are going to be available only on their servers.

I have seen the section in the config.inc where you can detect which domain is being accessed by looking at $_SERVER['SERVER_NAME'] and now I think that I understand the way to handle this.

I have a total of five databases on my server: audit, menu and dict for radicore system needs and htm and him for my applications.
At the moment the radicore directory with all the radicore subdirectories (audit, css, default, dict,... and the application subdirectory) with the classes, reports, screens, ... subdirectories are under www.htmanager.de. Is this what you mean with code base?

If yes, do I have to copy these directories in the directory structure of the second server or will this be handled by the config file? Or would it be even better to hold these directories/files directly under DOCROOT as the includes directory?

If I know the right way I can try to find my right settings.
Re: Location of new (Sub-) System [message #7591 is a reply to message #7590] Wed, 28 April 2021 03:28 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2272
Registered: April 2006
Location: Surrey, UK
Senior Member
On the same server you can have more than one domain name pointing to the same DOCROOT (document root) directory as each domain has a separate entry in the Apache config file. On my development PC this is achieved using the VirtualHost directives where each domain shares the same DOCROOT, which would probably be the directory where all the Radicore files reside. This means that several domains can share the same codebase, but although they also share the same config.inc file you can use different settings for each domain. In my case I have a separate set of databases, including the MENU database, for each domain as I use a different $dbprefix for each. In this way you can have a single codebase shared by multiple domains, but each domain can use its own databases.

Re: Location of new (Sub-) System [message #7592 is a reply to message #7591] Wed, 28 April 2021 10:06 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 339
Registered: May 2014
Senior Member
I still have problems to understand what exactly you have in mind. Is the structure correct in the attached image? Or am I wrong?

At the moment I have the radicore directories (Codebase) under www.htmanager/htmanager. The index.html shows the "RADICORE demonstration" system and leads me to the logon screen.

Where can I change the settings that the docroot/radicore/menu/logon.php will be called?
Re: Location of new (Sub-) System [message #7593 is a reply to message #7592] Thu, 29 April 2021 03:54 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2272
Registered: April 2006
Location: Surrey, UK
Senior Member
In all my installations I have the Radicore subsystem directories and all application subsystem directories under the same root folder, which may be called 'radicore' but can be anything you choose. If several domains are sharing the same code then each domain must have its DOCROOT set to the root folder mentioned above. This means that each domain will share the same files, including the config.inc file. This means that by default each domain will also share the same databases. You can alter this by setting different values in the config.inc file according to the current domain name, which is provided in $_SERVER['SERVER_NAME']. You can then use a different value for $dbprefix, such as 'htm_' and 'him_' so that the data for one domain is NOT shared with any other domain.

Re: Location of new (Sub-) System [message #7594 is a reply to message #7593] Thu, 29 April 2021 07:07 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 339
Registered: May 2014
Senior Member
Thank you for your explanation. I will install the subsystem directories in both server. This seems the best and easiest way for me. I will create a new set of databases for the second server, too. I modified the config.inc in the way you told me with $_SERVER['SERVER_NAME']. That works fine.

As far as I see it is too difficult for me to modify the directives in the way that I would need only one code base in DOCROOT.
Re: Location of new (Sub-) System [message #7595 is a reply to message #7594] Fri, 30 April 2021 03:14 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2272
Registered: April 2006
Location: Surrey, UK
Senior Member
If your domains are running on different servers then you must have a separate set of files on each server as it is not possible to share a directory on one server with an application running on a different server.

If the different domains are running on the same server then you need to tell Apache that each domain has the same document root. You can either do this by amending the httpd.conf file, but if this is not possible then you can use an htaccess file.


Re: Location of new (Sub-) System [message #7596 is a reply to message #7594] Sat, 01 May 2021 04:56 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2272
Registered: April 2006
Location: Surrey, UK
Senior Member
I don't know what facilities your hosting company provides, but mine supplies a control application called cPanel. I have several domains which are hosted on the same server, and cPanel provides me with the mechanism to specify the document root for each one. The default document root is "/public_html", but for one of them called "forum.radicore.org" I changed it to "/public_html/fud307". Easy Peasy Lemon Squeezy.

Re: Location of new (Sub-) System [message #7597 is a reply to message #7596] Mon, 03 May 2021 02:54 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 339
Registered: May 2014
Senior Member
My provider is plesk.com. I can/could change the document root. But I don't understand why this would be the solution?!?

I thought that if you have two or more domains on one server you could store the radicore directory in the same way like you suggested this with the include directory. Somewhere outside/above the document root. Or am I confusing the terms?
Re: Location of new (Sub-) System [message #7598 is a reply to message #7597] Mon, 03 May 2021 04:20 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2272
Registered: April 2006
Location: Surrey, UK
Senior Member
By having the same document root for both domains you can share a single installation of the Radicore files in your file system. Both of your subsystems could also reside under the same document root. If you had a single set of database for both domains then both domains would be visible in the menu tabs and would therefore be accessible. If you had a separate set of databases for each domain, by modifying the config.inc file as I explained previously, then each domain would have its own menu database and could only access the subsystem(s) which were loaded into that copy of the menu database.

Re: Location of new (Sub-) System [message #7599 is a reply to message #7598] Mon, 03 May 2021 06:58 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 339
Registered: May 2014
Senior Member
I think I understand now what you mean. But I can't give my domains the same document root because they are for complete different purposes. They both are Joomla! installations with different settings and extensions. My radicore application is sitting in this tree structure. That's why I dont't think that this works. At least I am afraid to cause trouble ...

I have modified the config.inc as you explained. I created a new set of databases which I now will fill with the newest radicore tables and get the new system running.

If you release a new update I have to copy new update files twice, one time in each domain and I have to change radicore system tables twice, too. I think this will be the safest way for me to keep the systems running.

Sorry, that I haven't explained my configuration/construction that well. Thank you for your explanations.
Re: Location of new (Sub-) System [message #7600 is a reply to message #7599] Tue, 04 May 2021 04:15 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2272
Registered: April 2006
Location: Surrey, UK
Senior Member
If your Joomla! sites are running on different physical servers with separate sets of files, and they each require their own copy of Radicore then it would be very difficult, if not impossible, to have a single set of Radicore files which could be shared by each site. Just as each site has its own set of Joomla! files which must be maintained separately, then each site must have its own set of Radicore files which must be maintained separately.

Re: Location of new (Sub-) System [message #7601 is a reply to message #7600] Wed, 05 May 2021 03:34 Go to previous message
htManager is currently offline  htManager
Messages: 339
Registered: May 2014
Senior Member
I installed the Radicore application in the tree structure of the second joomla! installation. It was very easy. I was afraid that I would have more problems. But with your suggested changes in the config.inc, the different apps are running without problems. As I installed the Radicore application the first time, years ago, I had much more problems. Now, everything is fine. Thank you.
Previous Topic: Output 5 (Label view)
Next Topic: Drop Down - PDF Output
Goto Forum:
  


Current Time: Tue Oct 19 08:47:40 EDT 2021

Total time taken to generate the page: 0.01655 seconds