Advertisement
clockworkpc

Bootstrap for CentOS7 Box

Oct 2nd, 2016
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.03 KB | None | 0 0
  1. #!/bin/bash
  2. # bootstrap.sh
  3.  
  4. PASSWORD = {PASSWORD}
  5.  
  6. # Install Apache
  7. sudo yum install -y httpd
  8.  
  9. # Start Apache service
  10. sudo systemctl start httpd.service
  11.  
  12. # Enable Apache to start on boot
  13. sudo systemctl enable httpd.service
  14.  
  15. # Install MariaDB
  16. sudo yum install -y mariadb-server mariadb
  17.  
  18. # Start MariaDB service
  19. sudo systemctl start mariadb
  20.  
  21. # Configure the MariaDB database
  22. # Not permitted to be done unattended in Fedora
  23. # sudo mysql_secure_installation
  24.  
  25. # Enable MariaDB to start on boot
  26. sudo systemctl enable mariadb.service
  27.  
  28. # Install PHP and PHP-MySQL
  29. sudo yum install -y php php-mysql
  30.  
  31. # Restart the Apache server
  32. sudo systemctl restart httpd.service
  33.  
  34. # Install Gearman from source
  35. # (Not available from repositories)
  36.  
  37.  # 1. Install the recommended packages
  38. yum install gcc gcc-c++ make bison flex autoconf libtool memcached libevent libevent-devel uuidd libuuid-devel  boost boost-devel libcurl-dev libcurl curl gperf mysql-devel wget
  39.  
  40.  # 2. Download the latest files and extract them
  41. cd /vagrant/
  42. wget https://launchpad.net/gearmand/1.2/1.1.12/+download/gearmand-1.1.12.tar.gz
  43. tar -zxvf gearmand-1.1.12.tar.gz
  44. cd gearmand-1.1.12
  45.  
  46.  # 3. Compile the extracted code
  47. ./configure
  48. make
  49. make install
  50.  
  51.  # 4. Start the daemon
  52. mkdir -p /usr/local/var/log/
  53. gearmand --verbose DEBUG -d
  54.  
  55.  # 5. Check there are no errors
  56. tail /usr/local/var/log/gearmand.log
  57. DEBUG XXX [     2 ] Entering thread event loop -> libgearman-server/gearmand_thread.cc:463
  58.    
  59.  # 6. Install the PHP pear package
  60. yum install install php-devel php-pear
  61. pecl install gearman
  62.    
  63. # Restart apache (if thats what you are using)
  64. sudo systemctl restart httpd.service
  65.  
  66.  
  67. # Install GearmanManager
  68. sudo yum install git-core
  69. cd /vagrant
  70. git clone https://github.com/brianlmoon/GearmanManager.git /vagrant/gearman-manager
  71. /vagrant/gearman-manager/install/install.sh
  72.  
  73. # Start the manager
  74. /etc/init.d/gearman-manager start
  75.  
  76. # Check for any errors
  77. tail /var/log/gearman-manager.log
  78.  
  79. # Restart the Apache server
  80. sudo systemctl restart httpd.service
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement