이번 섹션에선 "Redmin을 위한 Apache2 구성" 입니다.
Apache2를 통해 하나의 더 큰 서버에서 Redmin을 포함한 여러 서비스를 실행할 수 있습니다. Apache2가 설치되어있지 않다면 아래 명령을 실행하여 설치하세요:
$ sudo apt install apache2 libapache2-mod-passenger
Apache2 서비스를 활성화하고 시작합니다.
$ sudo systemctl enable apache2
$ sudo systemctl start apache2
사이트의 IP 주소를 사용하여 브라우저에서 사이트를 가리킵니다. https 메서드 대신 http 메서드를 사용합니다. 기본 Ubuntu Apache2 페이지가 표시됩니다.
우리는 Apache2와 nginx에서 사용하는 기본 www-data 계정이 아닌 특정 사용자 계정으로 서비스를 실행하도록 설정합니다. 웹사이트 관리자가 동일한 서버에서 실행되는 다른 서비스에 영향을 미치지 않고 명령줄을 통해 사이트를 관리해야 할 경우 해당 계정으로 로그인할 수 있도록 이를 수행합니다.
Redmin을 위해 사용자를 추가하는 것부터 시작해야 합니다:
$ sudo adduser redmine
Adding user `redmine’ …
Adding new group `redmine’ (1002) …
Adding new user `redmine’ (1001) with group `redmine’ …
Creating home directory `/home/redmine’ …
Copying files from `/etc/skel’ …
New password: '<Enter your redmine account password here>'
Retype new password: '<Re-enter your redmine account password here>'
passwd: password updated successfully
Changing the user information for redmine
Enter the new value, or press ENTER for the default
Full Name []: 'Redmine'
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] 'Y'
이전과 마찬가지로 Redmin 계정을 위한 고유한 공개/개인 키 쌍을 생성합니다.
$ sudo -u redmine bash
$ cd
$ mkdir .ssh
$ chmod 700 .ssh
$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/redmine/.ssh/id_rsa): 'redmine_keys'
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in redmine_keys
Your public key has been saved in redmine_keys.pub
The key fingerprint is:
SHA256:4CXssSigjMtz6ZwEyUdHPCRy5Xpn31Rk611zsDx6zR8 redmine@redmine
The key’s randomart image is:
+—[RSA 3072]—-+
| . o++ o. |
| o ++ o..o |
|. . o* . o+.o|
|=.o o+ * o..++|
|o=.o..+oS ….Eo|
|..o.o o . o . o|
|.o + . . .|
| * . |
| + |
+—-[SHA256]—–+
$ mv redmine_keys redmine_keys.pem
$ tar -cvzf ~/redmine_keys.tar.gz redmine_keys.pem redmine_keys.pub
$ mv redmine_keys.pub .ssh/authorized_keys
$ chmod 600 .ssh/authorized_keys
$ rm redmine_keys.pem
이전과 마찬가지로, 레드마인 계정에 직접 로그인할 수 있도록 redmine_keys.tar.gz를 로컬 시스템에 복사해야 합니다.
사용자 "redmine"으로 라이브 사이트를 위한 디렉터리를 생성한 후, 나중에 Apache 설정을 검증하는 데 사용할 테스트 파일을 삽입하세요.
$ sudo -u redmine mkdir -p /home/redmine/live/test
$ sudo -u redmine bash -c 'echo "Woo-Hoo ! It works !" >/home/redmine/live/test/index.html'
그다음, root 사용자로 `/etc/apache2/envvars` 파일을 수정하여 Apache2의 사용자(user)와 그룹(group)을 `www-data`에서 `redmine`으로 변경하세요.
$ sudo vi /etc/apache2/envvars
식별해야 할 줄은 다음과 같이 보입니다:
export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data
이 두 줄을 찾아서 다음과 같이 수정하세요:
export APACHE_RUN_USER=redmine
export APACHE_RUN_GROUP=redmine
passenger 모듈이 활성화되어 있는지 확인하세요. 또한, 개발 중 사이트를 비밀번호로 보호할 수 있도록 일반적으로 auth_basic 모듈을 설치합니다.
$ sudo a2enmod passenger auth_basic
이제 사이트 설정 파일을 `/etc/apache2/sites-available/<my-site-domain>.conf`에 생성하세요. 여기서 `<my-site-domain>`은 사이트의 도메인 이름(예: `redmine.inesonic.com`)으로 대체해야 합니다.
$ sudo vi /etc/apache2/sites-available/<my-site-domain>.conf
파일에는 다음 내용을 포함해야 합니다. `<my-site-domain>`을 사이트의 올바른 도메인으로 변경하고, `<website-administer-email-address>`를 웹사이트 관리자에게 연락할 수 있는 이메일 주소로 변경하세요.
<VirtualHost *:80>
ServerName '<my-site-domain>'
ServerAlias www.'<my-site-domain>'
DocumentRoot /home/redmine/live/test
ServerAdmin '<website-administer-email-address>'
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<Directory “/home/redmine/live/test”>
Allow from all
Require all granted
</Directory>
이제 사이트를 활성화하고, 기본 사이트를 비활성화한 후, Apache2 설정이 유효한지 확인하세요.
$ sudo a2ensite <my-site-domain>
Enabling site <my-site-domain>.
To activate the new configuration, you need to run:
systemctl reload apache2
$ sudo a2dissite 000-default
Site 000-default disabled.
To Activate the new configuration, you need to run:
systemctl reload apache2
$ sudo apache2ctl -T
AH00558: apache2: Could not reliably determine the server`s fully qualified domain name, using xxx.xxx.xxx.xxx. Set the 'ServerName' directive globally to suppress this message
httpd (pid 1002) already running
Syntax OK
구성 구문이 올바르다는 것을 나타내는 'Syntax OK' 줄을 확인하세요.
Apache2 서버를 다시 시작하세요. 위에서 Apache2의 사용자와 그룹을 변경했기 때문에 재시작이 필요합니다.
$ sudo systemctl restart apache2
이제 브라우저에서 사이트를 열어 테스트 페이지를 확인할 수 있어야 합니다.
다음 섹션에는 "Redmin을 위한 MySQL 설정" 입니다.
'Redmine' 카테고리의 다른 글
Redmine에서 이메일 알림 활성화 설정 방법 (0) | 2025.03.19 |
---|---|
Ubuntu 22.04.03에서 Redmine 5.0 구성하기 [ 5 ] - 최종 구성확인 (0) | 2025.03.19 |
Ubuntu 22.04.03에서 Redmine 5.0 구성하기 [ 4 ] - Redmine 설치 (0) | 2025.03.19 |
Ubuntu 22.04.03에서 Redmine 5.0 구성하기 [ 3 ] - MySQL 설정 (0) | 2025.03.19 |
Ubuntu 22.04.03에서 Redmine 5.0 구성하기 [ 1 ] (0) | 2025.03.19 |