2021년에 아직도 Trac 을 사용하는 사람이 있을지 모르겠다. 하지만 프리랜서로 많은 프로젝트를 하는데 있어서 Trac 만큼 간단하면서도 필요한 기능이 다 있는 툴은 찾기가 힘들다. 프로젝트에 투입되면 Windows 10에 Trac 을 설치하고 프로젝트를 위한 여러가지 작업을 Trac 으로 하게 된다. Trac 을 이용하는 기능은 다음과 같다. Wiki Ticket Calendar Gant Calendar 문서도 작성하고 요청한 사항들을 정리하고 일정을 확인하는데, 그것도 로컬 컴퓨터에서 Python 으로 아주 가볍게 동작하는 툴을 본적이 없다. Jira 와 같은 협업툴이 많이 나왔지만, 프리랜서로서 자신만의 뭔가를 정리하려고할때 이만한 게 […]
Rate Limiting with NGINX and NGINX Plus
이 글은 다음의 내용을 대충 번역한 것입니다. Rate Limiting with NGINX and NGINX Plus 아주 유용한 것중에 하나지만 종종 잘못 이해하고 잘못 설정하게되는 NGINX 기능이 속도 제한(rate limiting) 이다. 이것은 주어진 특정한 시간동안 HTTP 요청양을 제한할 수 있도록 한다. 하나의 요청은 웹사이트의 홈페이지를 위한 GET 요청이나 로그인 폼에 POST 요청이다. 속도 제한은 보안 목적을 위해서 사용되어 질 수 있는데, 에를들어 부르트 포스 패스워드 추정 공격의 속도를 낮출 수 있다. 이것은 실제 사용자에 대해 들어오는 요청 비율을 일반적인 값으로 제한하고 (로깅을 […]
systemd unit 편집기 바꾸기
systemd 는 이제 리눅스 시스템의 뼈대가 되는 기본운영 방법이 되었다. 기존에는 System V Init 이였지만 RHEL 7, Ubuntu 16.04부터 기본 시스템운영 프로그램이 되었다. systemd 는 ‘ctl’ 로 끝나는 명령어들의 집합으로 제어가 가능하다. systemctl, journalctl, timedatectl, hostnamectl, loginctl 이 대표적이다. systemctl 의 경우에는 systemd unit 파일들에 대한 제어와 설정이 가능하다. systemd unit 파일은 기존의 Systemv V init Script 를 대체하는 것으로 일종의 시스템 데몬 프로그램들이라고 보면 된다. 시스템이 시작될때에 자동으로 시작되게 한다거나 종료하게 한다거나 하는것들을 가능하게 한다. unit 파일은 텍스트 파일이기 […]
Redmine 컴파일 설치
Redmine 컴파일 설치에 대해서 다룬다. 최신의 OS 를 가지고 하면 좋겠지만, CentOS 7 에서 설치를 진행 했다. Mariadb 설치 MySQL 도 가능하지만, MariaDB 를 선택했다. 컴파일 설치가 가능하지만 패키지 설치로 설치한다.
1 |
]# yum install mariadb-server mariadb-devel -y |
각종 의존성이 함께 설치가 된다. CentOS 7 에서 MariaDB 버전은 5.5 이다. 현재 최선 버전은 10.4 이며 이것을 설치하고자 한다면 MariaDB 홈페이지에 공식 리파지토리를 설정하고 yum 명령어로 간단하게 설치할 수 있다. my.cnf 파일을 다음과 같이 설정해 준다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
]# vim /etc/my.cnf [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 # Settings user and group are ignored when systemd is used. # If you need to run mysqld under a different user or group, # customize your systemd unit file for mariadb according to the # instructions in http://fedoraproject.org/wiki/Systemd character-set-server = utf8 collation-server = utf8_general_ci port = 3306 skip-name-resolve [mysqld_safe] log-error=/var/log/mariadb/mariadb.log pid-file=/var/run/mariadb/mariadb.pid # # include all files from the config directory # !includedir /etc/my.cnf.d [mysql] default-character-set = utf8 no-auto-rehash show-warnings prompt=\u@\h:\d\_\R:\m:\\s> pager="less -n -i -F -X -E" |
캐릭터 셋을(character-set) 설정하는 부분과 함께 mysql 콘솔에 대한 설정이 전부다. […]
Redmine 설치하기
Redmine 은 오픈소스 프로젝트 매니지먼트 프로그램이다. Ruby 로 제작되었기 때문에 설치 과정에서 Ruby 가 있어야 한다. 웹을 통해서 서비스를 하기 때문에 보통 웹서버와 연동을 하는 편이다. 환경 OS: CentOS 7 Arch: x86_64 Minimal Installation 상태 MariaDB 설치 MySQL 도 가능하지만, MariaDB 를 선택했다. 컴파일 설치가 가능하지만 패키지 설치로 설치한다.
1 |
]# yum install mariadb-server -y |
각종 의존성이 함께 설치가 된다. my.cnf 파일을 다음과 같이 설정해 준다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
]# vim /etc/my.cnf [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 # Settings user and group are ignored when systemd is used. # If you need to run mysqld under a different user or group, # customize your systemd unit file for mariadb according to the # instructions in http://fedoraproject.org/wiki/Systemd character-set-server = utf8 collation-server = utf8_general_ci port = 3306 skip-name-resolve [mysqld_safe] log-error=/var/log/mariadb/mariadb.log pid-file=/var/run/mariadb/mariadb.pid # # include all files from the config directory # !includedir /etc/my.cnf.d [mysql] default-character-set = utf8 no-auto-rehash show-warnings prompt=\u@\h:\d\_\R:\m:\\s> pager="less -n -i -F -X -E" |
다음과 같이 서버를 실행해 준다.
1 2 |
]# systemctl start mariadb.service ]# systemctl enable mariadb.service |
이제 기본적인 설정을 위해 mysql_secure_installation 을 실행해 준다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
]# mysql_secure_installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and you haven't set the root password yet, the password will be blank, so you should just press enter here. Enter current password for root (enter for none): <- 그냥 엔터 OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MariaDB root user without the proper authorisation. Set root password? [Y/n] Y New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success! By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] Y ... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] Y ... Success! By default, MariaDB comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] Y - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] Y ... Success! Cleaning up... All done! If you've completed all of the above steps, your MariaDB installation should now be secure. Thanks for using MariaDB! ]# |
root 패스워드를 설정하기 […]
Yum 패키지 충돌 발생시 쓸 수 있는 명령어
최근에 CentOS 8 에서 Kubernetes 를 테스트하던 중에 패키지 업데이트가 되지 않는 일이 발생 했다. 아직 Kubernetes 는 CentOS 8 배포판을 정식으로 지원하지 않아 CentOS 7 배포판의 패키지를 사용해야 하는 상황이다. 그런데, yum 명령어로 업데이트를 할려고 보니 오류가 발생 했다. 이럴 경우에 다음과 같은 명령어를 사용해서 의존성을 체크해 볼 수 있다.
1 2 3 4 5 6 7 8 9 10 11 12 |
# repoquery --requires --resolve kubelet-1.18 ethtool-2:4.8-10.el7.x86_64 iptables-0:1.4.21-34.el7.x86_64 util-linux-0:2.23.2-63.el7.x86_64 iptables-0:1.4.21-34.el7.i686 util-linux-0:2.23.2-63.el7.i686 conntrack-tools-0:1.4.4-7.el7.x86_64 iproute-0:4.11.0-25.el7_7.2.x86_64 ebtables-0:2.0.10-16.el7.x86_64 glibc-0:2.17-307.el7.1.i686 glibc-0:2.17-307.el7.1.x86_64 socat-0:1.7.3.2-2.el7.x86_64 |
위와같은 명령어를 이용하면 패키지 의존성에 대한 내용을 풀어서 볼 수 있다. 참고: kubeadm and kubelet 1.15 fail to install on centos 7 after patches released today#92242
Generic WebHook Trigger 설정
Jenkins 에서 Github 나 GitLab 와 연동하기 위해서 Generic WebHook Trigger 플러그인을 많이 사용한다. 검색을 해보면 사용법이 아주 많이 나오는데, 특정 브랜치(Branch) 에만 작동되게 하기 위해서 Execute Shell 를 활용하는 사례를 볼 수 있다. 하지만 Generic WebHook Trigger 플러그인 설정에서 그냥 특정 브랜치만 반응하도록 할 수 있다. 제일 먼저 Post content parameters 에서 Variable 에 “ref”, Expression 에는 “$.ref” 를 적어주고 JSONPath 를 선택해 준다. 이것은 Github나 GitLab 가 jenkins 를 호출할때에 JSON 포맷으로 관련 데이터를 넘겨주게 된다. JSON 포맷이기 […]
letsencrypt 인증서 발급/갱신
letencrypt 는 무료로 발급 받을 수 있는 도메인 인증서이다. 도메인 인증서는 서버와 클라이언트간에 HTTP 통신을 암호화하는데 필요한 것이다. 원래는 돈을 주고 구매해야 하지만 letsencrypt 는 무료로 사용할 수 있게 해준다. 대부분의 발급 절차를 서버의 CLI 를 통해서 이루어진다. 따라서 서버가 있어야 하며 터미널 접속이 가능해야 한다. 또, Python 을 필요로 한다. 인증서를 발급 받기위해서 프로그램을 사용하는데 이것이 Python 을 필요로 한다. certbot 설치 certbot 은 letsencrypt 인증서를 발급받기 위한 CLI 명령어 세트다. 다음과 같이 다운로드 할 수 있다.
1 2 3 |
]$ git clone https://github.com/letsencrypt/letsencrypt ]$ ls letsencrypt |
복제된 […]
VIM, Yaml 문법 적용
이 문서는 VIM, Yaml 문법 적용에 관한 것이다. YAML 은 각종 설정파일에서 자주 쓰인다. Kubernetes 에서는 manifest 파일로 쓰이고 있는데, VIM 을 이용해 Yaml 을 편집할때에 간단하게 사용할 수 있는 방법을 소개한다. 간단하게 .vimrc 파일에 다음과 같이 입력해주면 된다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
syntax on set nocompatible set hls set scs set visualbell set ignorecase set showmatch set fileencodings=utf-8 set termencoding=utf-8 set encoding=utf-8 " add yaml stuffs " au! BufNewFile,BufReadPost *.{yaml,yml} set filetype=yaml foldmethod=indent au! BufNewFile,BufReadPost *.{yaml,yml} set filetype=yaml autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab autoindent |
내용을 보면 금방 이해가 될 것이다.
GitLab 설치와 설정
GitLab 설치 하기. GitLab 은 무료로 사용가능한 git 저장소, ticket 시스템이다. github 의 오픈소스 버전으로 생각할 수 있지만 그것보다 많은 기능을 제공한다. 이 글에서는 gitlab 을 Ubuntu 20.04 LTS 에 설치와 설정에 대해서 알아보도록 하겠다. 준비 Gitlab 을 설치하기 전에 필요한 의존성 패키지들을 먼저 설치해 준다.
1 |
]$ sudo apt install -y ca-certificates curl |
메일을 사용할 경우에는 메일 서버를 설치해줘야 하지만 여기서는 제외한다. Gitlab 설치를 위한 저장소 추가 gitlab 홈페이지에서는 각 리눅스 배포판에 맞춰 스크립트를 제공한다. Ubuntu 20.04 를 위해 제공해주는 스크립트를 실행해 준다.
1 |
]$ sudo curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash |
Gitlab 설치 […]