Difference between revisions of "User talk:Calisun"

From SME Server
Jump to navigationJump to search
Line 1: Line 1:
'''Following Step-by-Step instructions are for installing wordpress in an i-Bay of SME 8.x  
+
'''Following Step-by-Step instructions are for installing wordpress in an i-Bay of SME 8.x '''
 
 
(tested on 8b6)
 
'''
 
 
 
  Notice: When installing ANY web application in an iBay of the SME server that has additional user access, besides
 
  admin, there is always a danger of other users changing (intentionally or accidentally) files in the   
 
  application iBay. If there is a possible security issue with users, it is recommended to install wordpress
 
  contribution from here: http://wiki.contribs.org/Category:Contrib
 
        If there is no user security issue, or the server only has admin access, you may continue.
 
 
 
 
 
==
 
'''PART ONE:''' ==
 
  
  
---Before installing Wordpress:
+
  Notice: When installing ANY web application in an iBay of the SME server, there is always a danger of
 +
  users changing (intentionally or accidentally) files in the application iBay.
 +
  If there is a possible security issue with users, it is recommended to install wordpress
 +
  contribution from here: http://wiki.contribs.org/Category:Contrib
 +
  If there is no user security issue, or the server only has admin access, you may continue.
  
---THIS NEEDS TO BE DONE ONLY ONCE ON A NEW SYSTEM:---
 
  
Any subsequent wordpress installs, go to the Second Part.
 
  
 +
== '''== PART ONE: ==''' ==
  
This step is not necessary, you can do it if you need to upload files/ pictures larger than the default settings in php.
 
  
(Wordpress also has its own user upload limit settings, which need to be changed in wordpress dashboard, separately from PHP settings)
+
'''A) Wordpress install in an iBay of SME server:'''
  
(Below can be done again if for some reason values need to be changed)
 
  
 
+
'''A1)''' Create an iBay in which you wish to install wordpress on.
 
 
    db configuration setprop php MemoryLimit 128M
 
    db configuration setprop php PostMaxSize 112M
 
    db configuration setprop php UploadMaxFilesize 96M
 
    expand-template /etc/php.ini
 
    sv t httpd-e-smith
 
 
 
Sidenote: To see how to change file size limits for other aplications, see here: [http://wiki.contribs.org/Email#Set_max_email_size]
 
------------------------------------------------------------------------
 
 
 
 
 
 
 
==
 
'''PART TWO:''' ==
 
 
 
 
 
---Wordpress install in an iBay of SME server:
 
 
 
 
 
 
 
1) Create an iBay in which you wish to install wordpress on.
 
  
 
When creating the iBay in server-manager:
 
When creating the iBay in server-manager:
Line 58: Line 25:
  
  
 
+
'''A2)''' Issue a following command to enable PHP temporary upload folder in that iBay.(Change "iBay" to the name of your ibay and remove quote marks)
2) Issue a following command to enable PHP temporary upload folder in that iBay
 
.(Change "iBay" to the name of your ibay and remove quote marks)
 
 
 
  
 
     db accounts setprop "iBay" PHPBaseDir /home/e-smith/files/ibays/"iBay":/tmp
 
     db accounts setprop "iBay" PHPBaseDir /home/e-smith/files/ibays/"iBay":/tmp
 
     signal-event ibay-modify "iBay"
 
     signal-event ibay-modify "iBay"
Sidenote, the above command should work for most everybody, but if for some reason it does not work for you, see this: [http://bugs.contribs.org/show_bug.cgi?id=6650]
 
  
  
3) Issue a following command to enable Symlinks in that iBay
+
'''A3)''' Issue a following command to enable Symlinks in that iBay.(Change "iBay" to the name of your ibay and remove quote marks)
.(Change "iBay" to the name of your ibay and remove quote marks)
 
 
 
  
 
     db accounts setprop "iBay" AllowOverride all
 
     db accounts setprop "iBay" AllowOverride all
Line 77: Line 38:
 
     signal-event ibay-modify "iBay"
 
     signal-event ibay-modify "iBay"
  
 +
'''A4)''' Create mysql database and database user for wordpress to use. Make sure database user has all the privileges to the database you have created. For security reasons, allow access to the database from localhost only.
  
 
+
'''A5)''' Download latest version from www.wordpress.org to your computer and unzip it. Upload unzipped wordpress to desired ibay/html
4) Create mysql database and database user for wordpress to use. Make sure database user has all the privileges to the database you have created. For security reasons, allow access to the database from localhost only.
 
 
 
 
 
 
 
5) Download latest version from www.wordpress.org to your computer and unzip it. Upload unzipped wordpress to desired ibay/html
 
 
 
 
 
 
 
6) In the SME admin panel, point the correct domain to this new iBay.
 
 
 
  
  
7) Point your web browser to your domain and go through the installation process.
+
'''A6)''' In the SME admin panel, Create a new domain and point it to the iBay where the wordpress is installed.
  
  
 +
'''A7)''' Point your web browser to your domain and go through the installation process.
  
 +
**** If you want to have a single blog (personal blog) on one domain, you are done.
  
  
----
 
  
''**** If you want to have a single blog (personal blog) on one domain, you are done.
+
'''B) Enable a Multisite:'''
''
 
  
----
 
 
 
 
 
'''-+-+-+ To enable Multisite: -+-+-+
 
'''''''
 
 
 
1) Open wp-config.php  and add the folowing code:
 
  
 +
'''B1)''' Open wp-config.php  and add the folowing code:
  
  
 
     define('WP_ALLOW_MULTISITE', true);
 
     define('WP_ALLOW_MULTISITE', true);
 
 
  
 
- just above
 
- just above
 
 
  
 
     define('DB_NAME', .....
 
     define('DB_NAME', .....
  
  
 
+
'''B2)''' Log into your wordpress Dashboard
2) Log into your wordpress Dashboard
 
  
 
Under:  Tools, Network
 
Under:  Tools, Network
 
  
  
 
Choose desired settings and click on Install
 
Choose desired settings and click on Install
  
* NOTE- SME Server does not support Wildcard Subdomains, until someone is able to figure out how to create a custom template for Wildcard Subdomains (See this thread for possible answer)[http://forums.contribs.org/index.php?topic=48178.0]  until such time, you must choose Subfolder
+
* NOTE- By default SME Server does not support Wildcard Subdomains, so you will need to choose Subfolder. If you want or need to use a Subdomain, you will need to create a custom template for SME Server to support Wildcard Subdomains. For instructions on how to create custom template for Wildcard Subdomains, go below to PART TWO for instructions.
  
  
3) After you click install, you will be taken to a "Create a Network of WordPress Sites" screen
+
'''B3)''' After you click install, you will be taken to a "Create a Network of WordPress Sites" screen
  
 
Make sure you follow ALL 3 steps.
 
Make sure you follow ALL 3 steps.
  
 +
**** If you are planning to run several blogs under one domain, than you are done.
  
  
4) SME Server specific change:
+
'''C) To run several Domains on one wordpress install:'''
 
 
''!! My Wordpress installation works fine without this step. But if you have issues after following all the steps above, try it to see if it helps.
 
This was suggested by forum users here: [http://forums.contribs.org/index.php/topic,47413.msg234013.html#msg234013]''
 
 
 
 
 
in the .htaccess file change
 
from:
 
 
 
 
 
 
 
    RewriteEngine On
 
    RewriteBase /
 
 
 
 
 
 
 
to:
 
 
 
 
 
 
 
    RewriteEngine On
 
    RewriteBase /"ibay"
 
 
 
 
 
 
 
 
 
 
 
----
 
 
 
''**** If you are planning to run several blogs under one domain, than you are done.
 
 
 
''
 
 
 
----
 
 
 
 
 
 
 
'''-+-+-+ To run several Domains on one wordpress install: -+-+-+'''''''
 
 
   
 
   
  
1) you will need to install Wordpress Domain Mapping plugin.
+
'''C1)''' You will need to install Wordpress Domain Mapping plugin.
 
   
 
   
Find it here: [http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/]
+
Find it here: http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/
  
 
Just follow installation instructions from the plugin download site.
 
Just follow installation instructions from the plugin download site.
  
  
2) Create all your domains in the server-manager and point them to the iBay where you installed wordpress.
+
'''C2)''' Create all your domains in the SME server-manager and point them to the iBay where you installed wordpress.
 
 
3) create new site in wordpress that will handle new domain created in step 2
 
 
 
  
 +
'''C3)''' create new sites in wordpress dashboard that will handle new domains created in step 2
  
 
SME Specific Change:
 
SME Specific Change:
  
SME Server has issues displaying images inside blogs that use Domain mapping, in order for the images to show correctly, we need to create custom template to enable allow_url_fopen and create custom template for "hosts" file:
+
SME Server and wordpress use the same name "files" for totally different folders, and that is causing issues displaying images inside blogs that use Domain mapping. In order for the images to show up correctly, we need to create a custom template to fix the conflict.
 +
Go below to PART TWO for instruction on how to create the custom template.
  
  
'''+=+= BELOW INFORMATION IS STILL WORK IN PROGRESS AS I TRY TO FIGURE OUT THE IMAGE ISSUE. I WILL REMOVE THIS NOTICE ONCE THE ISSUE IS FIXED, BUT AS OF RIGHT NOW, USE THE BELOW INFORMATION AT YOUR OWN RISK +=+='''
 
  
 +
==
 +
'''== PART TWO: ==''' ==
  
  
3)     Allow PHP URL File Open per ibay:
+
'''
 +
A) Custom Templates'''
  
Make custom httpd directory if it does not exist
 
  
  mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
+
'''A1)''' Enable Wildcard Subdomains
  
 +
Inside following folder location:
  
Inside that directory create a file
+
    /etc/e-smith/template-custom/etc/httpd/conf/httpd.conf/VirtualHosts
  99allow_url_fopen
 
  
Edit the file 99allow_url_fopen and input following content: (Change "iBay" to the name of your ibay and remove quote marks)
+
Create a text file named:
  
 +
    03ServerAlias
  
 +
Contens of the text file:
  
 +
    ServerAlias *.{$virtualHost}
  
  <Directory /home/e-smith/files/ibays/"iBay"/html>
 
  php_admin_flag allow_url_fopen on
 
  </Directory>
 
  
Save the file
+
To activate the custom template:
  
Expand
+
    signal-event post-upgrade; signal-event reboot
  
  expand-template /etc/httpd/conf/httpd.conf
 
  
Restart httpd.
+
'''A2)''' Fix Image display problem.
  
  /etc/init.d/httpd-e-smith restart
+
Inside following folder location:
  
 +
    /etc/e-smith/template-custom/etc/httpd/conf/httpd.conf/VirtualHosts
  
3) Create directory:  
+
Create a text file named:
  /etc/e-smith/templates-custom/etc/hosts,
 
  
then inside that directory create a file :
+
    20IbayContent
  30customhosts,
 
 
 
Edit the file 30customhosts and add your domains to it that will use wordpress domain mapping (replace domain# with your actual domain names)
 
 
 
  127.0.0.1  *.domain1.com
 
  127.0.0.1  *.domain2.com
 
  127.0.0.1  *.domain3.com 
 
 
 
 
 
Save the file 
 
 
Expand:
 
  expand-template /etc/hosts
 
  
Restart httpd:  
+
Contens of the text file:
  
   /etc/init.d/httpd-e-smith restart
+
    $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:
  
 +
    signal-event post-upgrade; signal-event reboot
  
  

Revision as of 07:37, 16 December 2012

Following Step-by-Step instructions are for installing wordpress in an i-Bay of SME 8.x


  Notice: When installing ANY web application in an iBay of the SME server, there is always a danger of
  users changing (intentionally or accidentally) files in the application iBay. 
  If there is a possible security issue with users, it is recommended to install wordpress 
  contribution from here: http://wiki.contribs.org/Category:Contrib
  If there is no user security issue, or the server only has admin access, you may continue.


== PART ONE: ==

A) Wordpress install in an iBay of SME server:


A1) Create an iBay in which you wish to install wordpress on.

When creating the iBay in server-manager:

  • - Change the group from Admin to everyone. - This will allow users to create blogs and post pictures without having permission issues.
  • - Change User access to Write=group, Read=everyone
  • - Under Public access via web, choose Entire internet without password.
  • - Enable Execution of dynamic content.


A2) Issue a following command to enable PHP temporary upload folder in that iBay.(Change "iBay" to the name of your ibay and remove quote marks)

   db accounts setprop "iBay" PHPBaseDir /home/e-smith/files/ibays/"iBay":/tmp
   signal-event ibay-modify "iBay"


A3) Issue a following command to enable Symlinks in that iBay.(Change "iBay" to the name of your ibay and remove quote marks)

   db accounts setprop "iBay" AllowOverride all
   db accounts setprop "iBay" FollowSymLinks enabled
   db accounts setprop "iBay" Indexes disabled
   signal-event ibay-modify "iBay"

A4) Create mysql database and database user for wordpress to use. Make sure database user has all the privileges to the database you have created. For security reasons, allow access to the database from localhost only.

A5) Download latest version from www.wordpress.org to your computer and unzip it. Upload unzipped wordpress to desired ibay/html


A6) In the SME admin panel, Create a new domain and point it to the iBay where the wordpress is installed.


A7) Point your web browser to your domain and go through the installation process.

        • If you want to have a single blog (personal blog) on one domain, you are done.


B) Enable a Multisite:


B1) Open wp-config.php and add the folowing code:


   define('WP_ALLOW_MULTISITE', true);

- just above

   define('DB_NAME', .....


B2) Log into your wordpress Dashboard

Under: Tools, Network


Choose desired settings and click on Install

  • NOTE- By default SME Server does not support Wildcard Subdomains, so you will need to choose Subfolder. If you want or need to use a Subdomain, you will need to create a custom template for SME Server to support Wildcard Subdomains. For instructions on how to create custom template for Wildcard Subdomains, go below to PART TWO for instructions.


B3) After you click install, you will be taken to a "Create a Network of WordPress Sites" screen

Make sure you follow ALL 3 steps.

        • If you are planning to run several blogs under one domain, than you are done.


C) To run several Domains on one wordpress install:


C1) You will need to install Wordpress Domain Mapping plugin.

Find it here: http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/

Just follow installation instructions from the plugin download site.


C2) Create all your domains in the SME server-manager and point them to the iBay where you installed wordpress.

C3) create new sites in wordpress dashboard that will handle new domains created in step 2

SME Specific Change:

SME Server and wordpress use the same name "files" for totally different folders, and that is causing issues displaying images inside blogs that use Domain mapping. In order for the images to show up correctly, we need to create a custom template to fix the conflict. Go below to PART TWO for instruction on how to create the custom template.


== == PART TWO: == ==


A) Custom Templates


A1) Enable Wildcard Subdomains

Inside following folder location:

   /etc/e-smith/template-custom/etc/httpd/conf/httpd.conf/VirtualHosts

Create a text file named:

   03ServerAlias

Contens of the text file:

   ServerAlias *.{$virtualHost}


To activate the custom template:

   signal-event post-upgrade; signal-event reboot


A2) Fix Image display problem.

Inside following folder location:

   /etc/e-smith/template-custom/etc/httpd/conf/httpd.conf/VirtualHosts

Create a text file named:

   20IbayContent

Contens of the text file:

   $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:

   signal-event post-upgrade; signal-event reboot


Good Luck

And have fun with your new Wordpress install.