Home > cs-library

cs-library

Cs-library is a project mainly written in Shell, based on the LGPL-3.0, GPL-3.0 licenses found.

A collection of bash functions that composes an API for administrating CentOS Server linux boxes, i.e. provisioning websites, installing services, hardening daemons, etc.

DESCRIPTION


A collection of bash functions that composes an API for administrating CentOS Server linux boxes. i.e. provisioning websites, installing services, hardening daemons, etc.

FILE USAGE


ssh [email protected] -p 22 sudo -s cd ~ wget --output-document=jmike-cs-library.tar.gz https://github.com/jmike/cs-library/tarball/master tar -zxf jmike-cs-library.tar.gz cd jmike-cs-library* source

exit

GENERAL GUIDELINES


Included functions are made to run on local machines. Thus, installing a daemon to a remote server means that you first have to log-in to that server.

Say you like to create a MySQL replication cluster. The actions you would do are:

  1. Login to 1st server via SSH
  2. Donwload cs-library to server
  3. Run functions to install MySQL daemon and set as master
  4. Logout
  5. Login to 2nd server via SSH
  6. Donwload cs-library to remote server
  7. Run functions to install MySQL daemon and set as slave
  8. Logout

DAEMON INSTALLATION GUIDELINES


  1. Install prerequisites
  2. Create user & group
  3. Create directories & set appropriate permissions
  4. Donwload, compile & install files
  5. Make binaries availiable to PATH
  6. Configure
  7. Set logs
  8. Integrate into logrotate
  9. Set daemon
  10. Set firewall
  11. Collect garbage
  12. Secure the application (if needed)

THERE IS A PLACE FOR EVERYTHING


A. Applications are installed in "/opt", i.e. /opt/mysql. B. Configuration files are stored in "/etc", i.e. /etc/nginx/nginx.conf. C. Log files are stored in "/var/log", i.e. /var/log/httpd/error.log. D. State files, such as PID files, are stored in "/var/run", i.e. /var/run/mysql/mysql.pid. E. Lock files are stored in "/var/lock", i.e. /var/run/mysql/mysql.lock. F. Init.d scripts are stored in "/etc/init.d", i.e. /etc/init.d/sshd. G. Profile.d scripts are stored in "/etc/profile.d", i.e. /etc/profile.d/mysql.sh. H. Logrotate.d scripts are stored in "/etc/logrotate.d", i.e. /etc/logrotate.d/mysql.

Previous:Hello-World