[horde] Virtual host and Themes

poubeline at free.fr poubeline at free.fr
Thu Jul 13 16:02:58 UTC 2017


Hi Jan, 

Sorry for the late answer but I was configuring another solution for a different issue and could not get back to you earlier. 

Well, the theme applied contains the favicon.ico, so when accessing DOMAIN1 URL, the theme displayed is the one for DOMAIN2 instead. The same as the registry override which shows the one from DOMAIN2 even if I use DOMAIN1 URL. 
If I remove all files about DOMAIN2 (prefs-webmail.<domain2>.com.php, registry-webmail.<domain2>.com.php) from the 'config' subfolders, I get the correct display for DOMAIN1 URL (favicon and name branding) 

It seems like if the prefs-<fqdn>.php and registry-<fqdn>.php are not correctly used by Horde. 

I was at first thinking of an issue with the cookies, where the $_SERVER['SERVER_NAME'] php value used for the $conf['server']['name'] and $conf['cookie']['domain'] values does not give any value and causes a mix between sites. 
But I think it is more related to the way Horde handles the web URL I am accessing to use the correct PREFS or REGISTRY file. 

If I remove DOMAIN2 files as explained above and I try to access DOMAIN2 URL, I get the theme and branding of DOMAIN1. 
It's like if Horde does not take into account the '-<fqdn>' part of the special files stored in prefs.d and registry.d. It is always using the last file read and does not stop when it gets the correct configuration file for the virtual host. 

Maybe it is a wrong configuration, or I missed something in the PHP files that tells Horde to stop using other configuration files when it has reached the correct configuration file. 

Do you know something about a setting that tells Horde to use only the prefs and registry files configured for a specific URL ? 

Thanks for your help, 
Moody_Styley 


----- Mail original -----

De: "Jan Schneider" <jan at horde.org> 
À: horde at lists.horde.org 
Envoyé: Mercredi 12 Juillet 2017 09:56:54 
Objet: Re: [horde] Virtual host and Themes 


Zitat von poubeline at free.fr: 

> Hi All, 
> 
> I am a new member to this Horde mailling list. Thanks for welcoming 
> me on this list. 
> 
> I am requesting help on a subject that I think is configurred 
> correctly but that is not working well. 
> 
> I explain what is going on : 
> I have installed the latest horde version on a Debian 8.8 server 
> which is functionning perfectly for a single domain. 
> I have followed the examples in the Horde's "How To's" for 
> installation using PEAR and all is OK. 
> 
> Now, I would like to prepare this installation for a new domain. I 
> have already configured Horde to use Virtual Host and the Apache 
> configuration works perfectly. 
> 
> The only issue here is that if I use a specific theme for one 
> virtual host and another theme for the other virtual host, the 
> "favicon" and the branding name of the Horde project is always set 
> to the second theme, even if the virtual host reached is the first 
> one. 
> 
> My configuration is as following : 
> Apache : 
> /etc/apache2/sites-available/webmail.<domain1>.fr.conf 
> 
> 
> <VirtualHost *:80> 
> DocumentRoot /var/www/horde 
> ServerName webmail.<domain1>.fr 
> ServerAdmin webmaster@<domain1>.fr 
> 
> RewriteEngine on 
> RewriteCond %{HTTPS} !=on 
> RewriteRule ^/(.*)$ https://%{SERVER_NAME}/$1 [R=permanent] 
> </VirtualHost> 
> 
> <VirtualHost *:443> 
> DocumentRoot /var/www/horde 
> ServerName webmail.<domain1>.fr 
> ServerAdmin webmaster@<domain1>.fr 
> 
> SSLEngine On 
> SSLCertificateFile /etc/ssl/certs/mail.<domain1>.fr.crt 
> SSLCertificateKeyFile /etc/ssl/private/mail.<domain1>.fr.key 
> 
> Alias /horde /var/www/horde 
> 
> <Directory /var/www/horde> 
> Options +FollowSymLinks 
> AllowOverride All 
> Require all granted 
> AddType application/x-httpd-php .php 
> php_value include_path ".:/usr/share/php" 
> php_value open_basedir "none" 
> php_value upload_tmp_dir "/var/www/horde/phptmp/" 
> </Directory> 
> </VirtualHost> 
> 
> 
> 
> /etc/apache2/sites-available/webmail.<domain2>.com.conf 
> 
>  
> <VirtualHost *:80> 
> DocumentRoot /var/www/horde 
> ServerName webmail.<domain2>.com 
> ServerAdmin webmaster@<domain2>.com 
> 
> RewriteEngine on 
> RewriteCond %{HTTPS} !=on 
> RewriteRule ^/(.*)$ https://%{SERVER_NAME}/$1 [R=permanent] 
> </VirtualHost> 
> 
> <VirtualHost *:443> 
> DocumentRoot /var/www/horde 
> ServerName webmail.<domain2>.com 
> ServerAdmin webmaster@<domain2>.com 
> 
> SSLEngine On 
> SSLCertificateFile /etc/ssl/certs/webmail.<domain2>.com.crt 
> SSLCertificateKeyFile /etc/ssl/private/webmail.<domain2>.com.key 
> 
> Alias /horde /var/www/horde 
> 
> <Directory /var/www/horde> 
> Options +FollowSymLinks 
> AllowOverride All 
> Require all granted 
> AddType application/x-httpd-php .php 
> php_value include_path ".:/usr/share/php" 
> php_value open_basedir "none" 
> php_value upload_tmp_dir "/var/www/horde/phptmp/" 
> </Directory> 
> </VirtualHost> 
> 
>  
> 
> Horde : 
> /var/www/horde/config/prefs.d/prefs-webmail.<domain1>.fr.php 
> 
> <blockquote> 
> <?php 
> 
> // *** Personal Information (Identities) Preferences *** 
> 
> $_prefs['theme']['value'] = 'DOMAIN1'; 
> $_prefs['theme']['locked'] = true; 
> $_prefs['initial_application']['value'] = 'imp'; 
> $_prefs['language']['value'] = 'fr_FR'; 
> $_prefs['language']['locked'] = true; 
> $_prefs['portal_layout']['locked'] = true; 
> 
> </blockquote> 
> 
> /var/www/horde/config/prefs.d/prefs-webmail.<domain2>.com.php 
> 
> <blockquote> 
> <?php 
> 
> // *** Personal Information (Identities) Preferences *** 
> 
> $_prefs['theme']['value'] = 'DOMAIN2'; 
> $_prefs['theme']['locked'] = true; 
> $_prefs['initial_application']['value'] = 'imp'; 
> $_prefs['language']['value'] = 'fr_FR'; 
> $_prefs['language']['locked'] = true; 
> $_prefs['portal_layout']['locked'] = true; 
> 
> </blockquote> 
> 
> /var/www/horde/config/registry.d/registry-webmail.<domain1>.fr.php 
> 
> <blockquote> 
> <?php 
> 
> // *** Personal Information (Identities) Preferences *** 
> 
> $this->applications['horde']['name'] = "Webmail DOMAIN1"; 
> 
> </blockquote> 
> 
> /var/www/horde/config/registry.d/registry-webmail.<domain2>.com.php 
> 
> <blockquote> 
> <?php 
> 
> // *** Personal Information (Identities) Preferences *** 
> 
> $this->applications['horde']['name'] = "Webmail DOMAIN2"; 
> 
> </blockquote> 
> 
> So, if in a web browser I type the URL 
> "https://webmail.<domain1>.fr" the name displayed for this web site 
> is "Webmail DOMAIN1" with the favicon.ico from the ' DOMAIN1' theme, 
> but after loging in or even doing a refresh of the web site, I get 
> the web site name changed to "Webmail DOMAIN2" with the favicon.ico 
> of the ' DOMAIN2' theme. 
> 
> If I remove the DOMAIN2 configuration files in prefs.d and 
> registry.d, all is back and fine for DOMAIN1 with the correct name 
> and favicon.ico icon. 
> As I was thinking of a mix between cookies for each different sites, 
> I have even tried to add a conf-webmail.<domain1>.fr.php and a 
> conf-webmail.<domain2>.com.php files in /var/www/horde/config folder 
> to override the $conf['server']['name'] and 
> $conf['cookie']['domain'] values to be specific for each domain, but 
> I did not get any better display. 
> 
> For tracing purpose, I have also created a phpinfo.php file that I 
> have added to the /var/www/horde folder and with which I can test 
> the different php values for each sites, and the 
> $_SERVER['SERVER_NAME'] php value used for the 
> $conf['server']['name'] and $conf['cookie']['domain'] values is well 
> set with webmail.<domain1>.fr and webmail.<domain2>.com depending on 
> the site URL I am accessing to. 
> 
> Does anyone have faced this kind of issue when having 2 sites for 2 
> different domains on the same server? All I want is to be able to 
> display a different name and a different favicon.ico icon for each 
> domain. 
> 
> If anyone have a clue on this, let me know. 
> 
> All the best, 
> Moody_Styley 

Are favicons and the display name the only per-vhost settings that 
don't work? I.e. do other per-vhost settings like themes, 
configuration settings etc. work correctly? If yes, you may have a hit 
a bug (or limitation). 

-- 
Jan Schneider 
The Horde Project 
https://www.horde.org/ 

-- 
Horde mailing list 
Frequently Asked Questions: http://horde.org/faq/ 
To unsubscribe, mail: horde-unsubscribe at lists.horde.org 



More information about the horde mailing list