Koozali.org: home of the SME Server

smeserver-webapps-common is rewriting domain location without me asking it.

Offline calisun

  • *
  • 601
  • +0/-0
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
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.
« Last Edit: April 16, 2018, 01:20:13 AM by calisun »
SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Online Jean-Philippe Pialasse

  • *
  • 2,745
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
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/

Online Jean-Philippe Pialasse

  • *
  • 2,745
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
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
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.

Offline calisun

  • *
  • 601
  • +0/-0
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.

SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Offline calisun

  • *
  • 601
  • +0/-0

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.
SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Online Jean-Philippe Pialasse

  • *
  • 2,745
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
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

Online Jean-Philippe Pialasse

  • *
  • 2,745
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
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

Online Jean-Philippe Pialasse

  • *
  • 2,745
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
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.

Offline calisun

  • *
  • 601
  • +0/-0
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
SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Offline sages

  • *
  • 182
  • +0/-0
    • http://www.sages.com.au
"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.


...

Online Jean-Philippe Pialasse

  • *
  • 2,745
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
"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

Offline calisun

  • *
  • 601
  • +0/-0
Worked like a charm, thank you for all you help.

SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite