1、安装mysql,并创建walle库
2、安装ansible
1
|
yum -y
install
ansible
|
3、安装php5.6及相关组件
1
2
3
4
5
|
rpm -Uvh http:
//mirror
.webtatic.com
/yum/el6/latest
.rpm
yum
install
php56w.x86_64 php56w-cli.x86_64 php56w-common.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mcrypt.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64
yum
install
php56w-fpm
|
4、创建walle目录路径
1
2
|
mkdir
-p
/data/www/walle-web
cd
/data/www/walle-web
|
5、git clone walle代码到本地服务器
1
|
git clone https:
//github
.com
/meolu/walle-web
.git
|
6、安装composer
1
2
|
curl -sS https:
//getcomposer
.org
/installer
| php
mv
composer.phar
/usr/local/bin/composer
|
7.1、安装vendor
1
2
|
cd
walle-web
composer
install
--prefer-dist --no-dev --optimize-autoloader -vvvv
|
7.2、更改walle 数据库配置
vim /data/www/walle-web/walle-web/config/local.php
1
2
3
4
5
6
7
|
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'
] :
'root'
,
'password'
=> isset(
$_ENV
[
'WALLE_DB_PASS'
]) ?
$_ENV
[
'WALLE_DB_PASS'
] :
'123456'
,
],
|
8、初始化项目
1
2
|
cd
walle-web
.
/yii
walle
/setup
# 需要你的yes
|
9、安装nginx并配置
1
2
3
4
|
yum -y
install
nginx
cd
/etc/nginx/conf
.d/
vim default.conf
/etc/init
.d
/nginx
start
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
server {
listen 80;
server_name localhost;
# 改你的host
root
/data/www/walle-web/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;
}
}
|
10、启动php
1
|
/etc/init
.d
/php-fpm
start
|
11、修改mail服务器配置
vim /data/www/walle-web/walle-web/config/local.php
1
2
3
4
5
6
7
8
9
10
11
12
13
|
'mail'
=> [
'transport'
=> [
'host'
=> isset(
$_ENV
[
'WALLE_MAIL_HOST'
]) ?
$_ENV
[
'WALLE_MAIL_HOST'
] :
'smtp.163.com'
, # smtp 发件地址
'username'
=> isset(
$_ENV
[
'WALLE_MAIL_USER'
]) ?
$_ENV
[
'WALLE_MAIL_USER'
] :
'zengxxxx@163.com'
, # smtp 发件用户名
'password'
=> isset(
$_ENV
[
'WALLE_MAIL_PASS'
]) ?
$_ENV
[
'WALLE_MAIL_PASS'
] :
'xxxxx'
, # smtp 发件人的密码
'port'
=> isset(
$_ENV
[
'WALLE_MAIL_PORT'
]) ?
$_ENV
[
'WALLE_MAIL_PORT'
] : 465, # smtp 端口
'encryption'
=> isset(
$_ENV
[
'WALLE_MAIL_ENCRYPTION'
]) ?
$_ENV
[
'WALLE_MAIL_ENCRYPTION'
] :
'ssl'
, # smtp 协议
],
'messageConfig'
=> [
'charset'
=>
'UTF-8'
,
'from'
=> [
(isset(
$_ENV
[
'WALLE_MAIL_EMAIL'
]) ?
$_ENV
[
'WALLE_MAIL_EMAIL'
] :
'zengchengpeng2009@163.com'
) => (isset(
$_ENV
[
'WALLE_MAIL_NAME'
]) ?
$_ENV
[
'WALLE_MAIL_NAME'
] :
'花满树出品'
),
], # smtp 发件用户名(须与mail.transport.username一致)
|
12、初始登录账号密码
admin/admin
本文转自 曾哥最爱 51CTO博客,原文链接:http://blog.51cto.com/zengestudy/1958105,如需转载请自行联系原作者