walle 1.0最新部署

时间:2023-01-02 13:57:49

环境

centos7
mysql5.6(预先部署)
php5.6(预先部署,php需要开启pdo_mysql,exec函数执行)
nginx1.22
git
Composer
ansible

安装walle

walle 1.0最新部署

  • 下载walle安装包
    wget https://github.com/meolu/walle-web-v1.x/archive/refs/tags/v1.2.0.tar.gz或者git clone https://github.com/meolu/walle-web-v1.x.git
    官方安装文档:https://walle-web.io/docs/1/installation.html

mkdir /data/www
ln -s /data/www /www
chown www.www /data/www/
cd /software/walle-web
tar xf v1.2.0.tar.gz
mv walle-web-v1.x-1.2.0 /www/walle-web
chown www.www /www/walle-web -R
  • 创建walle数据库

> create database walle;
> grant all privileges on walle.* to 'walle'@'%' identified by 'walle';
> flush privileges;
  • 配置config/local.php
    配置mysql,邮箱,和cookie

vi config/local.php
'db' => [
'dsn' => 'mysql:host=127.0.0.1;dbname=walle', # 新建数据库walle
'username' => 'walle', # 连接的用户名
'password' => 'walle', # 连接的密码
],

安装git和ansible

yum install -y git ansible

安装composer 1.9.0

curl -sS https://getcomposer.org/installer | /usr/local/webserver/php56/bin/php
ln -s /usr/local/webserver/php56/bin/php /usr/local/bin/php
mv composer.phar /usr/local/bin/composer # PATH目录
composer self-update 1.9.0 # 切换版本,不支持composer 2的

安装vendor

cd walle-web
composer global require "fxp/composer-asset-plugin:*" # 安装依赖包 回车
composer install --prefer-dist --no-dev --optimize-autoloader -vvvv # 回车

初始化项目

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

配置nignx

cat > conf/sites/walle-web.conf <<EOF
server
{
listen 80;
server_name walle.xxx.com;
index index.html index.htm index.php;
root /www/walle-web/web;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css|ico)\$
{
expires 1h;
}
# 建议放内网
# allow 192.168.0.0/24;
# deny all;

location / {
try_files \$uri \$uri/ /index.php\$is_args\$args;
}
location ~ .*\.(php|php5)?\$
{
try_files \$uri = 404;
fastcgi_pass 127.0.0.1:9056;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
include fastcgi_params;
include fcgi.conf;
}
access_log logs/walle.xxx.com.access.log main;
}
EOF
chown www.www /www/walle-web/ -R

登录

本地host,访问http://walle.xxx.com
初始化管理员账号密码为:admin/admin,初始化开发者账号密码为:demo/demo