centos 安装walle(瓦力)发布系统
2018-10-11 07:24:59    16    0    0
alen
1.宿主机安装 ansible依赖
yum install ansible # RHEL/CentOS/Fedora

2.安装walle
    (1)检出代码
            
cd walle-web

composer install  # 如果缺少bower-asset的话, 先安装:composer global require "fxp/composer-asset-plugin:*"
./yii walle/setup   # 初始化项目
配置nginx/apache的webroot指向walle-web/web


(2)设置mysql链接

vi config/web.php # 设置mysql连接
找到如下项,修改即可
'db' => [
    'dsn'       => 'mysql:host=127.0.0.1;dbname=walle', # 新建数据库walle
    'username'  => 'username',                          # 连接的用户名
    'password'  => 'password',                          # 连接的密码
],


(3)安装composer
mv composer.phar /usr/local/bin/composer                # PATH目录

(4) 安装vendor
cd walle-web
composer install --prefer-dist --no-dev --optimize-autoloader -vvvv

(5)初始化项目
cd walle-web
./yii walle/setup # 需要你的yes

(6) 配置nginx
nginx简单配置

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;#oneinstack  fastcgi_pass unix:/dev/shm/php-cgi.sock;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }
}

(7)安装完成,通过域名访问即可
此处需要注意,如果php执行环境是通过oneinstack 安装的,在访问时有可能会出现502,把nginx中的fastcgi_pass    127.0.0.1:9000;改为fastcgi_pass unix:/dev/shm/php-cgi.sock;

Pre: centos 安装apidoc

Next: nginx配置无环境开发解决办法

16
Sign in to leave a comment.
No Leanote account? Sign up now.
0 comments
Table of content