官方安装文档https://walle-web.io/docs/installation.html
Root 用户下
1、基础准备
yum install ansible git -y
rpm -e 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_64
yum install 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_64
yum install php-fpm
yum install mariadb mariadb-server
Useradd apps
mkdir -p /data/www/walle-web
chown -R apps:apps /data
然后下载源代码:
https://github.com/meolu/walle-web,并且放到路径/data/www/walle-web下。
用root用户登录的mariadb,创建数据库walle和用户walle,以及赋予权限:
create database walle;
create user 'walle'@'127.0.0.1' identified by 'password';
grant all on walle.* to 'walle'@'127.0.0.1';
2、设置MySQL连接
3、安装composer
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
如果不能下载,在云服务器上手动下载,然后再把composer二进制文件传到瓦力的服务器上。
4、安装vendor
cd walle-web
composer install --prefer-dist --no-dev --optimize-autoloader -vvvv
5、初始化项目
cd walle-web
./yii walle/setup # 需要你的yes
6、配置nginx
Yum 安装nginx
Nginx配置文件nginx.conf
server {
listen 80;
server_name walle.compony.com; # 改你的host
root /the/dir/of/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;
}
}
然后修改/etc/php-fpm.d/www.conf中:
user = apps
group = apps
修改nginx.conf中:
user apps
然后root用户执行:
service php-fpm start
service nginx start
setenforce 0
然后浏览器打开地址,默认用户名密码admin:admin