How to install and configure the supervisor daemon under centos7

How to install and configure the supervisor daemon under centos7

Newbie, record it yourself

1. Install supervisor. Supervisor is developed based on Python. When you install Supervisor, Python dependencies are automatically installed, so no additional installation is required.

# yun install supervisor

2. After successful installation, check the relevant files and directories generated under /etc

supervisord.conf is the default configuration file

supervisord.d is the directory where separate configuration files for other programs are stored

3. Configure supervisord.conf

For all parameters, please refer to the official documentation. There are too many configuration items for us to understand. We only need to modify one place and keep the others unchanged.

# vim /etc/supervisord.conf

Locate the last [include] item in the document and change files = supervisord.d/*.ini to files = supervisord.d/*.conf to load the configuration of other applications.

4. Add a separate configuration file for the application (dotnet core)

Create a new configuration file in the supervisord.d directory

# touch /etc/supervisord.d/FirstApi.conf

Open the file and add the following content

[program:FirstApi]
#Command to execute command=dotnet FirstApi.dll
#Command execution directory directory=/home/www/first
#Environment variable environment=ASPNETCORE__ENVIRONMENT=Production
#Process execution user identity<br> user=root<br> stopsignal=INT
#Whether to start automatically autostart=true
#Whether to automatically restart autorestart=true
#Automatic restart interval seconds startsecs=1
#Standard error log stderr_logfile=/var/log/FirstApi.err.log
#Standard output log stdout_logfile=/var/log/FirstApi.out.log

5. Restart the supervisor service

# supervisord -c /etc/supervisord.conf

If the prompt "Another program is already listening on a port that one of our HTTP servers" appears, it means that the service is already running. You can restart the service by following the steps below.

#Enter the console# supervisorctl
#Reread the configuration
#Update configuration update
#Start all configurations start all
#Check the status after success 

At this time, visit the program address again and find that the project has run successfully!

This is the end of this article about how to install and configure the supervisor daemon under centos7. For more information about installing supervisor under centos7, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Building .NET Core 2.0 + Nginx + Supervisor environment under Centos7 system
  • Detailed tutorial on using supervisor in centos7

<<:  Vue uses element-ui to implement menu navigation

>>:  Basic usage of find_in_set function in mysql

Recommend

How to use Docker to package and deploy images locally

First time using docker to package and deploy ima...

Nginx+FastDFS to build an image server

Installation Environment Centos Environment Depen...

Native js to achieve seamless carousel effect

Native js realizes the carousel effect (seamless ...

How to install and configure ftp server in CentOS8.0

After the release of CentOS8.0-1905, we tried to ...

Analysis of MySQL Aborted connection warning log

Preface: Sometimes, the session connected to MySQ...

CSS sets the box container (div) height to always be 100%

Preface Sometimes you need to keep the height of ...

Implementation code for using mongodb database in Docker

Get the mongo image sudo docker pull mongo Run th...

Linux Basic Tutorial: Special Permissions SUID, SGID and SBIT

Preface For file or directory permissions in Linu...

MySQL 5.6.23 Installation and Configuration Environment Variables Tutorial

This article shares the installation and configur...

Native Js implementation of calendar widget

This article example shares the specific code of ...

WeChat applet custom tabbar component

This article shares the specific code of the WeCh...

Detailed explanation of CSS counter related attributes learning

The CSS counter attribute is supported by almost ...

Introduction to the use of select optgroup tag in html

Occasionally, I need to group select contents. In ...

How to install tomcat8 in docker

1. Install tomcat8 with docker 1. Find the tomcat...