Example #1
0
<?php

require_once 'lib.php';
require_once realpath(dirname(__FILE__)) . '/../actions.php';
require_once realpath(dirname(__FILE__)) . '/../conf.php';
global $conf;
if (is_file("/home/ubuntu/fb25.lock")) {
    exec_script("sudo add-apt-repository ppa:ondrej/php5-oldstable\n        sudo apt-get update");
    $fb_ver = "2.5";
} else {
    $fb_ver = "2.1";
}
//pacotes
exec_script("\n    sudo apt-get update\n    sudo apt-get -y install apache2 libapache2-mod-php5 php5-mysql php5-mcrypt lynx lynx-cur php5-curl php5-dev php5-gd php5-mcrypt php5-memcache php5-memcached php5-mysql \n    sudo a2enmod ssl\n    sudo a2enmod rewrite\n    sudo apt-get -y install apachetop\n    sudo apt-get -y install firebird{$fb_ver}-super subversion git-core php5-interbase\n    sudo dpkg-reconfigure -fff firebird2.1-super; \n    sudo cp {$conf['basedir']}/firebird/*.so /usr/lib/firebird/{$fb_ver}/UDF\n    sudo apt-get -y install tz-brasil\n    sudo dpkg-reconfigure tzdata\n    sudo chmod 444 /etc/init.d/postfix\n    sudo rm /etc/php5/conf.d/timezone.ini");
//eaccelerator
exec_script("sudo apt-get install make;\n\tcd /tmp; mkdir /tmp/eaccelerator; cd eaccelerator; wget -O /tmp/eaccelerator/eaccelerator.tar https://github.com/eaccelerator/eaccelerator/tarball/master;\n\tcd /tmp/eaccelerator; tar --strip-components 1 -xf /tmp/eaccelerator/eaccelerator.tar; phpize; ./configure; make; make install;\n    rm -rf /tmp/eaccelerator;\n    sudo mkdir -p /var/cache/eaccelerator;\n    chmod 777 /var/cache/eaccelerator;\n    sudo cp {$conf['basedir']}/templates/eaccelerator.ini /etc/php5/conf.d/;\n");
//git clone
//exec_script("cd /home; sudo git clone git@github.com:Superlogica/cloud.git");
//firewall
exec_script("\n         sudo ufw reset\n         sudo ufw allow ssh\n         sudo ufw allow http\n         sudo ufw allow https\n         sudo ufw enable");
//cloud.lock
@unlink("/home/cloud/cloud.lock");
//ativar app no apache
exec_script("sudo rm /etc/apache2/sites-enabled/*; sudo ln -s /home/cloud/conf/cloud.superlogica.com /etc/apache2/sites-enabled/001cloud");
deploy_action("cloud");
atualizarCloudIni_action();
apachetunning_action();
phpiniupdate_action();
//_newrelic();
Example #2
0
<?php

require_once 'lib.php';
require_once realpath(dirname(__FILE__)) . '/../actions.php';
require_once realpath(dirname(__FILE__)) . '/../conf.php';
global $conf;
exec_script("\n    sudo apt-get update\n    sudo apt-get -y install mysql-server-5.5;\n\tmysql -u root -p; \n\tset password for root@localhost=password(''); quit; \n");
//pacotes
exec_script("\n    sudo apt-get -y install apache2 libapache2-mod-php5 php5-mysql php5-mcrypt lynx lynx-cur php5-curl php5-dev php5-gd php5-mcrypt php5-memcache php5-memcached php5-mysql;  \n    sudo apt-get install phpmyadmin; \n\tsudo su;\n\tsudo echo 'Include /etc/phpmyadmin/apache.conf' >> /etc/apache2/apache2.conf;\t\n    sudo a2enmod ssl;\n    sudo a2enmod rewrite;\n    sudo apt-get -y install apachetop;\n    sudo apt-get -y /home/apps/sessioninstall git-core;\n    sudo apt-get -y install tz-brasil;\n    sudo dpkg-reconfigure tzdata;\n    sudo chmod 444 /etc/init.d/postfix\n    sudo cp {$conf['basedir']}/templates/superlogica.ini /etc/php5/apache2/conf.d/;\n    cd /usr/local; sudo wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz; sudo tar xzf ioncube_loaders_lin_x86-64.tar.gz;\n    sudo cp {$conf['basedir']}/templates/ioncube.ini /etc/php5/apache2/conf.d/;    \n    sudo rm /etc/php5/conf.d/timezone.ini\n\tsudo mkdir /home/apps/session; sudo chmod -R 777 /home/apps/session");
//eaccelerator
exec_script("\n    cd /tmp; mkdir /tmp/eaccelerator; cd eaccelerator; wget -O /tmp/eaccelerator/eaccelerator.tar https://github.com/eaccelerator/eaccelerator/tarball/master;\n    cd /tmp/eaccelerator; tar --strip-components 1 -xf /tmp/eaccelerator/eaccelerator.tar; phpize; ./configure; make; make install;\n    rm -rf /tmp/eaccelerator;\n    sudo mkdir -p /var/cache/eaccelerator;\n    chmod 777 /var/cache/eaccelerator;\n    sudo cp {$conf['basedir']}/templates/eaccelerator.ini /etc/php5/conf.d/;\n");
// exec_script("sudo ln -s /home/plataforma/public /home/apps/public");
//firewall
exec_script("\n         sudo ufw reset\n         sudo ufw allow ssh\n         sudo ufw allow http\n         sudo ufw allow https\n         sudo ufw allow 3049\n         sudo ufw enable");
//ativar app no apache
exec_script("sudo rm /etc/apache2/sites-enabled/*; sudo ln -s /home/apps/conf/apps.superlogica.net /etc/apache2/sites-enabled/001apps");
deploy_action("apps");
//deploy_action("plataforma");
apachetunning_action();
//_newrelic();