-
Notifications
You must be signed in to change notification settings - Fork 369
Ubuntu Installation(Nginx)
ubuntu 16.04,php7.0,root用户为例
更新软件源列表地址
apt-get update
安装Nginx:
apt-get install -y nginx
安装php以及相关组件。php建议安装7.0,>=5.5.9其他版本也可以
apt-get install -y php7.0 php-fpm php-mbstring php-gd php-mcrypt php-curl php-dom php-zip php-ldap php-mongodb
如果安装php-ldap不成功,可将php-ldap改成php5-ldap或php7.0-ldap
安装mongodb(>=2.6.10):
apt-get install mongodb
启动mongodb:
service mongodb start
创建数据库和用户:
mongo actionviewdb --eval "db.createUser({ user: 'actionview', pwd: 'secret', roles: [ { role: 'readWrite', db: 'actionviewdb' } ] });"
下载程序:
cd /var/www/
git clone https://github.com/lxerxa/actionview.git actionview
安装依赖:
cd actionview
cp composer.phar /usr/local/bin/composer (如果composer已安装请忽略此步)
composer install --no-dev
执行配置脚本:
sh config.sh
修改数据库连接参数,在拷贝后的.env文件中,示例如下:
cp .env.example .env
DB_HOST=127.0.0.1
DB_DATABASE=actionviewdb
DB_USERNAME=actionview
DB_PASSWORD=secret
执行db数据初始化脚本:
mongorestore -h 127.0.0.1 -u actionview -p secret -d actionviewdb --drop ./dbdata
配置nginx(/etc/nginx/sites-enabled/default):
server {
listen 80;
listen [::]:80;
root /var/www/actionview/public;
server_name localhost;
client_max_body_size 100M;
location ^~ /actionview/api {
index index.html index.htm index.php;
try_files $uri $uri/ /index.php$is_args$args;
}
location ^~ /actionview {
add_header Cache-Control 'no-cache, must-revalidate, max-age=0';
alias /var/www/actionview/public/;
index index.html index.htm index.php;
try_files $uri $uri/ /index.html$is_args$args;
}
location / {
add_header Cache-Control 'no-cache, must-revalidate, max-age=0';
index index.html index.htm index.php;
}
location ~ /\.ht {
deny all;
}
location ~ \.php {
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
try_files $uri =404;
}
}
重新启动nginx和php-fpm:
service php7.0-fpm stop
service php7.0-fpm start
service nginx stop
service nginx start
安装完成,祝好运!
访问系统: http://xxx.xxx.xxx.xxx/actionview, 管理员登录: user: [email protected], password: actionview
先不要着急,再做最后一步配置,以便能发mail通知、为燃尽图展示提供数据、自动同步LDAP用户数据。
crontab里添加:
* * * * * php /var/www/actionview/artisan schedule:run >> /dev/null 2>&1
重新启动cron服务:
service cron restart