Changes

From SME Server
Jump to navigationJump to search
2,347 bytes added ,  16:24, 26 October 2014
no edit summary
Line 12: Line 12:  
After enabling the scl repo, the scl packages can be installed by issueing the following command:
 
After enabling the scl repo, the scl packages can be installed by issueing the following command:
 
  yum install scl-utils --enablerepo=scl
 
  yum install scl-utils --enablerepo=scl
      
==== Installation of a collection ====
 
==== Installation of a collection ====
Line 52: Line 51:     
===== Examples =====
 
===== Examples =====
 +
===== run php54 on a hosted website (virtual host) =====
 +
Install php54 from scl repo
 +
yum --enablerepo scl install php54-php.x86_64 
 +
 +
Verify the installation,
 +
  scl enable php54 'php -v'
 +
It should return this version (or higher)
 +
PHP 5.4.16 (cli) (built: Jul 10 2014 10:06:38)
 +
 +
Create a template fragment that will enable apache to invoke php54 for a virtual domain
 +
nano /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/70php54
 +
 +
paste this code fragment:
 +
<nowiki>{
 +
  use esmith::DomainsDB;
 +
  my $domains = esmith::DomainsDB->open_ro;
 +
if (($domains->get_prop($virtualHost, 'php54') || 'disabled')
 +
        eq 'enabled')
 +
{
 +
$OUT = "    #Enable php54 through Cgi-Bin wrapper. Needs a wrapper script in /cgi-bin/php54-wrapper\n";
 +
$OUT .= "    AddHandler php-cgi .php\n";
 +
$OUT .= "    Action php-cgi /cgi-bin/php54-wrapper\n";
 +
$OUT .= "    <Location />\n";
 +
$OUT .= "      Options +ExecCGI\n";
 +
$OUT .= "    </Location>\n";
 +
}
 +
}</nowiki>
 +
and Save with <CTRL>-X - yes.
 +
 +
Create the cgi-wrapper script:
 +
nano ~<Ibayname of MyVirtualDomain>/cgi-bin/php54-wrapper
 +
 +
Insert this code:
 +
#!/bin/bash
 +
source /opt/rh/php54/enable
 +
exec php-cgi
 +
and Save with <CTRL>-X - yes.
 +
 +
Then execute these commands:
 +
cd ~<Ibayname of MyVirtualDomain>/cgi-bin/
 +
restorecon -RF php54-wrapper
 +
chown www:www php54-wrapper
 +
chmod ugo-rwx php54-wrapper
 +
chmod ug+rx php54-wrapper
 +
 +
The template fragment for httpd.conf needs a database setting to be enabled for the (virtual) domain (NOT the ibay):
 +
Check with
 +
db domains show <myVirtualDomain.com>
 +
Edit with
 +
db domains setprop <myVirtualDomain.com> php54 enabled
 +
Check with
 +
db domains show <myVirtualDomain.com>
 +
The setting should have been added to the right domain.
 +
 +
To enable this run:
 +
expand-template /etc/httpd/conf/httpd.conf
 +
/etc/init.d/httpd-e-smith restart
 +
 +
Notes:
 +
Using Cgi-Bin wrapper scripts makes your system vulnerable to [https://www.digitalocean.com/community/tutorials/how-to-protect-your-server-against-the-shellshock-bash-vulnerability Shellshock server bash vulnerability], make sure your server runs the latest version of bash.
 +
This example and code still have to be tested (I will soon).
 +
Source: [http://www.ilsistemista.net/index.php/linux-a-unix/45-joomla-3-3-centos-6-and-php-version-putting-all-together.html?start=1 This] HowTo for CENTOS6
 +
== Building your own software collections ==
   −
== Building your own software collections ==
   
Please consider building your collection on non production systems only. For a full reference please refer to the developers manual [https://access.redhat.com/documentation/en-US/Red_Hat_Developer_Toolset/1/html/Software_Collections_Guide/chap-Introducing_Software_Collections.html '''here'''].
 
Please consider building your collection on non production systems only. For a full reference please refer to the developers manual [https://access.redhat.com/documentation/en-US/Red_Hat_Developer_Toolset/1/html/Software_Collections_Guide/chap-Introducing_Software_Collections.html '''here'''].
  
38

edits

Navigation menu