walle安装

实验之前最好把firewalld和selinux关闭了,避免对实验造成影响.步骤就不详细列出来了,下面开始正式安装walle

操作系统:centos 7.2 x86_64

1.安装lnmp环境

建议使用centos7 yum安装,需要先安装php5.6版本,centos7默认yum仓库的php版本是5.4的,walle安装要求提供php5.5版本以上的,避免walle系统不兼容.walle安装在LAMP/LNMP的linux机器上作为宿主机.

这里提供了centos6.5和centos7.0的安装php5.6的方法.

配置yum源
追加CentOS 6.5的epel及remi源。

# rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

以下是CentOS 7.0的源。

# yum install epel-release
# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

使用yum list命令查看可安装的包(Packege)。

# yum list --enablerepo=remi --enablerepo=remi-php56 | grep php
 
yum源配置好了,安装LAMP/LNMP环境。

# yum install --enablerepo=remi --enablerepo=remi-php56 php \
php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd \
php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof 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 hp-pecl-zip mhash libmcrypt \
libmcrypt-devel mariadb mariadb-server nginx 

用PHP命令查看版本。

# php --version
显示为5.6版本就ok了

2.创建walle的web目录

这个web根目录需要配置nginx指向为root,后面会详述.这里先创建walle的文件路径为 /data/www/walle-web
下载walle-web.zip并解压(下载地址:https://github.com/meolu/walle-web)

新建目录

mkdir -p /data/www/walle-web && cd /data/www/walle-web  

因为下载的walle是在github上可以直接用git工具下载

 yum -y install git  

使用git工具下载

[root@localhost walle-web]# git clone https://github.com/meolu/walle-web
Cloning into 'walle-web'...
remote: Counting objects: 4685, done.
remote: Compressing objects: 100% (48/48), done.
remote: Total 4685 (delta 18), reused 30 (delta 10), pack-reused 4627
Receiving objects: 100% (4685/4685), 14.13 MiB | 1.30 MiB/s, done.
Resolving deltas: 100% (2609/2609), done.
 

查看已经下载并解压好了

[root@localhost walle-web]# ls  
walle-web
[root@localhost walle-web]# cd walle-web/
[root@localhost walle-web]# pwd
/data/www/walle-web/walle-web
[root@localhost walle-web]# ls
assets      composer.json  config   controllers  Dockerfile  LICENSE  messages    models     runtime  vendor  web      yii
components  composer.lock  console  docker       docs        mail     migrations  README.md  tests    views   widgets

3.设置mariadb数据库(mysql的操作一样)

只需要创建数据库,建表的操作交给walle的setup.php安装程序.
先启动mysql并初始化

[root@localhost walle-web]# systemctl start mariadb.service 
[root@localhost walle-web]# mysql_secure_installation 

#一定要初始化用户名和密码,要不初始化./yii walle/setup 会数据库报错

登陆mysql并创建库与用户密码

[root@localhost walle-web]# mysql -uroot -p123456
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 5.5.60-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database walle charset=utf8mb4 collate utf8mb4_unicode_ci;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> grant all privileges on walle.* to 'walleuser'@'%' identified by 'wallepass';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.01 sec)

修改walle的web连接 vim /data/www/walle-web/walle-web/config/local.php


return [
    'components' => [
        'db' => [
            'dsn'       => isset($_ENV['WALLE_DB_DSN'])  ? $_ENV['WALLE_DB_DSN']  : 'mysql:host=127.0.0.1;dbname=walle',  #库名称
            'username'  => isset($_ENV['WALLE_DB_USER']) ? $_ENV['WALLE_DB_USER'] : 'walleuser', #用户名
            'password'  => isset($_ENV['WALLE_DB_PASS']) ? $_ENV['WALLE_DB_PASS'] : 'wallepass',  #密码
        ],

walle配置.jpg

4.安装composer

[root@localhost walle-web]# curl -sS https://getcomposer.org/installer | php

All settings correct for using Composer
Downloading...

Composer (version 1.7.2) successfully installed to: /data/www/walle-web/walle-web/composer.phar
Use it: php composer.phar

[root@localhost walle-web]# 
[root@localhost walle-web]# mv composer.phar /usr/local/bin/composer 

5.安装vendor

在walle根目录下安装

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

composer install --prefer-dist --no-dev --optimize-autoloader -vvvv
安装速度慢或失败,可直接下载vendor解压到项目根目录
(即/data/www/walle-web/walle-web/目录下)
composer安装完成.jpg

6.初始化项目

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

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

walle初始化.jpg
walle初始化完成.jpg

7.配置nginx

刷新页面看到50x或者404均是nginx配置不当,需要查看nginx日志,这里放出nginx简单配置在 vim /etc/nginx/nginx.conf文件中修改添加如下配置.


server {
    listen       80;
    server_name  192.168.0.102; # 改你的host
    root /data/www/walle-web/walle-web/web; # 根目录为web
    index index.php;

    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;
    }
}

walle的nginx配置.jpg

保存退出之后,重启php-fpm和nginx服务


[root@localhost walle-web]# systemctl restart php-fpm nginx

8.访问地址:http://192.168.0.102

管理员默认账户密码都为:
admin

walle登录界面.jpg
walle登录成功.jpg

这样centos7上的walle就算搭建成功了.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 194,761评论 5 460
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 81,953评论 2 371
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 141,998评论 0 320
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 52,248评论 1 263
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 61,130评论 4 356
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 46,145评论 1 272
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 36,550评论 3 381
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 35,236评论 0 253
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 39,510评论 1 291
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 34,601评论 2 310
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 36,376评论 1 326
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 32,247评论 3 313
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 37,613评论 3 299
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 28,911评论 0 17
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 30,191评论 1 250
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 41,532评论 2 342
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 40,739评论 2 335

推荐阅读更多精彩内容