官方安裝文檔https://walle-web.io/docs/installation.htmlhtml
Root 用戶下mysql
一、基礎準備nginx
yum install ansible git -ygit
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_64github
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_64web
yum install php-fpmsql
yum install mariadb mariadb-server數據庫
Useradd appsapi
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';
二、設置MySQL鏈接
三、安裝composer
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
若是不能下載,在雲服務器上手動下載,而後再把composer二進制文件傳到瓦力的服務器上。
四、安裝vendor
cd walle-web
composer install --prefer-dist --no-dev --optimize-autoloader -vvvv
五、初始化項目
cd walle-web
./yii walle/setup # 須要你的yes
六、配置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