madwulf

Rancid installation

Jan 15th, 2022 (edited)
2,190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 KB | None | 0 0
  1. #Installation
  2. yum install wget ftp telnet mariadb-server mariadb perl tcl expect gcc cvs rcs httpd autoconf php-common php-gd php-pear php-pecl-memcache php-mysql php-xml mod_ssl MySQL-python cyrus-sasl-plain
  3.  
  4. groupadd backup
  5. useradd -g backup -c "Device Backups" -d /home/rancid rancid
  6. mkdir /home/rancid/tar
  7.  
  8. #Download Rancid
  9. wget https://shrubbery.net/pub/rancid/rancid-3.13.tar.gz
  10.  
  11. #Extract and install
  12. tar -xzvf rancid-3.13.tar.gz
  13. ./configure --prefix=/usr/local/rancid
  14. make && make install
  15.  
  16. cp cloginrc.sample /home/rancid/.cloginrc
  17. chmod 0640 /home/rancid/.cloginrc
  18. chown -R rancid:backup /home/rancid/.cloginrc
  19. chown -R rancid:backup /usr/local/rancid/
  20. chmod 775 /usr/local/rancid/
  21.  
  22. #Config file
  23. vi /usr/local/rancid/etc/rancid.conf
  24.  
  25. LIST_OF_GROUPS="Routers Switches Firewalls"
  26.  
  27. #Create and initialize locations
  28. /usr/local/rancid/bin/rancid-cvs
  29.  
  30. #Viewvc installation
  31. wget https://viewvc.org/downloads/viewvc-1.2.1.tar.gz
  32. tar -xzvf viewvc-1.2.1.tar.gz
  33. ./viewvc-install
  34. vi /usr/local/viewvc-1.2.1/viewvc.conf
  35.  
  36.  
  37. #Lines to add
  38. root_parents = /usr/local/rancid/var/CVS : cvs
  39. rcs_dir = /usr/local/bin
  40. use_rcsparse = 1
  41.  
  42. cp /usr/local/viewvc-1.2.1/bin/cgi/*.cgi /var/www/cgi-bin/
  43. chmod +x /var/www/cgi-bin/*.cgi
  44. chown apache:apache /var/www/cgi-bin/*.cgi
  45.  
  46. #Apache settings
  47. vi /etc/httpd/conf/httpd.conf
  48.  
  49. <VirtualHost 10.64.128.238:80>
  50. DocumentRoot /var/www
  51. ScriptAlias /cgi-bin/ "/var/www/cgi-bin"
  52. ScriptAlias /viewvc /var/www/cgi-bin/viewvc.cgi
  53. ScriptAlias /query /var/www/cgi-bin/query.cgi
  54. <Directory "/var/www/cgi-bin">
  55. AllowOverride None
  56. Options None
  57. Order allow,deny
  58. Allow from all
  59. </Directory>
  60. </VirtualHost>
  61.  
  62. systemctl enable httpd
  63. systemctl start httpd
  64.  
  65. #Firewall rules
  66. firewall-cmd --permanent --zone=public --add-service=http
  67. firewall-cmd --permanent --zone=public --add-service=https
  68. firewall-cmd --reload
  69.  
  70. #DB installation
  71.  
  72. systemctl enable mariadb
  73. systemctl start mariadb
  74. mysql_secure_installation
  75.  
  76. mysql -u root -p
  77. CREATE USER 'viewvc'@'localhost' IDENTIFIED BY 'securepass';
  78. GRANT ALL PRIVILEGES ON *.* TO 'viewvc'@'localhost' WITH GRANT OPTION;
  79. FLUSH PRIVILEGES;
  80.  
  81. cd /usr/local/viewvc-1.2.1/bin/
  82. ./make-database
  83.  
  84. mysql -u root -p
  85. CREATE USER 'viewvcro'@'localhost' IDENTIFIED BY 'anothersecpass';
  86. GRANT SELECT ON ViewVC.* TO 'viewvcro'@'localhost' WITH GRANT OPTION;
  87. FLUSH PRIVILEGES;
  88.  
  89. /usr/local/viewvc-1.2.1/bin/cvsdbadmin rebuild /usr/local/rancid/var/CVS/CVSROOT/
Add Comment
Please, Sign In to add comment