Koozali.org: home of the SME Server

Wordpress Multisite

Offline newburns

  • *
  • 345
  • +0/-0
  • A good plumber, noob developer
    • Mt. Rose MEdia
Wordpress Multisite
« on: January 03, 2013, 06:20:18 AM »
I've recently upgraded my multisite to follow Calisun's User http://wiki.contribs.org/User_talk:Calisun Page instructions, but am coming up with errors once I
Code: [Select]
expand-template /etc/httpd/conf/httpd.conf
Code: [Select]
ERROR in /etc/e-smith/templates-custom//etc/httpd/conf/httpd.conf/VirtualHosts/20IbayContent: Program fragment delivered error <<Can't locate object method "above" via package "the" (perhaps you forgot to load "the"?) at /etc/e-smith/templates-custom//etc/httpd/conf/httpd.conf/VirtualHosts/20IbayContent line 69.>> at template line 1
WARNING in /etc/e-smith/templates//etc/httpd/conf/httpd.conf/80VirtualHosts: ERROR: Template processing failed for //etc/httpd/conf/httpd.conf/VirtualHosts: 1 fragment generated errors
 at /etc/e-smith/templates//etc/httpd/conf/httpd.conf/80VirtualHosts line 38
WARNING in /etc/e-smith/templates//etc/httpd/conf/httpd.conf/80VirtualHosts: Use of uninitialized value in concatenation (.) or string at /etc/e-smith/templates//etc/httpd/conf/httpd.conf/80VirtualHosts line 38.
ERROR in /etc/e-smith/templates-custom//etc/httpd/conf/httpd.conf/VirtualHosts/20IbayContent: Program fragment delivered error <<Can't locate object method "above" via package "the" (perhaps you forgot to load "the"?) at /etc/e-smith/templates-custom//etc/httpd/conf/httpd.conf/VirtualHosts/20IbayContent line 69.>> at template line 1
WARNING in /etc/e-smith/templates//etc/httpd/conf/httpd.conf/80VirtualHosts: ERROR: Template processing failed for //etc/httpd/conf/httpd.conf/VirtualHosts: 1 fragment generated errors
 at /etc/e-smith/templates//etc/httpd/conf/httpd.conf/80VirtualHosts line 38
WARNING in /etc/e-smith/templates//etc/httpd/conf/httpd.conf/80VirtualHosts: Use of uninitialized value in concatenation (.) or string at /etc/e-smith/templates//etc/httpd/conf/httpd.conf/80VirtualHosts line 38.
WARNING: Template processing succeeded for //etc/httpd/conf/httpd.conf: 4 fragments generated warnings
 at /sbin/e-smith/expand-template line 45
SME 8.0
Quad 6600
8gb DDR2 800
8 TB RAID 5
Dual Gigabit NIC
I Still Don't KNOW WHAT I AM DOING. Please, don't assume I know anything about Linux or Centos, I just know hardware

Offline calisun

  • *
  • 620
  • +0/-1
Re: Wordpress Multisite
« Reply #1 on: January 03, 2013, 08:30:50 AM »
Strange, works fine for me:

inside folder location:

Code: [Select]
/etc/e-smith/template-custom/etc/httpd/conf/httpd.conf/VirtualHosts/
Create a text file named:

Code: [Select]
20IbayContent
Contents of the text file:

Code: [Select]
{
    use esmith::AccountsDB;
    my $accounts = esmith::AccountsDB->open_ro;

    use esmith::DomainsDB;
    my $domains = esmith::DomainsDB->open_ro;

    $OUT = "";

    my $ibay = $virtualHostContent;
    my $basedir = "/home/e-smith/files/ibays/$ibay";
    my $cgiBin = $accounts->get_prop($ibay, "CgiBin") || "";

    $OUT .= "    DocumentRoot         $basedir/html\n";

    if ($cgiBin)
    {
$OUT .= "    ScriptAlias /cgi-bin $basedir/cgi-bin\n";
    }
    else
    {
$OUT .=
"    # To add cgi-bin ScriptAlias for this i-bay, run:\n"
      . "    #   /sbin/e-smith/db accounts setprop $ibay CgiBin "
    . "enabled\n"
      . "    #   /sbin/e-smith/signal-event console-save\n";
    }
    $OUT .= "#    Alias       /files   $basedir/files\n";
   
    if (($domains->get_prop($virtualHost, 'SystemPrimaryDomain') || 'no')
         eq 'yes')
    {
my @ibays = $accounts->ibays;
foreach my $ibay (@ibays)
{
    my $key = $ibay->key;
    next if $key eq $virtualHostContent;
    my $basedir = "/home/e-smith/files/ibays/$key";
    my $cgiBin = $ibay->prop("CgiBin") || "";
    my $name = $ibay->prop("Name") || "";
   
    $OUT .= "\n";
    $OUT .= "    # $key ibay ($name)\n";
    $OUT .= "\n";
   
    if ($cgiBin)
    {
$OUT .= "    ScriptAlias /$key/cgi-bin $basedir/cgi-bin\n";
    }
    else
    {
$OUT .=
    "    # To add cgi-bin ScriptAlias for this i-bay, run:\n"
    . "    #   /sbin/e-smith/db accounts setprop $key CgiBin "
. "enabled\n"
    . "    #   /sbin/e-smith/signal-event console-save\n";
    }

    $OUT .= "    Alias       /$key/files   $basedir/files\n";

    # Make sure this one is last since it's a prefix of the above
    # aliases. If we put it first, it would get expanded before the
    # other aliases, creating problems.

    $OUT .= "    Alias       /$key        $basedir/html\n";
}
$OUT .= "    # No ibays in system\n" unless @ibays;
    }
}

To activate the custom template:

Code: [Select]
signal-event post-upgrade; signal-event reboot
« Last Edit: January 03, 2013, 08:33:51 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

Offline newburns

  • *
  • 345
  • +0/-0
  • A good plumber, noob developer
    • Mt. Rose MEdia
Re: Wordpress Multisite
« Reply #2 on: January 03, 2013, 08:35:59 AM »
Does it really require a reboot or will expanding the httpd.conf work?
This is a production server and reboots require scheduling with the company employees
SME 8.0
Quad 6600
8gb DDR2 800
8 TB RAID 5
Dual Gigabit NIC
I Still Don't KNOW WHAT I AM DOING. Please, don't assume I know anything about Linux or Centos, I just know hardware

Offline calisun

  • *
  • 620
  • +0/-1
Re: Wordpress Multisite
« Reply #3 on: January 03, 2013, 08:48:13 AM »
oops, my bad, I had a typo, the folder location actually needs to be:

Code: [Select]
/etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts/
afaik, expanding the httpd.conf should work




.
« Last Edit: January 03, 2013, 09:24:28 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

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Wordpress Multisite
« Reply #4 on: January 03, 2013, 02:39:11 PM »
calisun & newburns

Quote
afaik, expanding the httpd.conf should work


...and restart httpd-e-smith
ie
expand-template /etc/httpd/conf/httpd.conf
svc -h /service/httpd-e-smith
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.