I released the submission management system for magazines! People manage submission versions efficiently by using this system.
This development started about six months ago. There were many requirements changes, but I could release it at last.
I had many excellent experiences through this development. I write down that here as usual!
Project Overview
- Developed with Laravel
- There are five types of users
- Deploy to AWS
- Need some batch job process
- In charge of all phases except for the requirement phase
This system's subject is efficiently managing submission versions for magazines. To manage the versions, clients named draft files following the rule and stored them in Google Drive. But it is hard. Clients wanted to reduce costs to operate.
This system 5 granted users. I had to divide the process as easy as possible to understand. That was one of the core parts of this development.
First, I didn't come up with good idea to realize that. But I solved this issue by following this article.
Also, I had to develop some batch jobs and deploy them to AWS.
These ware very challenging development and made me grow a lot!
Deploy to AWS
I often use a web hosting service or VPS to deploy, but this time is not. It's AWS.
I have wanted to deploy to AWS for a long time because I got a certificate as AWS Solution Architect. I wanted to practice what I had learned.
Through deployment to AWS, I knew again it was utterly different to learn and practice. I have learned more difficult things a lot for AWS, but I didn't deploy smoothly.
Mainly, I was made in trouble with Network Service. For example, what should I divide the subnet mask? What are the Network ACL and Route Timetable? I seemed to need to learn again...
And this system needed a minimum size architecture in AWS. It means I used only EC2, RDS, and S3. I wanted to experience more AWS services.
To use more kinds of AWS services, I want to keep learning it!
Permission error caused by batch process
I was in trouble with a permission error caused by the batch process starting at midnight.
The System output the log daily. That process created a log file as a cron user so that the apache user didn't have writing permission. A permission error occurred when the apache process tried to write the log file.
First, I modified the permission for that.
$ ls -ltr
-rw-rw-r-- 1 hoge-user hoge-user 4238238 6月 23 20:32 laravel-2021-03-15.log
$ getent group hoge-user
hoge-user:x:1001:apache
But that does not work well... probably, caused by Sticky Bit or Subgroup. I gave up that way and changed the output log web and batch.
'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
'days' => 14,
'permission' => 0664,
],
// 追加
'batch' => [
'driver' => 'daily',
'path' => storage_path('logs/batch.log'),
'level' => 'debug',
'days' => 14,
'permission' => 0664,
],
class hogeCommand extends Command
{
・・・
public function __construct()
{
parent::__construct();
// set output way for log
Log::setDefaultDriver('batch');
}
・・・
That worked well. I was relieved.
Thank you for reading!
Thinking of the past, this system is 5th release for my work, but I never run out of things to study.
Many freelance engineers worry about not getting time to learn, but it doesn't apply to me.
Working is the most important learning for me. How lucky am I!
I will keep doing my best. Thank you!