SUSE12Sp3-Supervisor 守護.net core進程

一、安裝setuptools

將setuptools-0.6c11.tar.gz安裝包放到服務器上html

tar zxvf setuptools-0.6c11.tar.gz	
cd setuptools-0.6c11
sudo python setup.py build
sudo python setup.py install
二、安裝meld

將meld3-1.0.2.tar.gz安裝包放到服務器上python

tar -zxvf meld3-1.0.2.tar.gz
cd meld3-1.0.2
sudo python setup.py install
三、安裝supervisor

將supervisor-3.3.3.tar.gz安裝包放到服務器上shell

tar -zxvf supervisor-3.3.3.tar.gz
cd supervisor-3.3.3
sudo python setup.py install
四、驗證supervisor安裝是否成功
supervisorctl --help

以下,安裝成功bash

supervisorctl -- control applications run by supervisord from the cmd line.

Usage: /usr/bin/supervisorctl [options] [action [arguments]]

Options:
-c/--configuration FILENAME -- configuration file path (searches if not given)
-h/--help -- print usage message and exit
-i/--interactive -- start an interactive shell after executing commands
-s/--serverurl URL -- URL on which supervisord server is listening
     (default "http://localhost:9001").
-u/--username USERNAME -- username to use for authentication with server
-p/--password PASSWORD -- password to use for authentication with server
-r/--history-file -- keep a readline history (if readline is available)

action [arguments] -- see below

Actions are commands like "tail" or "stop".  If -i is specified or no action is
specified on the command line, a "shell" interpreting actions typed
interactively is started.  Use the action "help" to find out about available
actions.
五、配置supervisor守護.net core 程序
sudo vi /etc/supervisord.conf #編寫配置文件 
複製下面的內容到該文件,#號後面的
[inet_http_server]
port=192.168.1.9:7004 ;這裏要根據你的IP自行修改。也能夠填寫127.0.0.1,可是隻能在本機訪問了。

[program:WebApplicationl] ; program 後面接的是本身去的名字
command=dotnet WebApplication1.dll  ;這裏是執行的命令
directory=/home/allspark/Downloads/Test ;這裏是在哪一個路徑執行命令
user=root
stopsignal=INT
autostart=true 	 ;設置爲true 子進程將在supervisord啓動後被自動啓動
autorestart=true ;設置子進程掛掉後自動重啓
startsecs=1
stderr_logfile=/var/log/HelloWebApp.err.log ;這裏是日誌的路徑
stdout_logfile=/var/log/HelloWebApp.out.log ;這裏是日誌的路徑

[supervisord]

這裏咱們切換到root帳號登陸服務器,鍵入一下命令服務器

supervisord -c /etc/supervisord.conf

訪問ip:7004能夠看到正在運行的項目app

這時候也能夠訪問你程序的ip:端口進行訪問ui


2019/7/5 11點01分 更新url

這邊添加一個腳本spa

#!/bin/bash
set -x

ip="127.0.0.1"

path="/home/allspark"

log_path="/var/log"

# 安裝setuptools

tar zxvf setuptools-0.6c11.tar.gz

cd setuptools-0.6c11

sudo python setup.py build

sudo python setup.py install

cd ..

# 安裝meld
tar -zxvf meld3-1.0.2.tar.gz

cd meld3-1.0.2

sudo python setup.py install

cd ..

# 安裝supervisor

tar -zxvf supervisor-3.3.3.tar.gz

cd supervisor-3.3.3

sudo python setup.py install

supervisorctl --help

cd ..


# 編輯配置
cat >/etc/supervisord.conf <<-EOF

[inet_http_server]
port=${ip}:9001 ;

[program:取個名字] ;
command=你的命令 ;
directory=${path}/你要執行命令的目錄 ;
user=root
stopsignal=INT
autostart=true   ;
autorestart=true ;
startsecs=1
stderr_logfile=${log_path}/日誌名稱.err.log ;
stdout_logfile=${log_path}/日誌名稱.out.log ;

 
[supervisord]
EOF


supervisord -c /etc/supervisord.conf

SUSE12Sp3 安裝配置. net core 生產環境 - 總彙

相關文章
相關標籤/搜索