centos7安装walle自动化上线

centos7安装walle

1.以下安装,均在宿主机(一台配置了LAMP/LNMP的linux机器)上操作

安装lnmp环境,建议使用centos7 yum安装,因为centos7 yum源默认支持Php5.4以上版本,避免walle系统不兼容

yum install -y mariadb mariadb-server nginx php php-bcmath php-fpm php-gd* php-json freetype freetype-devel php-mbstring php-mcrypt php-mysql php-opcache php-pdo php-pdo_dblib php-pgsql php-recode php-snmp php-soap php-xml php-pecl-zip mhash libmcrypt libmcrypt-devel

2.创建walle的web目录,我把web根目录配置成/data/www/walle-web(需要配置nginx指向,后面会详述)

mkdir -p /data/www/walle-web && cd/data/www/walle-web # 新建目录

下载walle-web-master.zip并解压(下载地址:https://github.com/meolu/walle-web)

unzip walle-web-master.zip

cd walle-web-master

3.设置mariadb数据库(mysql的操作一样),只需要创建数据库,建表的操作交给walle的setup.php安装程序

MariaDB [(none)]> create database wallecharset=utf8mb4 collate utf8mb4_unicode_ci;

MariaDB [(none)]> grant all privileges onwalle.* to 'walleuser'@'%' identified by 'wallepass';

修改walle的web连接

vim /data/www/walle-web/walle-web-master/config/local.php +14

'db' => [

'dsn'       =>'mysql:host=127.0.0.1;dbname=walle', # 新建数据库walle
'username'  =>'username',                         # 连接的用户名
'password'  =>'password',                         # 连接的密码

],

4.安装composer,如果已安装跳过

curl -sS https://getcomposer.org/installer |php

mv composer.phar /usr/local/bin/composer #PATH目录

5.安装vendor

cd /data/www/walle-web/walle-web-master

composer install --prefer-dist --no-dev--optimize-autoloader -vvvv

安装速度慢或失败,可直接下载vendor解压到项目根目录(即/data/www/walle-web/walle-web-master目录下)

6.初始化项目

cd /data/www/walle-web/walle-web-master

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

安装完成后会显示:

Migrated up successfully.

7.配置nginx

刷新页面看到50x或者404均是nginx配置不当,需要查看nginx日志

nginx简单配置

server { listen 80; server_name 192.168.3.13;# 改你的host root/data/www/walle-web/walle-web-master/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个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值