部署PaaS应用(Part4)Moodle & Open Atrium
部署PaaS应用(Part4)Moodle & Open Atrium1、部署Moodle应用部署PaaS应用(Part4)Moodle & Open Atrium,SugarCRM 、Dolibarr ERP 、Drupal 、Magento、Moodle 、Open Atrium 这六个应用的创建过程大同小异,注意他们之间细微的差别。WordPress务必掌握,因为WordPress部署过程中用到了Git Server,其他应用都没有使用Git Server,样题和512测试题中也没有涉及WordPress,很可能会在正式比赛中考到。魔灯(Moodle,Modular Object-Oriented Dynamic Learning Environment)是一个用于制作网络课程网站的软件包。 (1)在Openshift应用标签创建新应用,点击PHP 5.3。 (2)在公共URL处输入moodle,点击Create Application。 (3)点击查看应用程序。 (4)点击Add MySQL 5.1,添加MySQL应用套件。 (5)点击添加套件。 (6)点击Add phpMyAdmin 4.0,添加phpMyAdmin套件。 (7)点击添加套件。以下为添加完成的套件。 l记下phpMyAdmin的URL: https://moodle-sdcet.example.com/phpmyadmin/l记下用户名adminEQlj1rk,密码aq_18RqX5wF1。l复制右侧的SourceCode:ssh://5566beef13db8c11b0000001@moodle-sdcet.example.com/~/git/moodle.git/。 (8)在Node节点,git clone源文件# cd /root/sourcegit/# git clone ssh://5566beef13db8c11b0000001@moodle-sdcet.example.com/~/git/moodle.git/Initialized empty Git repository in/root/sourcegit/moodle/.git/The authenticity of host 'moodle-sdcet.example.com(192.168.200.102)' can't be established.RSA key fingerprint is90:b6:9e:d0:3e:76:27:ce:34:3b:d6:b4:41:5d:e7:31.Are you sure you want to continueconnecting (yes/no)? yesWarning: Permanently added'moodle-sdcet.example.com' (RSA) to the list of known hosts.remote: Counting objects: 20, done.remote: Compressing objects: 100% (15/15),done.remote: Total 20 (delta 0), reused 20(delta 0)Receiving objects: 100% (20/20), 18.23 KiB,done. (9)将Moodle2.2.2.zip解压到Node节点的/root/mygit目录。使用SFTP将PaaS v1.2光盘paas-xiandian目录中的Moodle2.2.2.zip传到Node节点的/root/mygit目录。 # cd /root/mygit/# unzip Moodle2.2.2.zip # lsdolibarr-3.6.2 drupal-7.34 magento-example-master moodle sugarcrm-example-masterdolibarr-3.6.2.zipdrupal-7.34.tar.gzmagento-example-master.zipMoodle2.2.2.zipsugarcrm-example-master.zip (10)修改源文件# cd /root/sourcegit/moodle/php# cp -Rf /root/mygit/moodle/* .cp: overwrite`./index.php'? y # lsadmin cohort error health_check.phplib notes README.txtthemeauth comment file.php help.php local pix report TRADEMARK.txtbackup config-dist.phpfiles index.php login plagiarism repositoryuserblocks COPYING.txt filter install messagepluginfile.phprss userpixblog course githash.phpinstall.php mnet portfolio tag version.phpbrokenfile.phpdraftfile.php grade iplookup mod question tags webservicecalendar enrol group lang my rating tags.txt (11)提交更改# git add . # git commit -am "mychanges" # git pushCounting objects: 11285, done.Compressing objects: 100% (10281/10281),done.Writing objects: 100% (11282/11282), 25.19MiB | 5.49 MiB/s, done.Total 11282 (delta 2775), reused 0 (delta0)remote: Stopping PHP cartridgeremote: PassEnv variable SHELL was undefinedremote: PassEnv variable USER was undefinedremote: PassEnv variable LOGNAME was undefinedremote: Waiting for stop to finishremote: Stopping MySQL cartridgeremote: Stopping PHPMyAdmin cartridgeremote: PassEnv variable SHELL was undefinedremote: PassEnv variable USER was undefinedremote: PassEnv variable LOGNAME was undefinedremote: Waiting for stop to finishremote: Building git ref 'master', commit5af929cremote: Building PHP cartridgeremote: Preparing build for deploymentremote: Deployment id is a8cd44c8remote: Activating deploymentremote: Starting MySQL cartridgeremote: Starting PHPMyAdmin cartridgeremote: Starting PHP cartridgeremote: Result: successremote: Activation status: successremote: Deployment completed with status:successTossh://5566beef13db8c11b0000001@moodle-sdcet.example.com/~/git/moodle.git/be43e78..5af929cmaster ->master (12)在新标签页打开moodle-sdcet.example.com,开始安装Moodle,选择English(en)。 (13)确认路径,保持默认即可。 (14)选择默认的数据库驱动。 (15)在新的标签页打开phpMyAdmin的网址https://moodle-sdcet.example.com/phpmyadmin/,输入之前记下来的用户名adminEQlj1rk,密码aq_18RqX5wF1。 l如果数据库moodle已经存在,则只需要查看数据库服务器的IP地址和端口127.1.247.2:3306即可。l如果数据库moodle不存在,则按照以下步骤创建数据库。 (16)点击“数据库”,新建数据库moodle。 (17)以下为创建好的数据库。记下数据库服务器的IP地址和端口:127.1.247.2:3306。 (18)继续安装Moodle,数据库服务器为127.1.247.2,数据库名为moodle,数据库用户名为之前记下来的用户名adminEQlj1rk,密码aq_18RqX5wF1。 (19)点击Continue接受版权声明。 (20)等待Moodle检查完服务器环境是否符合要求,点击Continue。 (21)等待Moodle安装完成,点击Continue。 (22)创建管理员账号admin,输入密码、邮箱地址、所在城市、国家、时区,点击Update profile。 (23)设置网站首页,点击Save changes。 (24)以下为Moodle首页。 (25)点击下方的Admin User,进入管理员用户的首页。 2、部署Open Atrium应用 Open Atrium 是一套基于Drupal的内部网工具包,预置了自定义面板、博客、手册、日历、任务分配系统、团队微博六项功能,适合做企业内部协作系统,也可以用来做项目管理系统、知识管理系统等。 (1)在Openshift应用标签创建新应用,点击PHP 5.3。 (2)在公共URL处输入openatrium,点击Create Application。 (3)点击查看应用程序。 (4)点击Add MySQL 5.1,添加MySQL应用套件。 (5)点击添加套件。 (6)点击Add phpMyAdmin 4.0,添加phpMyAdmin套件。 (7)点击添加套件。 l记下phpMyAdmin的URL: https://openatrium-sdcet.example.com/phpmyadmin/l记下用户名adminBCgbl7g,密码X-F6RJhT-jmc。l复制右侧的SourceCode:ssh://5566d1df13db8c11b000001d@openatrium-sdcet.example.com/~/git/openatrium.git/。 (8)点击“或者,您可以添加整个您看到的套件的目录”,添加Cron 1.4。 (9)点击添加套件,以下为添加完成的套件。 (10)在Node节点,git clone源文件# cd /root/sourcegit/# git clone ssh://5566d1df13db8c11b000001d@openatrium-sdcet.example.com/~/git/openatrium.git/Initialized empty Git repository in/root/sourcegit/openatrium/.git/The authenticity of host'openatrium-sdcet.example.com (192.168.200.102)' can't be established.RSA key fingerprint is90:b6:9e:d0:3e:76:27:ce:34:3b:d6:b4:41:5d:e7:31.Are you sure you want to continue connecting(yes/no)? yesWarning: Permanently added'openatrium-sdcet.example.com' (RSA) to the list of known hosts.remote: Counting objects: 20, done.remote: Compressing objects: 100% (15/15),done.remote: Total 20 (delta 0), reused 20(delta 0)Receiving objects: 100% (20/20), 18.23 KiB,done. # lsdolibarr drupalmagentomoodle openatriumsugarcrm (11)将openatrium-2-quickstart.zip解压到Node节点的/root/mygit目录。使用SFTP将PaaS v1.2光盘paas-xiandian目录中的openatrium-2-quickstart.zip传到Node节点的/root/mygit目录。 # cd /root/mygit/# unzipopenatrium-2-quickstart.zip # lsdolibarr-3.6.2 drupal-7.34.tar.gz moodle openatrium-2-quickstart.zipdolibarr-3.6.2.zipmagento-example-master Moodle2.2.2.zip sugarcrm-example-masterdrupal-7.34 magento-example-master.zipopenatrium-2-quickstartsugarcrm-example-master.zip (12)利用git命令打成git包# git clone --bareopenatrium-2-quickstart openatrium-2-quickstart.gitInitialized empty Git repository in/root/mygit/openatrium-2-quickstart.git/ # lsdolibarr-3.6.2 drupal-7.34.tar.gz moodleopenatrium-2-quickstart.git sugarcrm-example-master.zipdolibarr-3.6.2.zipmagento-example-master Moodle2.2.2.zip openatrium-2-quickstart.zipdrupal-7.34 magento-example-master.zipopenatrium-2-quickstartsugarcrm-example-master (13)修改源文件# cd/root/sourcegit/openatrium # git remote addupstream -m master /root/mygit/openatrium-2-quickstart.git/ # git pull -srecursive -X theirs upstream master # lsdeplist.txt libsmiscphp README.md # rm -f deplist.txt (14)提交更改# git add . # git commit -am"changes" # git pushCounting objects: 10639, done.Compressing objects: 100% (6973/6973),done.Writing objects: 100% (10628/10628), 25.53MiB | 31.14 MiB/s, done.Total 10628 (delta 3287), reused 10618(delta 3284)remote: Stopping PHP cartridgeremote: PassEnv variable SHELL was undefinedremote: PassEnv variable USER was undefinedremote: PassEnv variable LOGNAME was undefinedremote: Waiting for stop to finishremote: Stopping MySQL cartridgeremote: Stopping Cron cartridgeremote: Stopping PHPMyAdmin cartridgeremote: PassEnv variable SHELL was undefinedremote: PassEnv variable USER was undefinedremote: PassEnv variable LOGNAME was undefinedremote: Waiting for stop to finishremote: Building git ref 'master', commita06fc0cremote: Building PHP cartridgeremote: Preparing build for deploymentremote: Deployment id is d9dda367remote: Activating deploymentremote: Starting MySQL cartridgeremote: Starting Cron cartridgeremote: Starting PHPMyAdmin cartridgeremote: Stopping gear...remote: Stopping PHP cartridgeremote: PassEnv variable SHELL was undefinedremote: PassEnv variable USER was undefinedremote: PassEnv variable LOGNAME was undefinedremote: httpd (no pid file) not runningremote: Stopping MySQL cartridgeremote: Stopping Cron cartridgeremote: Stopping PHPMyAdmin cartridgeremote: Waiting for stop to finishremote: Starting gear...remote: Starting MySQL cartridgeremote: Starting Cron cartridgeremote: Starting PHPMyAdmin cartridgeremote: Starting PHP cartridgeremote:`/var/lib/openshift/5566d1df13db8c11b000001d/app-root/runtime/repo/php/sites/default/files'-> `/var/lib/openshift/5566d1df13db8c11b000001d/app-root/data//files'remote: Starting PHP cartridgeremote: httpd (pid 11193) already runningremote:`/var/lib/openshift/5566d1df13db8c11b000001d/app-root/runtime/repo/php/sites/default/files'-> `/var/lib/openshift/5566d1df13db8c11b000001d/app-root/data//files'remote: Result: successremote: Activation status: successremote: Deployment completed with status:successTossh://5566d1df13db8c11b000001d@openatrium-sdcet.example.com/~/git/openatrium.git/3815d0c..a06fc0cmaster ->master (15)在新标签页打开openatrium-sdcet.example.com,开始安装Open Atrium,选择English(built-in)。 (16)在新的标签页打开phpMyAdmin的网址https://openatrium-sdcet.example.com/phpmyadmin/,输入之前记下来的用户名adminBCgbl7g,密码X-F6RJhT-jmc。 l如果数据库openatrium已经存在,则只需要查看数据库服务器的IP地址和端口127.1.247.130:3306即可。l如果数据库openatrium不存在,则按照以下步骤创建数据库。 (17)点击“数据库”,新建数据库openatrium。 (18)以下为创建好的数据库。记下数据库服务器的IP地址和端口:127.1.247.130:3306。 (19)继续安装Open Atrium,数据库名输入openatrium,数据库用户名为之前记下来的用户名adminBCgbl7g,密码为X-F6RJhT-jmc。点击Advanced Options,输入数据库服务器的IP地址127.1.247.130,端口3306,点击Save and continue。 (20)选择Quick Installation。 (21)等待安装完成。 (22)输入站点名称、邮箱地址、站点管理员账户名称和密码。选择国家、时区,取消选择自动检查更新,点击Save and continue。 (23)如果遇到不显示页面的情况,关闭当前页面,重新打开openatrium-sdcet.example.com。在USER LOGIN处输入刚创建的用户名和密码。 (24)以下为用户lcg的主页。 (25)以下为在Openshift主页显示的已创建的应用列表。 (26)以下为在Git Server上使用rhc显示已创建的Openshift应用详细信息。# rhc appsYour authorization token has expired.Please sign in now to continue on paas.example.com.Password: ****** dolibarr @ http://dolibarr-sdcet.example.com/(uuid: 55630b8913db8c6728000027)------------------------------------------------------------------------------ Domain: sdcet Created: May 257:46 AM Gears: 1 (defaults to small)GitURL: ssh://55630b8913db8c6728000027@dolibarr-sdcet.example.com/~/git/dolibarr.git/ SSH: 55630b8913db8c6728000027@dolibarr-sdcet.example.com Deployment: auto (on git push) php-5.3 (PHP 5.3) ----------------- Gears: Located with mysql-5.1, phpmyadmin-4 mysql-5.1 (MySQL 5.1) --------------------- Gears: Located withphp-5.3, phpmyadmin-4 Connection URL:mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/ Database Name:dolibarr Password: xFhxKPXN-6_i Username: admin5cLHJRI phpmyadmin-4 (phpMyAdmin 4.0) ----------------------------- Gears: Located withphp-5.3, mysql-5.1 Connection URL: https://dolibarr-sdcet.example.com/phpmyadmin/ drupal @ http://drupal-sdcet.example.com/(uuid: 55656b2913db8c3e25000001)-------------------------------------------------------------------------- Domain: sdcet Created: May 272:58 AM Gears: 1 (defaults to small)GitURL: ssh://55656b2913db8c3e25000001@drupal-sdcet.example.com/~/git/drupal.git/ SSH: 55656b2913db8c3e25000001@drupal-sdcet.example.com Deployment: auto (on git push) php-5.3 (PHP 5.3) ----------------- Gears: Located with mysql-5.1, phpmyadmin-4 mysql-5.1 (MySQL 5.1) --------------------- Gears: Located with php-5.3, phpmyadmin-4 Connection URL:mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/ Database Name:drupal Password: in6uigtQlPK3 Username: adminTthrzqP phpmyadmin-4 (phpMyAdmin 4.0) ----------------------------- Gears: Located withphp-5.3, mysql-5.1 Connection URL: https://drupal-sdcet.example.com/phpmyadmin/ jenkins @ http://jenkins-sdcet.example.com/(uuid: 55618d7613db8cd39c000008)---------------------------------------------------------------------------- Domain: sdcet Created: May 244:36 AM Gears: 1 (defaults to small)GitURL: ssh://55618d7613db8cd39c000008@jenkins-sdcet.example.com/~/git/jenkins.git/ SSH: 55618d7613db8cd39c000008@jenkins-sdcet.example.com Deployment: auto (on git push) jenkins-1 (Jenkins Server) -------------------------- Gears: 1 small magento @ http://magento-sdcet.example.com/(uuid: 556579b713db8c3e2500002b)---------------------------------------------------------------------------- Domain: sdcet Created: May 274:00 AM Gears: 1 (defaults to small)GitURL: ssh://556579b713db8c3e2500002b@magento-sdcet.example.com/~/git/magento.git/SSH: 556579b713db8c3e2500002b@magento-sdcet.example.com Deployment: auto (on git push) php-5.3 (PHP 5.3) ----------------- Gears: Located with mysql-5.1, phpmyadmin-4 mysql-5.1 (MySQL 5.1) --------------------- Gears: Located withphp-5.3, phpmyadmin-4 Connection URL:mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/ Database Name:magento Password: Tffs-2XZNJKx Username: adminz1rsbHM phpmyadmin-4 (phpMyAdmin 4.0) ----------------------------- Gears: Located withphp-5.3, mysql-5.1 Connection URL: https://magento-sdcet.example.com/phpmyadmin/ moodle @ http://moodle-sdcet.example.com/(uuid: 5566beef13db8c11b0000001)-------------------------------------------------------------------------- Domain: sdcet Created: 3:08 AM Gears: 1 (defaults to small)GitURL: ssh://5566beef13db8c11b0000001@moodle-sdcet.example.com/~/git/moodle.git/ SSH: 5566beef13db8c11b0000001@moodle-sdcet.example.com Deployment: auto (on git push) php-5.3 (PHP 5.3) ----------------- Gears: Located with mysql-5.1, phpmyadmin-4 mysql-5.1 (MySQL 5.1) --------------------- Gears: Located withphp-5.3, phpmyadmin-4 Connection URL:mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/ Database Name:moodle Password: aq_18RqX5wF1 Username: adminEQlj1rk phpmyadmin-4 (phpMyAdmin 4.0) ----------------------------- Gears: Located withphp-5.3, mysql-5.1 Connection URL: https://moodle-sdcet.example.com/phpmyadmin/ openatrium @http://openatrium-sdcet.example.com/ (uuid: 5566d1df13db8c11b000001d)---------------------------------------------------------------------------------- Domain: sdcet Created: 4:29 AM Gears: 1 (defaults to small)GitURL: ssh://5566d1df13db8c11b000001d@openatrium-sdcet.example.com/~/git/openatrium.git/ SSH: 5566d1df13db8c11b000001d@openatrium-sdcet.example.com Deployment: auto (on git push) php-5.3 (PHP 5.3) ----------------- Gears: Located with mysql-5.1, phpmyadmin-4, cron-1.4 mysql-5.1 (MySQL 5.1) --------------------- Gears: Located withphp-5.3, phpmyadmin-4, cron-1.4 Connection URL:mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/ Database Name:openatrium Password: X-F6RJhT-jmc Username: adminBCgbl7g phpmyadmin-4 (phpMyAdmin 4.0) ----------------------------- Gears: Located withphp-5.3, mysql-5.1, cron-1.4 Connection URL: https://openatrium-sdcet.example.com/phpmyadmin/ cron-1.4 (Cron 1.4) ------------------- Gears: Located with php-5.3, mysql-5.1, phpmyadmin-4 sugarcrm @ http://sugarcrm-sdcet.example.com/(uuid: 5562d91e13db8c6728000001)------------------------------------------------------------------------------ Domain: sdcet Created: May 254:11 AM Gears: 1 (defaults to small)GitURL: ssh://5562d91e13db8c6728000001@sugarcrm-sdcet.example.com/~/git/sugarcrm.git/ SSH: 5562d91e13db8c6728000001@sugarcrm-sdcet.example.com Deployment: auto (on git push) php-5.3 (PHP 5.3) ----------------- Gears: Located with mysql-5.1, phpmyadmin-4 mysql-5.1 (MySQL 5.1) --------------------- Gears: Located withphp-5.3, phpmyadmin-4 Connection URL:mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/ Database Name:sugarcrm Password: uHLRn3suRrYF Username: adminkYS1nPh phpmyadmin-4 (phpMyAdmin 4.0) ----------------------------- Gears: Located withphp-5.3, mysql-5.1 Connection URL: https://sugarcrm-sdcet.example.com/phpmyadmin/ wordpress @http://wordpress-sdcet.example.com/ (uuid: 556184d513db8c8ab2000002)-------------------------------------------------------------------------------- Domain: sdcet Created: May 243:59 AM Gears: 1 (defaults tosmall)GitURL: ssh://556184d513db8c8ab2000002@wordpress-sdcet.example.com/~/git/wordpress.git/ Initial Git URL:root@192.168.200.200:/root/gitlocal/wordpress-example.git SSH: 556184d513db8c8ab2000002@wordpress-sdcet.example.com Deployment: auto (on gitpush) php-5.3 (PHP 5.3) ----------------- Gears: Located with mysql-5.1 mysql-5.1 (MySQL 5.1) --------------------- Gears: Located withphp-5.3 Connection URL:mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/ Database Name:wordpress Password: CEvH7NpRWwD7 Username: admins71v8Us You have access to 8 applications.图文详情请查看附件。
页:
[1]