nikoo 发表于 2018-1-12 19:27:59

walle代码发布系统配置

# 配置remi源walle依赖5.4以上的版本php才能运行。  
# cat /etc/yum.repos.d/remi.repo
  

  
name=Remi’s RPM repository for Enterprise Linux 7 – $basearch
  
mirrorlist=http://rpms.remirepo.net/enterprise/6/remi/mirror
  
enabled=1
  
gpgcheck=0
  

  
name=Remi’s PHP 5.6 RPM repository for Enterprise Linux 7 – $basearch
  
mirrorlist=http://rpms.remirepo.net/enterprise/6/php56/mirror
  
enabled=1
  
gpgcheck=0
  

  
# 创建用户以便后面创建nginx用户的密钥
  
# useradd nginx
  

  
# 安装软件包
  
# yum -y install nginx php-fpm php-mysql php-mbstringmariadb-server composer
  

  
# 修改php-fpm配置文件
  
# sed -i 's/user = apache/user = nginx/' /etc/php-fpm.d/www.conf
  
# sed -i 's/group = apache/group = nginx/' /etc/php-fpm.d/www.conf
  

  
# 配置mysql
  
# service mysqld start
  
# mysql -e 'CREATE DATABASE walle'

  
# mysql -e "GRANT ALL ON walle.* TO walle@'localhost'>  

  
# 创建网页文件目录
  
# mkdir /data/www -pv
  

  
# 下载walle项目源代码
  
# cd /data/www/
  
# git clone https://github.com/meolu/walle-web.git
  

  
# 修改项目文件的属主和属组,
  
# chown -R nginx.nginx walle-web/
  

  
# 设置mysql链接。修改项目目录下的config/local.php中的第12行和第13行
  
# cd walle-web
  
# cat config/local.php
  
...
  
'username'=> isset($_ENV['WALLE_DB_USER']) ? $_ENV['WALLE_DB_USER'] : 'walle',
  
'password'=> isset($_ENV['WALLE_DB_PASS']) ? $_ENV['WALLE_DB_PASS'] : 'wallepass',
  
...
  

  
# 安装vendor
  
$ composer install --prefer-dist --no-dev --optimize-autoloader -vvvv
  

  
# 将bower-asset目录改名
  
# cd vendor/
  
# cp -a bower-asset/ bower
  

  
# 初始化walle
  
# ./yii migrate/up
  
# 或者
  
# ./yii walle/setup    # 需要你的yes
  

  

  
# 为nginx提供以下配置,确保/etc/nginx/conf.d/walle.conf配置文件中存在以下内容
  
server {
  listen 8080;
  server_namewalle.evescn.com; # 改你的host
  root/data/www/walle-web/web; # 根目录为web
  index index.php index.html;
  

  # 建议放内网
  # 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_paramSCRIPT_FILENAME$document_root$fastcgi_script_name;
  include      fastcgi_params;
  }
  
}
  

  
# 启动nginx
  
# systemctl start nginx
  
# systemctl enable nginx
  

  
# 启动php-fpm
  
# systemctl start php-fpm
  
# systemctl enable php-fpm  
页: [1]
查看完整版本: walle代码发布系统配置