вторник, 18 октября 2022 г.

Установка Confluence на Debian 11 + MSSQL (Windows 2019)

SQL

Установка Windows и SQL 

Эти действия проводятся в лучших традициях и настройках по мануалам Best Practice. 
Server Collation для MS SQL по требованиям Atlassian - Latin1_General_CI_AI.
Не забываем поставить SSMS.

Создаём пользователя MSSQL

USE [master]
GO

CREATE LOGIN [atl-confluence] WITH PASSWORD=N'очень сложный пароль', DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO

Создаём БД

CREATE DATABASE confluence;
go
ALTER DATABASE confluence COLLATE SQL_Latin1_General_CP1_CS_AS
ALTER DATABASE confluence SET READ_COMMITTED_SNAPSHOT ON  WITH ROLLBACK IMMEDIATE;
GO

Даём права пользователю на БД

USE [confluence]
GO
CREATE USER [atl-confluence] FOR LOGIN [atl-confluence] WITH DEFAULT_SCHEMA=[dbo]
GO
ALTER ROLE db_owner ADD MEMBER [atl-confluence] ; 
GO  


DEBIAN

apt install openjdk-11-jre

mkdir -p /opt/atlassian/agent /opt/atlassian/confluence /opt/atlassian/confluence-data copy atlassian-agent.jar to /opt/atlassian/agent/atlassian-agent.jar
add into: opt/atlassian/confluence/confluence/WEB-INF/classes/confluence-init.properties
string:   confluence.home=/opt/atlassian/confluence-data
add into: /opt/atlassian/confluence.7.13/bin/start-confluence.sh
string:   export JAVA_OPTS="-javaagent:/opt/atlassian/agent/atlassian-agent.jar ${JAVA_OPTS}"

java -jar atlassian-agent.jar -m 123@123.com  -n my_name -o MY_ORG -p conf -s 0000-1111-2222-3333



cat > /etc/systemd/system/confluence.service <<EOF
[Unit]
Description=JIRA Service
After=network.target iptables.service firewalld.service firewalld.service httpd.service

[Service]
Type=forking
User=jira
ExecStart=/opt/atlassian/confluence/bin/start-confluence.sh
ExecStop=/opt/atlassian/confluence/bin/stop-confluence.sh
ExecReload=/opt/atlassian/confluence/bin/start-confluence.sh | sleep 60 | /opt/atlassian/confluence/bin/stop-confluence.sh

[Install]
WantedBy=multi-user.target
EOF
--------------------------------------------------------------------------------------------
systemctl daemon-reload
systemctl enable confluence
systemctl status confluence



apt-get install nginx
/etc/nginx/sites-available/confluence.phoenix-dnr.ru.conf
server {

    server_name confluence.phoenix-dnr.ru confluence;

    access_log /var/log/nginx/confluence.phoenix-dnr.ru-access.log;
    error_log /var/log/nginx/confluence.phoenix-dnr.ru-error.log;

    root /var/www/html;

    location / {
        proxy_paddss http://localhost:8080;
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}