Koozali.org: home of the SME Server

Obsolete Releases => SME 9.x Contribs => Topic started by: calisun on April 16, 2018, 12:45:07 AM

Title: smeserver-webapps-common is rewriting domain location without me asking it.
Post by: calisun on April 16, 2018, 12:45:07 AM
I want to force domains to go to https, as per suggestion in this post
https://forums.contribs.org/index.php/topic,53045.15.html (https://forums.contribs.org/index.php/topic,53045.15.html)
smeserver-webapps-common is a better option over creating a template.

After installing the contrib, I have issued following command:
Code: [Select]
db domains setprop MyDomain.com TemplatePath WebAppVirtualHost RequireSSL enabled
So now when I go to MyDomain, it is forcing HTTPS, but at the same time, it has changed the location of iBay from MyDomain-iBay to Primary iBay. I have several domains and they all point to different iBays. So basically this contrib rendered Server-Manager Domains option useless as right now any iBay I point to has no effect as it constantly points to Primary iBay.
Title: Re: smeserver-webapps-common is rewriting domain location without me asking it.
Post by: Jean-Philippe Pialasse on April 16, 2018, 04:43:40 AM
see  https://bugs.contribs.org/show_bug.cgi?id=10282

the behaviour you ask is the default since 2014.

if it is not working this way, it is mostly because you have a template-custom hidding the fragment  /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/20IbayContent

try
Code: [Select]
ll /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts/
Title: Re: smeserver-webapps-common is rewriting domain location without me asking it.
Post by: Jean-Philippe Pialasse on April 16, 2018, 04:55:04 AM
I want to force domains to go to https, as per suggestion in this post
https://forums.contribs.org/index.php/topic,53045.15.html (https://forums.contribs.org/index.php/topic,53045.15.html)
smeserver-webapps-common is a better option over creating a template.

After installing the contrib, I have issued following command:
Code: [Select]
db domains setprop MyDomain.com TemplatePath WebAppVirtualHost RequireSSL enabled
So now when I go to MyDomain, it is forcing HTTPS, but at the same time, it has changed the location of iBay from MyDomain-iBay to Primary iBay. I have several domains and they all point to different iBays. So basically this contrib rendered Server-Manager Domains option useless as right now any iBay I point to has no effect as it constantly points to Primary iBay.

this is because you did not specified "DocumentRoot"  as needed by /etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/50Content fragment, so it default to Primary ibay.

anyway you do not need this works as stock SME should offer you the redirection to https. See my previous answer.
Title: Re: smeserver-webapps-common is rewriting domain location without me asking it.
Post by: calisun on April 16, 2018, 06:07:52 AM
Thank you Jean-Philippe Pialasse for your help.

I have uninstalled smeserver-webapps-common,
now how do I revert the domain iBay to be controlled by Server-Manager? No matter what I change domain iBay to be, it still points to Primary.

Title: Re: smeserver-webapps-common is rewriting domain location without me asking it.
Post by: calisun on April 16, 2018, 07:48:00 AM

the behaviour you ask is the default since 2014.

if it is not working this way, it is mostly because you have a template-custom hidding the fragment  /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/20IbayContent

You are correct, I had a template from How-To I have created back in 2013;
https://wiki.contribs.org/Wordpress_Multisite

I have just updated the How-To with updated code.

I just need help with question from my earlier post.
Title: Re: smeserver-webapps-common is rewriting domain location without me asking it.
Post by: Jean-Philippe Pialasse on April 16, 2018, 02:41:10 PM
You are correct, I had a template from How-To I have created back in 2013;
https://wiki.contribs.org/Wordpress_Multisite

I have just updated the How-To with updated code.

I just need help with question from my earlier post.
Code: [Select]
db domains delprop MyDomain.com TemplatePath
db domains delprop MyDomain2.com TemplatePath
db domains delprop MyDomain3.com TemplatePath
expand-template /etc/httpd/e-smith
service httpd-e-smith restart
Title: Re: smeserver-webapps-common is rewriting domain location without me asking it.
Post by: Jean-Philippe Pialasse on April 16, 2018, 02:47:06 PM
by the way,
what is needed exactly in your modified fragment ?

why wordpress in an ibay?
setting up using the contrib and a modified template including wildcard domainv for a virtualhost would be a better approach and pretty easy
Title: Re: smeserver-webapps-common is rewriting domain location without me asking it.
Post by: Jean-Philippe Pialasse on April 16, 2018, 02:57:25 PM
by the way,
what is needed exactly in your modified fragment ?
found
Code: [Select]
@@ -34,7 +34,7 @@
      . "enabled\n"
        . "    #   /sbin/e-smith/signal-event console-save\n";
     }
-    $OUT .= "    Alias       /files   $basedir/files\n";
+    $OUT .= " #   Alias       /files   $basedir/files\n";
     
     if (($domains->get_prop($virtualHost, 'SystemPrimaryDomain') || 'no')
          eq 'yes')

I would suggest rather to
Code: [Select]
cd /home/e-smith/files/ibays/$ibay/html
shopt -s dotglob nullglob
mv files/* ../files/
rmdir files
ln -s ../files

and set apache to allow followsymlinks, which you already did.
Title: Re: smeserver-webapps-common is rewriting domain location without me asking it.
Post by: calisun on April 17, 2018, 06:25:58 AM
Code: [Select]
db domains delprop MyDomain.com TemplatePath
db domains delprop MyDomain2.com TemplatePath
db domains delprop MyDomain3.com TemplatePath
expand-template /etc/httpd/e-smith
service httpd-e-smith restart

I am getting an error message:

Code: [Select]
# expand-template /etc/httpd/e-smith
ERROR: No templates were found for /etc/httpd/e-smith.
 at /sbin/e-smith/expand-template line 45
Title: Re: smeserver-webapps-common is rewriting domain location without me asking it.
Post by: sages on April 17, 2018, 07:53:35 AM
"expand-template /etc/httpd/e-smith"
Not sure there is such a template "/etc/httpd/e-smith" to expand, hence the error message.

I'd expect something like /etc/httpd/conf/httpd.conf or or /etc/httpd/admin-conf/httpd.conf from looking at the templates directory and searching the wiki.


Title: Re: smeserver-webapps-common is rewriting domain location without me asking it.
Post by: Jean-Philippe Pialasse on April 17, 2018, 02:25:43 PM
"expand-template /etc/httpd/e-smith"
Not sure there is such a template "/etc/httpd/e-smith" to expand, hence the error message.

I'd expect something like /etc/httpd/conf/httpd.conf or or /etc/httpd/admin-conf/httpd.conf from looking at the templates directory and searching the wiki.

Thank you for the correction

Did not double checked my writting, this is indeed

Code: [Select]
expand-template /etc/httpd/conf/httpd.conf
Title: Re: smeserver-webapps-common is rewriting domain location without me asking it.
Post by: calisun on April 18, 2018, 06:21:08 AM
Worked like a charm, thank you for all you help.

(https://www.askideas.com/media/11/You-Rock-Spongebob-Picture.gif)