Skip to content

I want to install Pleasanter using Apache as my web server

Prerequisites

  1. We will not cover how to set up the OS. We assume that the OS has already been set up.
  2. For details on the operating environment and specifications, please see here.

FAQ: I want to know the operating environment and recommended specifications

Overview

This explanation shows the steps to build a Pleasanter operating environment in the environment shown below.

Target Contents
OS Red Hat Enterprise Linux 9.1
DB PostgreSQL 14
Web server Apache
Platform .NET 6.0
Pleasanter Pleasanter 1.3.37.0

Operation Procedure

1. Install .NET6.0

Install ASP.NET Core Runtime

sudo dnf install aspnetcore-runtime-6.0

Install GDI+

sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
sudo dnf install -y libgdiplus

2. Set up PostgreSQL

Register Package Repository

sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm

Install PostgreSQL

sudo dnf module -y disable postgresql
sudo dnf install -y postgresql14-server postgresql14-contrib

Initialize The Database

sudo su - postgres -c '/usr/pgsql-14/bin/initdb -E UTF8 -A scram-sha-256 -W'

Additional information:

  • -A: Specify the authentication method
  • -W: Option to display the password prompt
  • Specify the password for the Postgres user of the DB at this point

Log output settings

Open /var/lib/pgsql/14/data/postgresql.conf and set the following.

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

*Log files are saved in /var/lib/pgsql/14/data/log.

Enable The Service

sudo systemctl enable postgresql-14

PostgreSQL User Settings For The OS

Set a password for the PostgreSQL administration user Postgres (OS user).

sudo passwd postgres

Install The Full-text Search Module (pg_trgm)

Install the module (pg_trgm) required for full-text search of text.

  1. Switch to user Postgres and connect to PostgreSQL.
su - postgres
psql -U postgres
  1. Create database Implem.Pleasanter.
create database "Implem.Pleasanter";
  1. Switch to database Implem.Pleasanter.
\c "Implem.Pleasanter";
  1. Install pg_trgm.
create extension pg_trgm;

Settings For Allowing External Access To The DB

  1. Uncomment the following two lines in /var/lib/pgsql/14/data/postgresql.conf and set them as follows.
# - Connection Settings -
listen_addresses = '*'  # what IP address(es) to listen on;
port = 5432             # (change requires restart)
  1. Add the following lines to /var/lib/pgsql/14/data/pg_hba.conf.
    In the Address field, specify the range of IP addresses to allow access.
# TYPE  DATABASE        USER            ADDRESS                 METHOD
host    all             all             192.168.1.0/24          scram-sha-256
  1. After setting, restart the PostgreSQL service.
sudo systemctl restart postgresql-14

3. Installing Pleasanter 1.3

Preparing The Application

Download Pleasanter 1.3.

Create a "/web" folder in the root directory ("/") and put the "pleasanter" folder there.

  • /web/pleasanter/Implem.Pleasanter
  • /web/pleasanter/Implem.CodeDefiner
  • /web/pleasanter/Tools

Database Configuration

  1. Set /web/pleasanter/Implem.Pleasanter/App_Data/Parameters/Rds.json as follows.
{
   "Dbms": "PostgreSQL",
   "Provider": "Local",
   "TimeZoneInfo": "Asia/Tokyo",
   "SaConnectionString":"Server=localhost;Port=5432;Database=postgres;UID=postgres;PWD={The password which you 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
}
  1. Run CodeDefiner
cd /web/pleasanter/Implem.CodeDefiner
dotnet Implem.CodeDefiner.dll _rds
  1. Start Pleasanter
cd /web/pleasanter/Implem.Pleasanter
dotnet Implem.Pleasanter.dll
  1. Access http://localhost:5000/ in another terminal and confirm that a normal response is returned.
curl -v http://localhost:5000/

Response example

* 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

Once you have confirmed it, press Ctrl+C to exit.

Creating A Script For The Pleasanter Service

Create /etc/systemd/system/pleasanter.service with the following content.

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

[Service]
ExecStart = /usr/bin/dotnet Implem.Pleasanter.dll (※1)
WorkingDirectory = /web/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

(*1)
This example is for Red Hat Enterprise Linux 8. If you are using other versions, check the PATH of the dotnet command and change it to match your environment. You can check the execution path of dotnet by executing the following command.

whereis -b dotnet

For example, if the result of executing the above command is /usr/local/bin/dotnet, the line (*1) must be set as follows.

ExecStart = /usr/local/bin/dotnet Implem.Pleasanter.dll

Register as a service and start the service

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

Setting Up A Reverse Proxy (Apache)

Set up the reverse proxy so that it can be accessed via Port 80, the same as a normal web server.

Installing Apache

Install Apache with the following command.

dnf install -y httpd
systemctl enable httpd

Reverse Proxy Settings

Add the following to the last line of /etc/httpd/conf/httpd.conf.

ProxyRequests Off
ProxyPass / http://localhost:5000/
ProxyPassReverse / http://localhost:5000/

After adding the file, restart Apache.

systemctl restart httpd
Access Permission To Port 80

Set access permission to http (port: 80) to allow clients to access the web service.
The settings differ depending on each environment, so please check as appropriate.

4. Other settings

Initial Account

Login ID: The administrator is created as the initial user.
The initial user password is pleasanter by default. A password change dialog will be displayed when you log in for the first time, so please set a password of your choice.

This password can be specified in /web/pleasanter/Implem.Pleasanter/App_Data/Parameters/Service.json with DefaultPassword.

Steps to enable the reminder function in Pleasanter version 1.3.7.0 or later

Change the parameter settings in "BackgroundService.json" and "Service.json". When changing parameters, please refer to the manual "Confirmation When Changing Parameters".

BackgroundService.json

Refer to the manual "Set Parameter: BackgroundService.json" and change the settings in the BackgroundService.json file to the following settings.

Column e.g. Description
Reminder true Enable reminder function

Service.json

Refer to the manual "Set Parameter: Service.json" and change the settings in the Service.json file to the following settings.

Column e.g. Description
AbsoluteUri "http://pleasanter.example.local" Please enter the first part of the URL to be displayed in notifications and reminders. (null is not allowed)

Database Migration

For instructions on migrating from SQL Server to PostgreSQL, please refer to the following manual.

Migration Procedure from Pleasanter's DB from SQL Server to PostgreSQL