1、安装mysql,并创建walle库


2、安装ansible

yum -y install ansible


3、安装php5.6及相关组件

rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm 

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

yum install php56w-fpm


4、创建walle目录路径

mkdir -p /data/www/walle-web
cd /data/www/walle-web


5、git clone walle代码到本地服务器

git clone https://github.com/meolu/walle-web.git




6、安装composer

curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer


7.1、安装vendor

cd walle-web
composer install --prefer-dist --no-dev --optimize-autoloader -vvvv


7.2、更改walle 数据库配置

vim /data/www/walle-web/walle-web/config/local.php

return [
    'components' => [
        'db' => [
            'dsn'       => isset($_ENV['WALLE_DB_DSN'])  ? $_ENV['WALLE_DB_DSN']  : 'mysql:host=127.0.0.1;dbname=walle',
            'username'  => isset($_ENV['WALLE_DB_USER']) ? $_ENV['WALLE_DB_USER'] : 'root',
            'password'  => isset($_ENV['WALLE_DB_PASS']) ? $_ENV['WALLE_DB_PASS'] : '123456',
        ],


8、初始化项目

cd walle-web
./yii walle/setup # 需要你的yes


9、安装nginx并配置

yum -y install nginx
cd /etc/nginx/conf.d/
vim default.conf
/etc/init.d/nginx start
server {
    listen       80;
    server_name  localhost; # 改你的host
    root /data/www/walle-web/walle-web/web; # 根目录为web
    index index.php;
    # 建议放内网
    # allow 192.168.0.0/24;
    # deny all;
    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }
    location ~ \.php$ {
        try_files $uri = 404;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }
}


10、启动php

/etc/init.d/php-fpm start


11、修改mail服务器配置

vim /data/www/walle-web/walle-web/config/local.php

'mail' => [
            'transport' => [
                'host'       => isset($_ENV['WALLE_MAIL_HOST']) ? $_ENV['WALLE_MAIL_HOST'] : 'smtp.163.com',     # smtp 发件地址
                'username'   => isset($_ENV['WALLE_MAIL_USER']) ? $_ENV['WALLE_MAIL_USER'] : 'zengxxxx@163.com',  # smtp 发件用户名
                'password'   => isset($_ENV['WALLE_MAIL_PASS']) ? $_ENV['WALLE_MAIL_PASS'] : 'xxxxx',       # smtp 发件人的密码
                'port'       => isset($_ENV['WALLE_MAIL_PORT']) ? $_ENV['WALLE_MAIL_PORT'] : 465,                       # smtp 端口
                'encryption' => isset($_ENV['WALLE_MAIL_ENCRYPTION']) ? $_ENV['WALLE_MAIL_ENCRYPTION'] : 'ssl',                    # smtp 协议
            ],
            'messageConfig' => [
                'charset' => 'UTF-8',
                'from'    => [
                  (isset($_ENV['WALLE_MAIL_EMAIL']) ? $_ENV['WALLE_MAIL_EMAIL'] : 'zengchengpeng2009@163.com') => (isset($_ENV['WALLE_MAIL_NAME']) ? $_ENV['WALLE_MAIL_NAME'] : '花满树出品'),
                ],  # smtp 发件用户名(须与mail.transport.username一致)

wKioL1maqZuBt1HOAASB7DI383c193.png


12、初始登录账号密码

admin/admin

wKioL1maqf2ygCjAAADjDGSbKtY725.png


参考链接:

 https://github.com/meolu/walle-web

http://www.walle-web.io/docs/installation.html