Using systemd how to create several services of engine X with individual ports, conf and tmp files
as far i as i got i need to create copy /etc/nginx/nginx.conf nginx2.conf and nginx3.conf - there i specify different path to log, change port
then i run
sudo systemctl edit nginx
then paste original settings to override ?
do i need to edit Enviroment or ExecStart section?
[Unit] Description=The nginx HTTP and reverse proxy server After=network-online.target remote-fs.target nss-lookup.target Wants=network-online.target
[Service] Type=forking PIDFile=/run/nginx.pid ExecStartPre=/usr/bin/rm -f /run/nginx.pid ExecStartPre=/usr/sbin/nginx -t ExecStart=/usr/sbin/nginx ExecReload=/usr/sbin/nginx -s reload KillSignal=SIGQUIT TimeoutStopSec=5 KillMode=process PrivateTmp=true
[Install] WantedBy=multi-user.target
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 1906/dnsmasq
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1219/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1213/cupsd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1510/master
tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 2359/sshd: grant@pt
tcp 0 0 0.0.0.0:2080 0.0.0.0:* LISTEN 3028/nginx: master
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 701/rpcbind
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1344/nginx: master
udp 0 0 0.0.0.0:865 0.0.0.0:* 701/rpcbind
udp 0 0 192.168.122.1:53 0.0.0.0:* 1906/dnsmasq
udp 0 0 0.0.0.0:67 0.0.0.0:* 1906/dnsmasq
udp 0 0 0.0.0.0:68 0.0.0.0:* 1025/dhclient
udp 0 0 0.0.0.0:111 0.0.0.0:* 701/rpcbind
udp 0 0 0.0.0.0:5353 0.0.0.0:* 697/avahi-daemon: r
udp 0 0 0.0.0.0:43438 0.0.0.0:* 697/avahi-daemon: r