[LINUX] Install Pleasant on Ubuntu 20.04 (.NetCore3.1 / PostgreSQL version)

I wanted to install .NET Core 3.1 version of Pleasant on Ubuntu, I tried it because there was only the installation method of RHEL / CentOS on the official page.

Install Pleasanter with PostgreSQL on RHEL8 / CentOS8 https://pleasanter.net/fs/publishes/1490231/edit

Install .NET Core 3.1

$ wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
$ sudo dpkg -i packages-microsoft-prod.deb

$ sudo apt update
$ sudo apt install -y apt-transport-https
$ sudo apt update
$ sudo apt install -y dotnet-sdk-3.1

$ sudo apt install -y libgdiplus

Install PostgreSQL 12

$ curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
$ sudo apt-add-repository 'deb http://apt.postgresql.org/pub/repos/apt focal-pgdg main'

$ sudo vi /etc/apt/sources.list

deb http://apt.postgresql.org/pub/repos/apt focal-pgdg main
↓
deb [arch=amd64] http://apt.postgresql.org/pub/repos/apt focal-pgdg main

$ sudo apt update
$ sudo apt install postgresql-12 pgadmin4 postgresql-contrib

#Succeeded. You can start the database server as follows:
# 
#     pg_ctlcluster 12 main start
# 
# Ver Cluster Port Status Owner    Data directory              Log file
# 12  main    5432 down   postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log

Log output settings

Set the following:

$ sudo vi /etc/postgresql/12/main/postgresql.conf

log_destination = 'stderr'
logging_collector = on
log_line_prefix = '[%t]%u %d %p[%l]'

User settings & DB creation

After setting the password, start PostgreSQL

$ sudo passwd postgres

$ su - postgres
$ psql -U postgres

postgres=# alter role postgres with password 'password';

#DB creation
postgres=# create database "Implem.Pleasanter";

Full-text search module (pg_trgm) installed

postgres=# \c "Implem.Pleasanter";
Implem.Pleasanter=# CREATE EXTENSION pg_trgm;

Introduction of Pleasanter

Download and unzip Pleasanter

$ unzip Pleasanter.NetCore_1.1.5.1.zip

DB configuration

Set pleasanter / Implem.Pleasanter / App_Data / Parameters / Rds.json as follows.

{
       "Dbms": "PostgreSQL",
       "Provider": "Local",
       "TimeZoneInfo": "Tokyo Standard Time",
       "SaConnectionString":"Server=localhost;Port=5432;Database=postgres;UID=postgres;PWD=<Password set>",
       "OwnerConnectionString":"Server=localhost;Port=5432;Database=#ServiceName#;UID=#ServiceName#_Owner;PWD=SetAdminsPWD",
       "UserConnectionString":"Server=localhost;Port=5432;Database=#ServiceName#;UID=#ServiceName#_User;PWD=SetUsersPWD",
       "SqlCommandTimeOut": 600,
       "MinimumTime": 3,
       "DeadlockRetryCount": 4,
       "DeadlockRetryInterval": 1000
}

Go to the Implem.CodeDefiner folder and run CodeDefiner.

$ cd pleasanter/Implem.CodeDefiner
$ dotnet Implem.CodeDefiner.NetCore.dll _rds

Execute Pleasnter with the following command to check the startup.

$ cd ../Implem.Pleasanter
$ dotnet Implem.Pleasanter.NetCore.dll

Go to "http: // localhost: 5000 /" in another terminal and check that you get a normal response.

$ curl -v http://localhost:5000/

* About to connect() to localhost port 5000 (#0)
*   Trying ::1...
* Connected to localhost (::1) port 5000 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.29.0
> Host: localhost:5000
> Accept: */*
>
< HTTP/1.1 302 Found
< Date: Mon, 25 May 2020 15:13:08 GMT
< Server: Kestrel
< Content-Length: 0
< Location: http://localhost:5000/users/login?ReturnUrl=%2F
Ctrl when confirmed+Exit with C.

Scripting for Pleasanter service

$ sudo vi /etc/systemd/system/pleasanter.service

[Unit]
Description = Pleasanter
Documentation =
Wants=network.target
After=network.target

[Service]
ExecStart = /usr/bin/dotnet Implem.Pleasanter.NetCore.dll
WorkingDirectory = /home/hogehoge/pleasanter/Implem.Pleasanter
Restart = always
RestartSec = 10
KillSignal=SIGINT
SyslogIdentifier=dotnet-pleasanter
User = root
Group = root
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false

[Install]
WantedBy = multi-user.target

Register / start as a service

$ sudo systemctl daemon-reload
$ sudo systemctl enable pleasanter
$ sudo systemctl start pleasanter

Install Nginx (Web server)

$ sudo apt install nginx-extras
$ sudo systemctl start nginx
$ sudo systemctl enable nginx
$sudo addgroup username www-data

Reverse proxy settings

Create /etc/nginx/conf.d/pleasanter.conf with the following contents.

server {
    listen  80;
    server_name   192.168.0.200;
    location / {
       proxy_pass         http://localhost:5000;
       proxy_http_version 1.1;
       proxy_set_header   Upgrade $http_upgrade;
       proxy_set_header   Connection keep-alive;
       proxy_set_header   Host $host;
       proxy_cache_bypass $http_upgrade;
       proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header   X-Forwarded-Proto $scheme;
    }
}

$ sudo systemctl restart nginx

If you can do it so far, access the following. http://192.168.0.200/

reference

Install Pleasanter with PostgreSQL on RHEL8 / CentOS8 https://pleasanter.net/fs/publishes/1490231/edit

Install .NET Core SDK 3.1 on Ubuntu 20.04 https://qiita.com/tabizou/items/d9af326ede9d35d03c68

After installing Posgtgres12 on Ubuntu 20.04, try accessing with C # + Npgsql https://qiita.com/tabizou/items/47f395d7ab3030dd1915

How To Install PostgreSQL on Ubuntu 20.04 [Quickstart] https://www.digitalocean.com/community/tutorials/how-to-install-postgresql-on-ubuntu-20-04-quickstart

Installation of PostgreSQL 12, database creation, table definition (on Ubuntu) https://www.kkaneko.jp/tools/postgresinstall/postgreslinux.html

Recommended Posts

Install Pleasant on Ubuntu 20.04 (.NetCore3.1 / PostgreSQL version)
wsl Install PostgreSQL on Ubuntu 18.04
Install TensorFlow on Ubuntu
Install PySide2 on Ubuntu
Install JModelica on Ubuntu
Install Python 3.3 on Ubuntu 12.04
Install Theano on Ubuntu 12.04
Install angr on Ubuntu 18.04
Install pip / pip3 on Ubuntu
Install Ubuntu 20.04 LTS (Server) 64bit version on RaspberryPi3B +
Install the latest version of CMake on Ubuntu 18.04.4 LTS
Install GoLand IDE on Ubuntu
[ROS] Install ROS (melodic) on Ubuntu (18.04)
Install Caffe on Ubuntu 14.04 (GPU)
Install Docker on WSL Ubuntu 18.04
Install CUDA10.1 + cuDNN7.6.5 + tensorflow-2.3.0 on Ubuntu 18.04
Install Python 3.8 on Ubuntu 18.04 (OS standard)
Install Caffe on Ubuntu 14.04 (CPU mode)
Install Mecab and mecab-python3 on Ubuntu 14.04
Install and run dropbox on Ubuntu 20.04
Install OpenCV and Chainer on Ubuntu
Install CUDA 8.0 and Chainer on Ubuntu 16.04
Install Python 3.8 on Ubuntu 20.04 (OS standard)
Install xgboost (python version) on Windows
Install fabric on Ubuntu and try
Install Python 3.9 on Ubuntu 20.04 (OS standard?)
Install confluent-kafka for Python on Ubuntu
Install Python 2.7 on Ubuntu 20.04 (OS standard?)
How to install Go on Ubuntu
ROS study # 1 Install ros-noetic on ubuntu 20.04
RTKLIB 2.4.3 CLI version GUI version installed on Ubuntu 18.04
I installed TensorFlow (GPU version) on Ubuntu
Install ubuntu on 32bit UEFI Ultra Notebook
Install Caffe running 3D-CNN on clean Ubuntu 14.04
Install Puppet Master and Client on Ubuntu 16.04
How to install php7.4 on Linux (Ubuntu)
Install pyenv and Python 3.6.8 on Ubuntu 18.04 LTS
Install PostgreSQL from source code on CentOS
I can't install Dask with pip on Ubuntu
[2020 version] How to install Python3 on AWS EC2
Install python package in personal environment on Ubuntu
Install Anydesk Linux version on Chromebook [Result NG]
[Procedure memo] Install Python3 + OpenSSL locally on Ubuntu
Shebang on Ubuntu 20.04
Use the latest version of PyCharm on Ubuntu
Install the latest Cuda + CuDNN on Ubuntu 18.04 @ Spring 2020
Install MongoDB on Ubuntu 16.04 and operate via python
Install ZIP version Python and pip on Windows 10
Install Apache 2.4 on Ubuntu 19.10 Eoan Ermine and run CGI
I got a UnicodeDecodeError when pip install on ubuntu
Install pyenv on Raspberry Pi and version control Python
Install Bash on Ubuntu on Windows, Ruby, Python, Jupyter, etc.
Install mecab on Marvericks
Install Tensorflow on Mac
Install python on WSL
Install Faiss on CentOS 7
Install pyenv on mac
Install pip on Mavericks
Install Python on Pidora.
Install mongodb on termux
Install Scrapy on python3