首先感谢软件开源做者http://www.walle-web.io/aboutme.htmljavascript
官方教程http://www.walle-web.io/php
ansible非必须html
1. 删除老的安装包java
remove php.x86_64 php-cli.x86_64 php-common.x86_64 php-gd.x86_64 php-ldap.x86_64 php-mbstring.x86_64 php-mcrypt.x86_64 php-mysql.x86_64 php-pdo.x86_64mysql
2. 这个连接包含安装php5.6源和svn用法linux
http://www.cnblogs.com/jokerbj/p/9034188.htmlnginx
3. 安装php5.6相关组件git
yum install php56w.x86_64 php56w-cli.x86_64 php56w-common.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mcrypt.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64
github
4. 安装php-fpm 5.6web
yum install php56w-fpm
yum install nginx
须要安装svn,git命令
yum install svn git
该安装咱们称为宿主机安装,其实也就是瓦力在这台机子上部署而已,svn能够不放在宿主机
咱们实验环境以下
宿主机 192.168.1.127
目标主机(上线的主机,业务主机)192.168.1.107
由于我只有2个主机,因此咱们在192.168.1.127只安装了瓦力,192.168.1.107安装svn服务和mysql服务
mkdir -p /data/www/walle-web && cd /data/www/walle-web # 新建目录 |
vi config/local.php +14 |
curl -sS https://getcomposer.org/installer | php |
cd walle-web |
安装速度慢或失败,可直接下载vendor解压到项目根目录
cd walle-web |
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-ctype --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap --with-gettext --enable-fpm --with-pdo_mysql
凡是在第7步刷新页面看到50x均是前5步安装不完整,自行检查
凡是在第7步刷新页面看到404均是nginx配置不当,自行检查
nginx简单配置
server { |
[root@joker walle-web]# systemctl start nginx
[root@joker walle-web]# systemctl start php-fpm
[root@joker walle-web]# systemctl start mysqld
访问地址:localhost
固然,可能你配置nginx时的server_name是192.168.1.127时,配置本地hosts以后,直接访问:192.168.1.127亦可。
默认密码admin admin
svn部署上线与git有点不太同样,svn是推荐增量发布(固然也能够全量更新),在开发者提交文件列表(可能带版本号),管理员审核上线单。发起部署时,为该上线单开辟一个独立空间,检出代码,选择上线单中的文件(可能带版本号)同步到目标机群。有不了解宿主机和目标机群关系、上线流程的同窗先到项目主页了解。
由于svn没有git的版本快照,因此在部署须要全量代码编译操做时,只能选择全量更新,此时要求发布的分支/tag/trunk是可发布状态。建议java + git组合。同理其它须要全量代码在宿主机作编译相关的操做的语言,且为svn版本管理,请慎用。
svn目录推荐如下规范,详细能够注册riouxsvn,做为svn测试地址。固然三无(无trunk、无branches、无tags)也是支持:)
配置完毕以后,先检测下,如无问题则能够发起上线单了:)
宿主机代码检出检测出错,请确认php进程用户{user}有代码存储仓库{path}读写权限。详细错误:{error},PHP默认启动用户apache,咱们将php和nginx启动用户改为work,建立work用户。根据上图我们的paht就是/home/work/tmp
没有权限,是由于用户{user}对目录{path}没有读写权限,给权限便可 |
目标机器部署出错,请确认php进程{local_user}用户ssh-key加入目标机器的{remote_user}用户ssh-key信任列表,且{remote_user}有目标机器发布版本库{path}写入权限。详细错误:{error},目标主机也是要建立work用户,为了后面同步
问题:请确认php进程{local_user}用户ssh-key加入目标机器的{remote_user}用户ssh-key信任列表
添加机器信任,仍是没理解请百度吧(由于太多的同窗问这问题,实在没办法只能这么啰嗦) |
问题:{remote_user}有目标机器发布版本库{path}写入权限,我们的path目录就是/data/www/web-data
su remote_user |
其余问题http://www.walle-web.io/docs/troubleshooting.html
增长个环境
models/Project.php
//研发环境
const LEVEL_DEV = 4;
messages/zh-CN/w.php
'conf_level_4' => '研发环境',
views/task/select-project.php
<!-- 研发环境 -->
<div class="widget-box transparent">
<div class="widget-header">
<h4 class="lighter"><?= yii::t('w', 'conf_level_4') ?></h4>
<div class="widget-toolbar no-border"><a href="javascript:;" data-action="collapse">
<i class="icon-chevron-up"></i>
</a>
</div>
</div>
<div class="widget-body">
<div class="widget-main padding-6 no-padding-left no-padding-right">
<?php foreach ($projects as $project) { ?>
<?php if ($project['level'] == Project::LEVEL_DEV) { ?>
<a class="btn btn-inline btn-info" style="min-width:120px;margin:auto auto 20px 40px;" href="<?= Url::to("@web/task/submit?projectId={$project['id']}") ?>"><?= $project['name'] ?></a>
<?php } ?>
<?php } ?>
</div>
</div>
</div>
views/conf/edit.php
Project::LEVEL_DEV => \Yii::t('w', 'conf_level_' . Project::LEVEL_DEV),
Executing: $ ssh -T -p 33899 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o CheckHostIP=false 'www'@'ip'
'ln -sfn /data/releases/nidaye/20190625-125715 /data/releases/nidaye/current-nidaye.tmp
&& chown -h www /data/releases/nidaye/current-nidaye.tmp
&& mv -fT /data/releases/nidaye/current-nidaye.tmp /data/www/nidaye
&& . /etc/profile && cd /data/releases/nidaye/20190625-125715
&& echo "restart" > /tmp/log && sh /home/www/test.sh'
执行 -T 伪终端,保持链接 -q 静默模式 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no 取消交互认证 -o CheckHostIP=false 防止DNS欺骗 -s 软链接 -f 覆盖 -n 目录当作普通文件 -f 禁止交互操做,就是不提醒 -T 避免目标目录是否存在而产生的不肯定性