Skip to content

Instantly share code, notes, and snippets.

@ethnchao
ethnchao / nginx.conf
Last active May 29, 2018 06:12
Nginx Configurations
## Global Configuration
user nginx;
worker_processes 8;
events {
worker_connections 4096;
}
error_log /var/log/nginx/nginx.error.log error;
pid /usr/local/nginx/logs/nginx.pid;
@ethnchao
ethnchao / subversion.service
Created May 29, 2018 06:06
Systemd subversion.service
[Unit]
Description=Subversion Repo Service
After=network.target
[Service]
Type=forking
PIDFile=/opt/svnrepo/repo-mirror/svn.pid
ExecStart=/usr/bin/svnserve -d -r /opt/svnrepo/repo-mirror --pid-file /opt/svnrepo/repo-mirror/svn.pid
ExecStop=/bin/kill -s QUIT $MAINPID
ExecReload=/bin/kill -s HUP $MAINPID
@ethnchao
ethnchao / nexus2.service
Created May 29, 2018 06:07
Systemd nexus2.service
[Unit]
Description=Sonatype-Work Nexus 2 Service
After=network.target
[Service]
Type=forking
ExecStart=/opt/sonatype-work/nexus2/bin/nexus start
ExecStop=/opt/sonatype-work/nexus2/bin/nexus stop
ExecReload=/opt/sonatype-work/nexus2/bin/nexus restart
User=admin
@ethnchao
ethnchao / nginx.service
Created May 29, 2018 06:09
Systemd nginx.service
[Unit]
Description=The NGINX HTTP and reverse proxy server
After=syslog.target network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
PIDFile=/usr/local/nginx/logs/nginx.pid
ExecStartPre=/usr/local/nginx/sbin/nginx -t
ExecStart=/usr/local/nginx/sbin/nginx
ExecReload=/bin/kill -s HUP $MAINPID
@ethnchao
ethnchao / nginx-install.sh
Last active February 17, 2019 01:26
Nginx Install
sudo yum install pcre pcre-devel zlib zlib-devel gcc openssl-devel
sudo groupadd nginx
sudo useradd -g nginx -s /bin/false nginx
./configure --user=nginx \
--group=nginx \
--prefix=/usr/local/nginx \
--with-http_stub_status_module \
--with-http_ssl_module \
--with-http_gzip_static_module \
--with-stream
@ethnchao
ethnchao / supervisor.service
Created May 29, 2018 06:12
Systemd supervisor.service
# supervisord service for systemd (CentOS 7.0+)
# by ET-CS (https://github.com/ET-CS)
[Unit]
Description=Supervisor daemon
After=network.target
[Service]
Type=forking
ExecStart=/usr/bin/supervisord -c /etc/supervisord-supervisor.conf
ExecStop=/usr/bin/supervisorctl -c /etc/supervisord-supervisor.conf shutdown
@ethnchao
ethnchao / docker.conf
Created May 29, 2018 06:14
Systemd docker.service in docker.service.d
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd $DOCKER_OPTS
@ethnchao
ethnchao / docker-daemon.json
Last active May 29, 2018 06:24
Docker Daemon.json
{
"registry-mirrors": [ "http://a29bfa98.m.daocloud.io" ],
"storage-driver": "overlay2",
"tlsverify": true,
"tlscert": "/home/admin/.docker/client.cer",
"tlskey": "/home/admin/.docker/client.key",
"dns": [ "119.29.29.29", "9.9.9.9" ],
"dns-search": [ "demo.com" ]
}
@ethnchao
ethnchao / activemq.xml
Last active July 19, 2018 03:05
ActiveMQ Configurations
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@ethnchao
ethnchao / activemq.service
Created May 29, 2018 06:39
Systemd activemq.service
[Unit]
Description=ActiveMQ service
After=network.target
[Service]
Type=forking
ExecStart=/var/activemq/bin/activemq start
ExecStop=/var/activemq/bin/activemq stop
User=root
Group=root