部署PaaS应用(Part3)Drupal CMS & Magento电子商务系统 1、部署Drupal CMS应用 部署PaaS应用(Part3)Drupal CMS & Magento电子商务系统,这两个PaaS应用也是基于Openshift的PHP+MySQL+phpMyAdmin套件搭建的。 Drupal是使用PHP语言编写的开源内容管理框架(CMF),它由内容管理系统(CMS)和PHP开发框架(Framework)共同构成。 (1)在Openshift应用标签创建新应用,点击PHP 5.3。 (2)在公共URL处输入drupal,点击Create Application。 (3)点击查看应用程序。 (4)点击Add MySQL 5.1,添加MySQL应用套件。 (5)点击添加套件。 (6)点击Add phpMyAdmin 4.0,添加phpMyAdmin套件。 (7)点击添加套件。以下为添加完成的套件。 l 记下用户名adminTthrzqP,密码in6uigtQlPK3。 l 复制右侧的SourceCode:ssh://55656b2913db8c3e25000001@drupal-sdcet.example.com/~/git/drupal.git/。 (8)在Node节点,git clone源文件 [iyunv@node ~]# cd /root/sourcegit/ [iyunv@node sourcegit]# git clone ssh://55656b2913db8c3e25000001@drupal-sdcet.example.com/~/git/drupal.git/ Initialized empty Git repository in/root/sourcegit/drupal/.git/ The authenticity of host'drupal-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)? yes Warning: Permanently added'drupal-sdcet.example.com' (RSA) to the list of known hosts. remote: Counting objects: 20, done. remote: Compressing objects: 100% (15/15),done. Receiving objects: 100% (20/20), 18.23 KiB,done. remote: Total 20 (delta 0), reused 20(delta 0) (9)将drupal-7.34.tar.gz解压到Node节点的/root/mygit目录。 使用SFTP将PaaS v1.2光盘paas-xiandian目录中的drupal-7.34.tar.gz传到Node节点的/root/mygit目录。 [iyunv@node sourcegit]# cd /root/mygit/ [iyunv@node mygit]# tar -zxfdrupal-7.34.tar.gz [iyunv@node mygit]# ls dolibarr-3.6.2 dolibarr-3.6.2.zip drupal-7.34 drupal-7.34.tar.gz sugarcrm-example-master sugarcrm-example-master.zip (10)修改源文件 [iyunv@node mygit]# cd /root/sourcegit/drupal/php/ [iyunv@node php]# ls health_check.php index.php [iyunv@node php]# cp -Rf/root/mygit/drupal-7.34/* . cp: overwrite `./index.php'? y [iyunv@node php]# ls authorize.php health_check.php INSTALL.pgsql.txt LICENSE.txt profiles sites web.config CHANGELOG.txt includes install.php MAINTAINERS.txt README.txt themes xmlrpc.php COPYRIGHT.txt index.php INSTALL.sqlite.txt misc robots.txt update.php cron.php INSTALL.mysql.txt INSTALL.txt modules scripts UPGRADE.txt (11)提交更改 [iyunv@node php]# git add . [iyunv@node php]# git commit -am "mychanges" [iyunv@node php]# git push Counting objects: 1188, done. Compressing objects: 100% (1160/1160),done. Writing objects: 100% (1185/1185), 3.27 MiB| 4.53 MiB/s, done. Total 1185 (delta 143), reused 0 (delta 0) remote: Stopping PHP cartridge remote: [Wed May 27 03:13:09 2015] [warn]PassEnv variable SHELL was undefined remote: [Wed May 27 03:13:09 2015] [warn]PassEnv variable USER was undefined remote: [Wed May 27 03:13:09 2015] [warn]PassEnv variable LOGNAME was undefined remote: Waiting for stop to finish remote: Stopping MySQL cartridge remote: Stopping PHPMyAdmin cartridge remote: [Wed May 27 03:13:11 2015] [warn]PassEnv variable SHELL was undefined remote: [Wed May 27 03:13:11 2015] [warn]PassEnv variable USER was undefined remote: [Wed May 27 03:13:11 2015] [warn]PassEnv variable LOGNAME was undefined remote: Waiting for stop to finish remote: Building git ref 'master', commit382ae13 remote: Building PHP cartridge remote: Preparing build for deployment remote: Deployment id is 65b3c79a remote: Activating deployment remote: Starting MySQL cartridge remote: Starting PHPMyAdmin cartridge remote: Starting PHP cartridge remote: Result: success remote: Activation status: success remote: Deployment completed with status:success Tossh://55656b2913db8c3e25000001@drupal-sdcet.example.com/~/git/drupal.git/ a883e10..382ae13 master ->master (12)在新标签页打开drupal-sdcet.example.com,开始安装Drupal,选择Standard。 (13)选择语言。 (14)在新的标签页打开phpMyAdmin的网址https://drupal-sdcet.example.com/phpmyadmin/,输入之前记下来的用户名adminTthrzqP,密码in6uigtQlPK3。 l 如果数据库drupal已经存在,则只需要查看数据库服务器的IP地址和端口127.1.246.2:3306即可。 l 如果数据库drupal不存在,则按照以下步骤创建数据库。 (15)点击“数据库”,新建数据库drupal。 (16)以下为创建好的数据库。记下数据库服务器的IP地址和端口:127.1.246.2:3306。 (17)继续安装Drupal,数据库名输入drupal,数据库用户名为之前记下来的用户名adminTthrzqP,密码为in6uigtQlPK3。 点击Advanced Options,输入数据库服务器的IP地址127.1.246.2,端口3306,点击Save and continue。 (18)输入站点邮箱地址,站点管理员账户名称和密码。 选择国家、时区,取消选择自动检查更新,点击Save and continue。 (19)Drupal安装完成,点击Visit your new site。 (20)以下为Drupal主页。 2、部署Magento电子商务系统 Magento (麦进斗) 是一套专业开源的电子商务系统。 (1)在Openshift应用标签创建新应用,点击PHP 5.3。 (2)在公共URL处输入magento,点击Create Application。 (3)点击查看应用程序。 (4)点击Add MySQL 5.1,添加MySQL应用套件。 (5)点击添加套件。 (6)点击Add phpMyAdmin 4.0,添加phpMyAdmin套件。 (7)点击添加套件。以下为添加完成的套件。 l 记下用户名adminz1rsbHM,密码Tffs-2XZNJKx。 l 复制右侧的SourceCode:ssh://556579b713db8c3e2500002b@magento-sdcet.example.com/~/git/magento.git/。 (8)在Node节点,git clone源文件 [iyunv@node ~]# cd /root/sourcegit/ [iyunv@node sourcegit]# git clone ssh://556579b713db8c3e2500002b@magento-sdcet.example.com/~/git/magento.git/ Initialized empty Git repository in/root/sourcegit/magento/.git/ The authenticity of host'magento-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)? yes Warning: Permanently added'magento-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. [iyunv@node sourcegit]# ls dolibarr drupal magento sugarcrm (9)将magento-example-master.zip解压到Node节点的/root/mygit目录。 使用SFTP将PaaS v1.2光盘paas-xiandian目录中的magento-example-master.zip传到Node节点的/root/mygit目录。 [iyunv@node sourcegit]# cd /root/mygit/ [iyunv@node mygit]# unzipmagento-example-master.zip [iyunv@node mygit]# ls dolibarr-3.6.2 drupal-7.34 magento-example-master sugarcrm-example-master dolibarr-3.6.2.zip drupal-7.34.tar.gz magento-example-master.zip sugarcrm-example-master.zip (10)修改源文件 [iyunv@node mygit]# cd /root/sourcegit/magento/ [iyunv@node magento]# cp -Rf/root/mygit/magento-example-master/* . cp: overwrite `./libs/.gitkeep'? y cp: overwrite `./misc/.gitkeep'? y cp: overwrite `./php/index.php'? y cp: overwrite `./README.md'? y [iyunv@node magento]# ls deplist.txt libs misc php README README.md (11)提交更改 [iyunv@node magento]# git add . [iyunv@node magento]# git commit -am"my changes" [iyunv@node magento]# git push Counting objects: 16160, done. Compressing objects: 100% (14159/14159),done. Writing objects: 100% (16155/16155), 29.71MiB | 7.13 MiB/s, done. Total 16155 (delta 6659), reused 0 (delta0) remote: Stopping PHP cartridge remote: [Wed May 27 04:11:55 2015] [warn]PassEnv variable SHELL was undefined remote: [Wed May 27 04:11:55 2015] [warn]PassEnv variable USER was undefined remote: [Wed May 27 04:11:55 2015] [warn]PassEnv variable LOGNAME was undefined remote: Waiting for stop to finish remote: Stopping MySQL cartridge remote: Stopping PHPMyAdmin cartridge remote: [Wed May 27 04:12:01 2015] [warn]PassEnv variable SHELL was undefined remote: [Wed May 27 04:12:01 2015] [warn]PassEnv variable USER was undefined remote: [Wed May 27 04:12:01 2015] [warn]PassEnv variable LOGNAME was undefined remote: Waiting for stop to finish remote: Building git ref 'master', commit8cecaba remote: Building PHP cartridge remote: Preparing build for deployment remote: Deployment id is c1284a02 remote: Activating deployment remote: Starting MySQL cartridge remote: Starting PHPMyAdmin cartridge remote: Starting PHP cartridge remote: Result: success remote: Activation status: success remote: Deployment completed with status:success Tossh://556579b713db8c3e2500002b@magento-sdcet.example.com/~/git/magento.git/ e224839..8cecaba master ->master (12)在新标签页打开magento-sdcet.example.com,开始安装Magento。 (13)设置位置、时区、货币。 (14)在新的标签页打开phpMyAdmin的网址https://magento-sdcet.example.com/phpmyadmin/,输入之前记下来的用户名adminz1rsbHM,密码Tffs-2XZNJKx。 l 如果数据库magento已经存在,则只需要查看数据库服务器的IP地址和端口127.1.246.130:3306即可。 l 如果数据库magento不存在,则按照以下步骤创建数据库。 (15)点击“数据库”,新建数据库magento。 (16)以下为创建好的数据库。记下数据库服务器的IP地址和端口:127.1.246.130:3306。 (17)继续安装magento,输入数据库服务器IP地址为127.1.246.130,数据库名为magento,数据库用户名为之前记下来的用户名adminz1rsbHM,密码Tffs-2XZNJKx。 选中“跳过基本URL验证”、“使用安全URLs (SSL) ”和“跳过安全URL验证”。 点击Continue。 (18)创建管理员用户的姓名、邮箱地址、用户名和密码。 (19)Magento安装完成。 (20)点击Go to Frontend,进入Magento网站主页。 (21)点击My Account,选择Create an Account。 (22)注册新用户。 (23)以下为Magento普通用户的Dashboard。 图文详情,请查看附件。
|