Skip to content

Install Pleasanter on AlmaLinux

Overview

This manual describes the procedure for building a Pleasanter operating environment in the following environment.

Target Content
OS AlmaLinux 9.7/10.2
DB PostgreSQL 18 or MySQL 8.4
Web Server nginx 1.20.1
Platform .NET 8.0
Pleasanter When using PostgreSQL: Pleasanter 1.4.0.0 and later
When using MySQL: Pleasanter 1.9.0 and later

Notes

  1. When installing ver1.4.6 or later, if you run CodeDefiner without specifying arguments, it will be set up with the language: English and the time zone: UTC, so please specify the language and time zone as necessary.
  2. MySQL can be used from ver1.4.9.0 onwards. Pleasanter versions earlier than ver1.4.9.0 do not support MySQL.
  3. If you want to separate the web server and DB server in MySQL, please refer to "Configure the Web Server and DB Server to Use MySQL Separately".
  4. When configuring a separated web server and DB server setup in MySQL, please refer to "Configure MySQL to be used in a configuration where the web server and DB server" or "Configure the Web Server and DB Server to Use MySQL Separately".

Prerequisites

  1. We will not describe how to set up the OS. We assume that the OS has been set up in advance.
  2. For details on the operating environment and specifications, please check here.
    FAQ: I want to know the operating environment and recommended specifications
  3. Decide in advance the user who will start Pleasanter. User who will launch Pleasanter in the procedure refers to this user.
  4. This procedure explains the case where .NET is installed in /usr/local/bin. If you need multiple versions of .NET in the same environment and you want to install .NET in a different directory, change the directory specified in ExecStart when running CodeDefiner or creating a script for the Pleasanter service to match the installation destination.

Procedure

The construction procedure is as follows.
1. Set up .NET
1. Setting up the database:
Perform the following setup for either PostgresSQL or MySQL.
*The order in which the settings are implemented may not match the order shown below.
1. Install the DB
1. Set up a user with DB manager privileges
1. Set up DB log output
1. Turn the DB into a service and enabling automatic startup
1. Set up to allow external access to the D
1. Set up Pleasanter
1. Prepare the application
1. Configure the database
1. Run CodeDefiner
1. Check that Pleasanter is running
1. Create a script for the Pleasanter service
1. Register as a service and starting the service
1. Set up a reverse proxy (nginx)
1. Change SELinux settings
1. Install nginx
1. Set up the reverse proxy
1. Allow access to Http(80)
1. Check that Pleasanter is running

1. Set Up .NET

Run the following command to install .NET.

sudo wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
sudo chmod +x ./dotnet-install.sh
sudo dnf install libicu
sudo ./dotnet-install.sh -c 10.0 -i /usr/local/bin
dotnet --version

For details, please refer to the official page below Scripted install.
https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install

There are cases where an error occurs regarding a specific file when executing the dotnet command. In that case, please refer to the following page.
https://learn.microsoft.com/en-us/dotnet/core/install/linux-package-mixup?pivots=os-linux-redhat

2. Set Up The Database

Refer to either "Set up PostgreSQL" or "Set up MySQL" below to set up the database.

1. Set Up PostgreSQL

The procedure for setting up PostgreSQL is as follows.

(Click here to open/close details)

1. Install PostgreSQL

Run the following command to install PostgreSQL.

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

2. Initialize the PostgreSQL database

Run the following command to initialize the database.

Option Description
-A Option to specify authentication method.
-W Option to display password prompt

After execution, a password prompt will be displayed, so enter the password. The password set here will be used in step 3.2, so please make a note of it so you don't forget it.

sudo su - postgres -c '/usr/pgsql-18/bin/initdb -E UTF8 -A scram-sha-256 -W'
3. PostgreSQL log output settings

Open /var/lib/pgsql/18/data/postgresql.conf and edit the following settings.

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

4. Restart the PostgreSQL service and make it a service

Execute the following command to restart the PostgreSQL service and enable automatic service startup.

sudo systemctl restart postgresql-18
sudo systemctl enable postgresql-18

5. Settings for allowing external access to the database

  1. Uncomment the following two lines in /var/lib/pgsql/18/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/18/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, run the following command to restart the PostgreSQL service.
sudo systemctl restart postgresql-18

2. Set Up MySQL

The procedure for setting up MySQL is as follows.

(Click here to open/close details)

1. Install MySQL

  1. Run the following command to install the MySQL package and server.
sudo dnf install -y https://dev.mysql.com/get/mysql84-community-release-el9-1.noarch.rpm
sudo dnf install mysql-community-server

The URL specified in the command is the same as the URL specified in the official repository below.
https://dev.mysql.com/downloads/repo/yum/

  1. Run the command to display the service status.
systemctl status mysqld.service
  1. Check that the service is stopped and that the message "Active: inactive (dead)" is displayed as shown below.
○ mysqld.service - MySQL Server
     Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; preset: disabled)
     Active: inactive (dead)
       Docs: man:mysqld(8)
             http://dev.mysql.com/doc/refman/en/using-systemd.html

2. Enable automatic startup of MySQL service

  1. Run the following command to start the MySQL service.
sudo systemctl start mysqld
  1. Run the following command to enable automatic startup of MySQL service.
sudo systemctl enable mysqld

3. MySQL user settings

  1. Add the following settings under [mysqld] in /etc/my.cnf.
[mysqld]
skip-grant-tables

The path of the configuration file may differ depending on the OS or MySQL version.

  1. Run the following command to restart the MySQL service.
sudo systemctl restart mysqld
  1. Run the following command to log in to MySQL with the root account (without password).
mysql -u root
  1. Run the following SQL to set the password for the MySQL root account.
flush privileges;
alter user 'root'@'localhost' identified by '<new password for MySQL root account (*)>';

*The default settings for MySQL installed in this procedure require a password of 8 characters or more, including uppercase and lowercase letters, numbers, and special characters.

  1. Execute the following command to log out of the root account from MySQL.
quit;
  1. Delete the description added under [mysqld] in /etc/my.cnf. Do not delete [mysqld].
skip-grant-tables
  1. Execute the following command to restart the MySQL service.
sudo systemctl restart mysqld
  1. Execute the following command to confirm that you can log in to MySQL with the root account.
mysql -u root -p<MySQL root account password without any spaces between -p>
  1. Execute the following command to log out of the root account from MySQL.
quit;

4. MySQL log output settings

Error log output is enabled by default in MySQL. If you do not want to change the default output destination, the following steps do not need to be performed.

  1. Check the path of the log file listed in log-error under [mysqld] in /etc/my.cnf.
    The path of the configuration file may differ depending on the OS or MySQL version.
[mysqld]
log-error=/var/log/mysqld.log
  1. If you want to change the output destination of the error log, edit the my.cnf file and then run the following command to restart the MySQL service.
sudo systemctl restart mysqld

5. Configuration for Allowing External Access to the Database

Follow the steps in the manual below to add a MySQL user.

  1. Configure the Web Server and DB Server to Use MySQL Separately (Ver.1.4.18.0 and later) - Now, Japanese Only
  2. Configure the Web Server and DB Server to Use MySQL Separately (Ver.1.4.17.1 and earlier)

If the web server and database server are not separated, this step is not necessary.

3. Set up Pleasanter

1. Prepare the application

  1. Run the following command to create a "web" directory in the root directory ("/").
sudo mkdir /web
  1. Download the latest version of Pleasanter from the download center.
    When installing Pleasanter version 1.4.23.3 or earlier, download the zip file for the desired version (e.g., Pleasanter_1.4.23.3.zip) from GitHub.
  2. Extract the downloaded zip file and place the entire extracted "pleasanter" folder to "/web" on the server using a file transfer application such as WinSCP.

  3. Execute the following command to change the owner of the Pleasanter directory to the user who will start Pleasanter.

sudo chown -R <User who will start Pleasanter> /web/pleasanter

2. Database Configuration

Set the database connection information in /web/pleasanter/Implem.Pleasanter/App_Data/Parameters/Rds.json. A setting e.g. is shown below. Please also refer to the Rds.json manual if necessary.
Set Parameter: Rds.json

E.g. Of Rds.json Settings When Using PostgreSQL

The following is an e.g. of Rds.json settings when using PostgreSQL.

(Click here to open/close details)
No Property name Value
1 Dbms "PostgreSQL"
2 SaConnectionString "Server=localhost;Port=5432;Database=postgres;UID=postgres;PWD=XXX"
*For the PWD value, enter the password you set in "Initializing the PostgreSQL database".
3 OwnerConnectionString "Server=localhost;Port=5432;Database=#ServiceName#;UID=#ServiceName#_Owner;PWD=XXX"
*For the PWD value, enter any password.
4 UserConnectionString "Server=localhost;Port=5432;Database=#ServiceName#;UID=#ServiceName#_User;PWD=XXX"
*Please enter any password as the PWD value.
{
    "Dbms": "PostgreSQL",
    "Provider": "Local",
    "SaConnectionString": "Server=localhost;Port=5432;Database=postgres;UID=postgres;PWD=<「PostgreSQLデータベースの初期化」で設定したパスワード>",
    "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": 0,
    "MinimumTime": 3,
    "DeadlockRetryCount": 4,
    "DeadlockRetryInterval": 1000,
    "DisableIndexChangeDetection": true,
    "SysLogsSchemaVersion": 1
}

E.g. Of Rds.json Settings When Using MySQL

The following is an e.g. of Rds.json settings when using MySQL.

(Click here to open/close details)
No Property name Value
1 Dbms "MySQL"
2 SaConnectionString "Server=localhost;Port=3306;Database=mysql;UID=root;PWD=XXX"
*For the PWD value, enter the password you set in "MySQL user settings".
3 OwnerConnectionString "Server=localhost;Port=3306;Database=#ServiceName#;UID=#ServiceName#_Owner;PWD=XXX"
*For the PWD value, enter any password.
4 UserConnectionString "Server=localhost;Port=3306;Database=#ServiceName#;UID=#ServiceName#_User;PWD=XXX"
*Please enter any password for the PWD value.
5 MySqlConnectingHost If there are no special requirements, use "%". If you want to implement access restrictions for MySQL, refer to "Set Parameter: Rds.json" and configure appropriately.

*In the default settings of MySQL installed in this procedure, you will be asked to enter a password of 8 characters or more, including uppercase letters, lowercase letters, numbers, and special characters.

{
    "Dbms": "MySQL",
    "Provider": "Local",
    "SaConnectionString": "Server=localhost;Port=3306;Database=mysql;UID=root;PWD=<「MySQLユーザの設定」で設定したパスワード>",
    "OwnerConnectionString": "Server=localhost;Port=3306;Database=#ServiceName#;UID=#ServiceName#_Owner;PWD=Set_0_Admins_0_PWD",
    "UserConnectionString": "Server=localhost;Port=3306;Database=#ServiceName#;UID=#ServiceName#_User;PWD=Set_0_Users_0_PWD",
    "SqlCommandTimeOut": 0,
    "MinimumTime": 3,
    "DeadlockRetryCount": 4,
    "DeadlockRetryInterval": 1000,
    "DisableIndexChangeDetection": true,
    "SysLogsSchemaVersion": 1
    "MySqlConnectingHost": "%"
}

3. Run CodeDefiner

Execute the following command to run CodeDefiner with the user that will start Pleasanter as determined in advance.
This procedure explains the case where .NET is installed in /usr/local/bin. If you need to install .NET in a different directory due to requirements such as needing multiple versions of .NET in the same environment, please change the directory specified when running CodeDefiner to match the installation destination.
(*)The following command is executed only during the initial installation.

cd /web/pleasanter/Implem.CodeDefiner
sudo -u <user who will launch Pleasanter> /usr/local/bin/dotnet Implem.CodeDefiner.dll _rds /l "<Language>" /z "<Timezone>"
Argument e.g. Description
/l en Rewrites the DefaultLanguage value in Service.json (*1)
/z UTC Rewrites the TimeZoneDefault value in Service.json (*1)

(*1) For language and timezone, please refer to the following manual page.
FAQ: I want to know the supported languages and timezone parameter setting values in Pleasanter

If you are using it in a English environment, use the following command.

cd /web/pleasanter/Implem.CodeDefiner
sudo -u <User who starts Pleasanter> /usr/local/bin/dotnet Implem.CodeDefiner.dll _rds /l "en" /z "UTC"

If the message "Type 'y' (yes) if the license is correct, otherwise type 'n' (no)." appears, enter y.

4. Check that Pleasanter is running

  1. Run the following command to start Pleasanter with a predefined user.
cd /web/pleasanter/Implem.Pleasanter
sudo -u <User who will start Pleasanter> /usr/local/bin/dotnet Implem.Pleasanter.dll
  1. While Pleasanter is running, run the following command in another terminal to check that Pleasanter is running. Exit with "Ctrl+C".
  2. Execution command
curl -v http://localhost:5000/
  • Execution result
*   Trying ::1:5000...
* Connected to localhost (::1) port 5000 (#0)
> GET / HTTP/1.1
> Host: localhost:5000
> User-Agent: curl/7.76.1
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 302 Found
< Content-Length: 0
< Date: Tue, 25 Jul 2023 11:33:38 GMT
< Server: Kestrel
< Location: http://localhost:5000/users/login?ReturnUrl=%2F
< X-Frame-Options: SAMEORIGIN
< X-XSS-Protection: 1; mode=block
< X-Content-Type-Options: nosniff
<
* Connection #0 to host localhost left intact

5. Create A Script For The Pleasanter Service

Create /etc/systemd/system/pleasanter.service with the following content. For User below, specify the user who will start Pleasanter.
In this procedure, .NET is installed in /usr/local/bin. If you need to install .NET in a different directory, such as when multiple versions of .NET are required in the same environment, modify the directory specified in ExecStart to match the installation location.

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

[Service]
ExecStart = /usr/local/bin/dotnet Implem.Pleasanter.dll
WorkingDirectory = /web/pleasanter/Implem.Pleasanter
Restart = always
RestartSec = 10
KillSignal=SIGINT
SyslogIdentifier=dotnet-pleasanter
User = <User who starts Pleasanter>
Group = root
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false

[Install]
WantedBy = multi-user.target

6. Register As A Service And Start The Service

Execute the following command to enable the Pleasanter service start and automatic service start.

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

4. Set Up A Reverse Proxy (nginx)

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

1. Change SELinux Settings

Execute the following command.

getenforce

a. If "Command 'getenforce' not found," "Permissive," or "Disabled" is displayed

Proceed to "2. Install nginx."

b. If "Enforcing" is displayed

Execute the following command.

sudo setsebool -P httpd_can_network_connect on

*Change the above Boolean value of SELinux will allow all network connections by scripts and modules on the server in question.

2. Install nginx

Execute the following command to install nginx.

sudo dnf install -y nginx
sudo systemctl enable nginx

3. Reverse Proxy Settings

  1. Create /etc/nginx/conf.d/pleasanter.conf with the following contents. In the server_name line, specify the hostname or IP address of the server you want to access.

server {
    listen  80;
    server_name   192.168.1.100;
    client_max_body_size 100M;
    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;
    }
}

2. After creating the file, run the following command to restart the service.

sudo systemctl restart nginx

3. Permission To Access Http(80)

Execute the following command to set permission to access Http (port:80) to allow clients to access the web service.

sudo firewall-cmd --permanent --add-port=80/tcp
sudo firewall-cmd --reload

5. Check The Operation Of Pleasanter

  1. After starting Pleasanter, enter "Login ID: Administrator" and "Initial password: pleasanter" on the Pleasanter login screen and click the "Login" button.
    The Pleasanter login screen, where the login ID and initial password are entered

  2. After logging in, you will be asked to change the password for the "Administrator" user, so enter a password of your option and click the "Change" button.
    The password change screen for the Administrator user, shown after the first login

If The Redirection Is Not Correct

Check that the nginx settings are correct. The behavior may change depending on small differences such as the presence or absence of/in the description.

If The Pleasanter Screen Does Not Open

If the above steps have been completed without any errors, but a page such as "Welcome to nginx!" (not an error message) is displayed when accessed from a browser, the security settings of the browser may prevent you from transitioning to the Pleasanter login screen.

Please check the security settings of your browser.

Supported Versions

Supported versions Body
1.4.9.0 and later Supports MySQL
1.4.10.0 and later Fixed the issue where Owner and User connections were rejected due to MySQL's access control function
*Added a link to "Configure the Web Server and DB Server to Use MySQL Separately" in the notes
1.4.18.0 and later Added functionality to specify connection source hosts other than localhost (same server as DB) for MySQL database connections

FAQ: I want to install Pleasanter 1.3.43.0 or earlier in a Linux environment