部署系统之Walle

Walle是一款不错的部署系统:简单、稳定、权限完整、高级任务。此文记录walle之PHP版本 tag v1.2.0相关操作

基于CentOS7安装

1.依赖安装设置

yum -y install mariadb-server mariadb-client ansible nginx lsof php php-cli php-common php-gd php-mbstring php-mcrypt php-mysql php-pdo php-fpm
systemctl start mariadb.service #开启MySQL服务
lsof -i:3306  #查看3306端口是否存活
mysql -e "create database walle"  #创建walle数据库

systemctl enable mariadb.service  #加入开机启动

$ rpm -qa|grep httpd
httpd-2.4.6-88.el7.centos.x86_64
httpd-tools-2.4.6-88.el7.centos.x86_64

$ rpm -e --nodeps httpd-2.4.6-88.el7.centos.x86_64
$ rpm -e --nodeps httpd-tools-2.4.6-88.el7.centos.x86_64

编辑PHP-FPM配置文件

vim /etc/php-fpm.d/www.conf
将
user = apache
group = apache 

改为
user = root
user = root

vim /usr/lib/systemd/system/php-fpm.service
将
ExecStart=/usr/sbin/php-fpm --nodaemonize

改为
ExecStart=/usr/sbin/php-fpm -R --nodaemonize

systemctl daemon-reload

2.克隆代码

mkdir -p /data/www/walle-web && cd /data/www/walle-web
git clone https://github.com/meolu/walle-web.git .

$ git show v1.2.0
commit 930fc55c3c94cd7c14fbb1294c7b3cdc78be4267
Author: littlehz 
Date:   Mon May 16 11:48:55 2016 +0800

git reset --hard 930fc55c3c94cd7c14fbb1294c7b3cdc78be4267

3.设置数据库及Email
vim config/local.php +22

请仔细查看注释

'db' => [
    'dsn'       => isset($_ENV['WALLE_DB_DSN'])  ? $_ENV['WALLE_DB_DSN']  : 'mysql:host=127.0.0.1;dbname=walle',     # 填写IP地址及新建的数据库walle
    'username'  => isset($_ENV['WALLE_DB_USER']) ? $_ENV['WALLE_DB_USER'] : 'root',                                  # 连接的用户名
    'password'  => isset($_ENV['WALLE_DB_PASS']) ? $_ENV['WALLE_DB_PASS'] : '',                                      # 连接的密码
],
'mail' => [
    'transport' => [
        'host'       => isset($_ENV['WALLE_MAIL_HOST']) ? $_ENV['WALLE_MAIL_HOST'] : 'smtp.exmail.qq.com',     # smtp 发件地址
        'username'   => isset($_ENV['WALLE_MAIL_USER']) ? $_ENV['WALLE_MAIL_USER'] : '[email protected]',  # smtp 发件用户名
        'password'   => isset($_ENV['WALLE_MAIL_PASS']) ? $_ENV['WALLE_MAIL_PASS'] : 'K84erUuxg1bHqrfD',       # smtp 发件人的密码
        'port'       => isset($_ENV['WALLE_MAIL_PORT']) ? $_ENV['WALLE_MAIL_PORT'] : 25,                       # smtp 端口  #腾讯企业邮端口已修改为465
        'encryption' => isset($_ENV['WALLE_MAIL_ENCRYPTION']) ? $_ENV['WALLE_MAIL_ENCRYPTION'] : 'tls',        # smtp 协议  #协议修改为ssl
    ],
    'messageConfig' => [
        'charset' => 'UTF-8',
        'from'    => [
          (isset($_ENV['WALLE_MAIL_EMAIL']) ? $_ENV['WALLE_MAIL_EMAIL'] : '[email protected]') => (isset($_ENV['WALLE_MAIL_NAME']) ? $_ENV['WALLE_MAIL_NAME'] : 'Evan出品'),
        ],  # smtp 发件用户名(须与mail.transport.username一致)   # [email protected]  须与 第30行的 smtp 发件用户名 一致

4.初始化

curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
composer install --prefer-dist --no-dev --optimize-autoloader -vvvv

./yii walle/setup  # 需要输入 yes

5.配置nginx

vim /etc/nginx/nginx.conf
http {
    。。。。。。
    。。。。。。
    include /etc/nginx/conf.d/*.conf;
}

cat /etc/nginx/conf.d/walle.conf

server {
    listen 80;
    server_name localhost;

    root /data/www/walle-web/web;
    index index.php;


    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }

    location ~ \.php$ {
        try_files $uri = 404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}

6.启动应用并访问

systemctl start nginx
systemctl start php-fpm

systemctl enable nginx
systemctl enable php-fpm 

访问地址:localhost
默认管理员账号密码 admin admin

Extension

walle使用方法备忘


项目配置

项目详细参数

提交上线单

上线1

上线2

上线3

上线4

上线记录

原文链接

你可能感兴趣的:(部署系统之Walle)