2018-8-29安装Jitamin过程实录
欢迎走进zozo的学习之旅。
简介
在考虑用项目管理软件来提高团队协作的效率,需求项目管理及日常管理,当然有项目文件管理,文档协作那就更加理想,部门其他人有在用,但是这个是和 Visual studio 结合在 Microsoft平台上用的,不是很感冒,所以找了一下开源的轻便型的项目管理软件,看了下知乎上的推荐:
项目名称:开源项目管理系统 Jitami 项目简介:Jitamin
、是一款免费、开源,使用PHP语言开发的项目管理系统。Jitamin灵感来自于Vitamin,并结合了Just In Time(准时)和敏的拼音min,意指效率和敏捷是项目管理的维他命。项目地址:jitamin/jitamin - 码云作者:码云 Gitee
链接: 来源:知乎 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
官网有个演示版本,看板结合日历和甘特图,可以导入project的项目,所以打算动手在部门的centos7上搭一个,安装参考:
很不幸,php+mysql不太熟,最后网站没有运行起来,转投了kanboard,kanboard直接提供 docker 版本,运行起来就比较方便,但还需要加一些插件,等摸熟了再上那个教程. 下面就是入坑记录
安装 nginx + php + mysql
参考
-
安装Nginx
sudo yum install epel-releasesudo yum install nginxsudo service nginx start
验证
-
安装MySQL(MariaDB)
sudo yum install mariadb-server mariadbsudo systemctl start mariadbsudo systemctl enable mariadb
添加 mysql 默认端口至 firewall
sudo firewall-cmd --zone=public --add-port=3306/tcp --permanentsudo firewall-cmd --reload
设置 root 密码
mysqladmin -u root password "new_password";
登录
[root@host]# mysql -u root -p Enter password:*******
建立jitamin数据库
mysql> create database jitamin;
MariaDB [(none)]> show databases;+--------------------+| Database |+--------------------+| information_schema || jitamin || mysql || performance_schema || test |+--------------------+5 rows in set (0.00 sec)
-
安装PHP
sudo yum install php php-mysql php-fpm sudo vim /etc/php-fpm.d/www.conf`
修改
cgi.fix_pathinfo=0
配置文件www.conf
sudo vim /etc/php-fpm.d/www.conf
修改内容
listen = /var/run/php-fpm/php-fpm.sock user = nginxgroup = nginx
但是因为在后面 对jitamin 用composer install 依赖关系的时候出现了php版本太低的问题,这里补充下php升级的过程:
php版本问题 错误信息
php >=5.6.0 but your PHP version (5.4.16) 升级
vim composer.json //指定 版本 php -v //查看当前版本 PHP 5.4.16 (cli) (built: Apr 12 2018 19:02:01)解决思路
重新安装高版本php作者:一指弹风
链接: 來源:简书 简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。yum list installed | grep php yum remove php.x86_64 php-cli.x86_64 php-common.x86_64 php-gd.x86_64 php-ldap.x86_64 php-mbstring.x86_64 php-mcrypt.x86_64 php-mysql.x86_64 php-pdo.x86_64 yum list installed | grep php sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm sudo 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 list installed | grep php php56w.x86_64 5.6.37-1.w7 @webtatic php56w-cli.x86_64 5.6.37-1.w7 @webtatic php56w-common.x86_64 5.6.37-1.w7 @webtatic php56w-gd.x86_64 5.6.37-1.w7 @webtatic php56w-ldap.x86_64 5.6.37-1.w7 @webtatic php56w-mbstring.x86_64 5.6.37-1.w7 @webtatic php56w-mcrypt.x86_64 5.6.37-1.w7 @webtatic php56w-mysql.x86_64 5.6.37-1.w7 @webtatic php56w-pdo.x86_64 5.6.37-1.w7 @webtatic yum install php56w-fpm
重新安装后出现 权限错误,错误信息如下:
2002#0: *6 connect() to unix:/var/run/php-fpm/php-fpm.sock failed (13:
Permission denied) while connecting to upstream, client: 10.1.6.2, server: 10.16.10.166, request: "GET /info.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php- fpm.sock:", host: "10.16.10.166"解决方案
参考sudo vim /etc/php-fpm.d/www.conf
listen.owner = nginxlisten.group = nginxlisten.mode = 0666user = nginxgroup = nginx
-
配置Nginx来处理PHP页面
vim /etc/nginx/conf.d/default.conf
修改
server { listen 80; server_name 10.16.10.166; # note that these lines are originally from the "location /" block root /var/www/html; index index.php index.html index.htm; location / { try_files $uri $uri/ =404; } error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root /var/www/html; } location ~ \.php$ { try_files $uri =404; fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }}
重新启动服务
systemctl restart php-fpm.service systemctl enable nginx.service systemctl enable php-fpm.service
验证
安装composer
下载composer.phar
curl -sS https://getcomposer.org/installer | php
可执行
mv composer.phar /usr/local/bin/composer
安装Jitamin
下载源文件
yum install gitcd /var/www/htmlsudo git clone https://github.com/jitamin/jitamin.git jitamin
配置 config file 创建 database 设置
cd jitamincp .env.example .envsudo vim .env //修改数据库相关配置
修改为
DB_CONNECTION=mysqlDB_HOST=127.0.0.1DB_PORT=3306DB_DATABASE=jitaminDB_USERNAME=rootDB_PASSWORD=xxxxx //root密码vim config/config.php
修改为
'mysql' => [ 'driver' => 'mysql', 'host' => env('DB_HOST', 'localhost'), 'database' => env('DB_DATABASE', 'jitamin'), 'username' => env('DB_USERNAME', 'root'), 'password' => env('DB_PASSWORD', 'xxxxx'),//root 密码 'port' => env('DB_PORT', '3306'), 'charset' => 'utf8', ],
安装依赖包(出现了php版本问题如前描述)
composer install -o --no-dev //
又出现权限问题
[RuntimeException]
/var/www/html/jitamin/vendor does not exist and could not be created.
解决思路
chmod -R 777 /var/www
成功
> php -r "file_exists('.env') || copy('.env.example', '.env');"Loading composer repositories with package informationInstalling dependencies from lock filePackage operations: 27 installs, 0 updates, 0 removals - Installing christian-riesen/base32 (1.3.1): Downloading (100%) - Installing christian-riesen/otp (1.4.3): Downloading (100%) - Installing eluceo/ical (0.10.1): Downloading (100%) - Installing erusev/parsedown (1.6.0): Downloading (100%) - Installing gregwar/captcha (v1.1.1): Downloading (100%) - Installing jitamin/json-rpc (v1.2.2): Downloading (100%) - Installing jitamin/picodb (v1.0.15): Downloading (100%) - Installing jitamin/picofeed (v0.1.25): Downloading (100%) - Installing jitamin/simple-logger (v1.0.2): Downloading (100%) - Installing jitamin/simple-queue (v1.0.1): Downloading (100%) - Installing jitamin/simple-validator (v1.0.2): Downloading (100%) - Installing symfony/polyfill-mbstring (v1.9.0): Downloading (100%) - Installing symfony/translation (v3.2.14): Downloading (100%) - Installing nesbot/carbon (1.33.0): Downloading (100%) - Installing paragonie/random_compat (v2.0.11): Downloading (100%) - Installing pimple/pimple (v3.0.2): Downloading (100%) - Installing symfony/yaml (v2.8.7): Downloading (100%) - Installing psr/log (1.0.2): Downloading (100%) - Installing symfony/debug (v3.4.14): Downloading (100%) - Installing symfony/console (v3.4.14): Downloading (100%) - Installing symfony/polyfill-ctype (v1.9.0): Downloading (100%) - Installing symfony/filesystem (v3.4.14): Downloading (100%) - Installing symfony/config (v3.4.14): Downloading (100%) - Installing robmorgan/phinx (v0.6.6): Downloading (100%) - Installing swiftmailer/swiftmailer (v5.4.5): Downloading (100%) - Installing symfony/event-dispatcher (v3.4.14): Downloading (100%) - Installing vlucas/phpdotenv (v2.5.1): Downloading (100%) Generating optimized autoload files
做数据迁移
vendor/bin/phinx migratevendor/bin/phinx seed:run
成功后,登录数据库 jitamin 查看 数据表格
mysql -u root -pMariaDB [(none)]> show databases;+--------------------+| Database |+--------------------+| information_schema || jitamin || mysql || performance_schema || test |+--------------------+5 rows in set (0.00 sec)MariaDB [(none)]> use jitaminReading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changedMariaDB [jitamin]> show tables;+--------------------------------+| Tables_in_jitamin |+--------------------------------+| action_has_params || actions || column_has_move_restrictions || column_has_restrictions || columns || comments || custom_filters || group_has_users || groups || last_logins || links || migrations || password_reset || plugin_schema_versions || project_activities || project_daily_column_stats || project_daily_stats || project_has_categories || project_has_files || project_has_groups || project_has_metadata || project_has_notification_types || project_has_roles || project_has_stars || project_has_users || project_role_has_restrictions || projects || remember_me || schema_version || settings || subtask_time_tracking || subtasks || swimlanes || tags || task_has_external_links || task_has_files || task_has_links || task_has_metadata || task_has_tags || tasks || transitions || user_has_metadata || user_has_notification_types || user_has_notifications || user_has_unread_notifications || users |+--------------------------------+46 rows in set (0.00 sec)
设置文件夹权限
$ chmod -R 0777 bootstrap/cache$ chmod -R 0777 storage$ php artisan config:cacheConfiguration cached successfully!$ php artisan route:cacheRoutes cached successfully!
此时登录 网页查看,失败显示如下:
看到了 issue里面有这样的描述:
现在我们已经开始运行Web服务器,现在是安装MariaDB的时候了,这是一个MySQL插件替换。 MariaDB是MySQL关系数据库管理系统的社区开发的分支。基本上,它将组织并提供对我们的网站可以存储信息的数据库的访问。