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
$ 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
$ 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
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]'
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";
postgres=# \c "Implem.Pleasanter";
Implem.Pleasanter=# CREATE EXTENSION pg_trgm;
$ unzip Pleasanter.NetCore_1.1.5.1.zip
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
}
$ cd pleasanter/Implem.CodeDefiner
$ dotnet Implem.CodeDefiner.NetCore.dll _rds
$ 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.
$ 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
$ sudo systemctl daemon-reload
$ sudo systemctl enable pleasanter
$ sudo systemctl start pleasanter
$ sudo apt install nginx-extras
$ sudo systemctl start nginx
$ sudo systemctl enable nginx
$sudo addgroup username www-data
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/
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