Advertisement
Guest User

Untitled

a guest
Mar 19th, 2017
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.74 KB | None | 0 0
  1. #!/bin/bash
  2. # Tested on Ubuntu Ubuntu 14.04 and 15.04
  3. # feel free to ask me if you have any question sevan@tyfix.nl
  4. # git clone https://github.com/zgelici/FOS-Streaming.git
  5. # Install chmod 755 install.sh && ./install.sh
  6.  
  7. PS3='Please enter your choice: '
  8. options=("Install full 32bit" "Install full 64bit" "Quit")
  9. select system in "${options[@]}"
  10. do
  11. case $system in
  12. "Install full 32bit")
  13. echo "##Update and upgrade system##"
  14. apt-get update && apt-get upgrade -y
  15. echo "done"
  16. echo "##Installing needed files##"
  17. rm -r /usr/src/FOS-Streaming
  18. apt-get install libxml2-dev libbz2-dev libcurl4-openssl-dev libmcrypt-dev libmhash2 curl -y
  19. apt-get install libmhash-dev libpcre3 libpcre3-dev make build-essential libxslt1-dev git -y
  20. apt-get install libssl-dev -y
  21. apt-get install git -y
  22. apt-get install apache2 libapache2-mod-php5 php5 php5-mysql mysql-server phpmyadmin php5-fpm php5-curl unzip -y
  23. echo "done"
  24. echo "##Installing and configuring nginx and the FOS-Streaming panel##"
  25. #**************if you already have nginx remove it from this line**************#
  26. cd /usr/src/
  27. git clone https://github.com/arut/nginx-rtmp-module.git
  28. wget http://nginx.org/download/nginx-1.9.2.tar.gz
  29. tar -xzf nginx-1.9.2.tar.gz
  30. cd /usr/src/nginx-1.9.2/
  31. ./configure --add-module=/usr/src/nginx-rtmp-module --with-http_ssl_module --with-http_secure_link_module
  32. make
  33. make install
  34. #cp /usr/src/nginx-rtmp-module/stat.xsl /usr/local/nginx
  35. #**************NGINX INSTALL END LINE**************#
  36. rm -r /usr/local/nginx/conf/nginx.conf
  37. cd /usr/src/
  38. git clone https://github.com/zgelici/FOS-Streaming.git
  39. cd /usr/src/FOS-Streaming/
  40. mv /usr/src/FOS-Streaming/nginx.conf /usr/local/nginx/conf/nginx.conf
  41. mv /usr/src/FOS-Streaming/* /usr/local/nginx/html/
  42. cd /usr/src/
  43. curl -sS https://getcomposer.org/installer | php
  44. mv composer.phar /usr/local/bin/composer
  45. cd /usr/local/nginx/html/
  46. composer require illuminate/database
  47. echo 'www-data ALL = (root) NOPASSWD: /usr/local/bin/ffmpeg' >> /etc/sudoers
  48. echo 'www-data ALL = (root) NOPASSWD: /usr/local/bin/ffprobe' >> /etc/sudoers
  49. sed --in-place '/exit 0/d' /etc/rc.local
  50. echo "sleep 10" >> /etc/rc.local
  51. echo "/usr/local/nginx/sbin/nginx" >> /etc/rc.local
  52. echo "exit 0" >> /etc/rc.local
  53. mkdir /usr/local/nginx/html/hl
  54. chmod -R 777 /usr/local/nginx/html/hl
  55. mkdir /usr/local/nginx/html/cache
  56. chmod -R 777 /usr/local/nginx/html/cache
  57. chown www-data:www-data /usr/local/nginx/conf
  58. wget https://raw.github.com/JasonGiedymin/nginx-init-ubuntu/master/nginx -O /etc/init.d/nginx
  59. chmod +x /etc/init.d/nginx
  60. update-rc.d nginx defaults
  61. ### database import
  62. /usr/local/nginx/sbin/nginx
  63. echo "done"
  64. echo "##Downloading and configuring ffmpeg 32bit##"
  65. cd /usr/src/
  66. wget http://johnvansickle.com/ffmpeg/builds/ffmpeg-git-32bit-static.tar.xz
  67. tar -xJf ffmpeg-git-32bit-static.tar.xz
  68. cd ffmpeg*
  69. cp ffmpeg /usr/local/bin/ffmpeg
  70. cp ffprobe /usr/local/bin/ffprobe
  71. chmod 755 /usr/local/bin/ffmpeg
  72. chmod 755 /usr/local/bin/ffprobe
  73. cd /usr/src/
  74. rm -r /usr/src/ffmpeg*
  75. echo "installation finshed."
  76. echo "go to http://host/phpmyadmin and upload the database.sql file which is located in /usr/local/nginx/html/"
  77. echo "configure /usr/local/nginx/html/config.php"
  78. echo "login: http://host:8000 username: admin - password: admin"
  79. echo "After login go to settings and change web ip port to your public server ip"
  80. exit
  81. ;;
  82. "Install full 64bit")
  83. echo "##Update and upgrade system##"
  84. apt-get update && apt-get upgrade -y
  85. echo "done"
  86. echo "##Installing needed files##"
  87. rm -r /usr/src/FOS-Streaming
  88. apt-get install libxml2-dev libbz2-dev libcurl4-openssl-dev libmcrypt-dev libmhash2 curl -y
  89. apt-get install libmhash-dev libpcre3 libpcre3-dev make build-essential libxslt1-dev git -y
  90. apt-get install libssl-dev -y
  91. apt-get install git -y
  92. apt-get install apache2 libapache2-mod-php5 php5 php5-mysql mysql-server phpmyadmin php5-fpm php5-curl unzip -y
  93. echo "done"
  94. echo "##Installing and configuring nginx and the FOS-Streaming panel##"
  95. #**************if you already have nginx remove it from this line**************#
  96. cd /usr/src/
  97. git clone https://github.com/arut/nginx-rtmp-module.git
  98. wget http://nginx.org/download/nginx-1.9.2.tar.gz
  99. tar -xzf nginx-1.9.2.tar.gz
  100. cd /usr/src/nginx-1.9.2/
  101. ./configure --add-module=/usr/src/nginx-rtmp-module --with-http_ssl_module --with-http_secure_link_module
  102. make
  103. make install
  104. #cp /usr/src/nginx-rtmp-module/stat.xsl /usr/local/nginx
  105. #**************NGINX INSTALL END LINE**************#
  106. rm -r /usr/local/nginx/conf/nginx.conf
  107. cd /usr/src/
  108. git clone https://github.com/zgelici/FOS-Streaming.git
  109. cd /usr/src/FOS-Streaming/
  110. mv /usr/src/FOS-Streaming/nginx.conf /usr/local/nginx/conf/nginx.conf
  111. mv /usr/src/FOS-Streaming/* /usr/local/nginx/html/
  112. cd /usr/src/
  113. curl -sS https://getcomposer.org/installer | php
  114. mv composer.phar /usr/local/bin/composer
  115. cd /usr/local/nginx/html/
  116. composer require illuminate/database
  117. echo 'www-data ALL = (root) NOPASSWD: /usr/local/bin/ffmpeg' >> /etc/sudoers
  118. echo 'www-data ALL = (root) NOPASSWD: /usr/local/bin/ffprobe' >> /etc/sudoers
  119. sed --in-place '/exit 0/d' /etc/rc.local
  120. echo "sleep 10" >> /etc/rc.local
  121. echo "/usr/local/nginx/sbin/nginx" >> /etc/rc.local
  122. echo "exit 0" >> /etc/rc.local
  123.  
  124. mkdir /usr/local/nginx/html/hl
  125. chmod -R 777 /usr/local/nginx/html/hl
  126. mkdir /usr/local/nginx/html/cache
  127. chmod -R 777 /usr/local/nginx/html/cache
  128. chown www-data:www-data /usr/local/nginx/conf
  129. wget https://raw.github.com/JasonGiedymin/nginx-init-ubuntu/master/nginx -O /etc/init.d/nginx
  130. chmod +x /etc/init.d/nginx
  131. update-rc.d nginx defaults
  132. ### database import
  133. /usr/local/nginx/sbin/nginx
  134. echo "done"
  135. echo "Downloading and configuring ffmpeg 64bit"
  136. cd /usr/src/
  137. wget http://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz
  138. tar -xJf ffmpeg-release-64bit-static.tar.xz
  139. cd ffmpeg*
  140. cp ffmpeg /usr/local/bin/ffmpeg
  141. cp ffprobe /usr/local/bin/ffprobe
  142. chmod 755 /usr/local/bin/ffmpeg
  143. chmod 755 /usr/local/bin/ffprobe
  144. chown www-data:root /usr/local/nginx/html
  145. cd /usr/src/
  146. rm -r /usr/src/ffmpeg*
  147. echo "installation finshed."
  148. echo "go to http://host/phpmyadmin and upload the database.sql file which is located in /usr/local/nginx/html/"
  149. echo "configure /usr/local/nginx/html/config.php"
  150. echo "login: http://host:8000 username: admin - password: admin"
  151. echo "After login go to settings and change web ip port to your public server ip"
  152. exit
  153. ;;
  154. "Quit")
  155. break
  156. ;;
  157. *) echo invalid option;;
  158. esac
  159. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement