Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Anonymous
Tuesday, December 10th, 2013 at 1:22:08am UTC 

  1. #!/bin/bash
  2. #CentOS 6.4 Commafeed setup script
  3.  
  4. #Install CentOS 6.4 - Minimal
  5. #1x vCPU
  6. #1GB RAM
  7. #8GB Disk
  8.  
  9. #Base build update
  10. yum update -y
  11.  
  12. #Add 3rd party yum Repos:
  13. yum install -y wget
  14. rpm -ivh http://mirror.pnl.gov/epel/6/i386/epel-release-6-8.noarch.rpm
  15. wget -O /etc/yum.repos.d/epel-apache-maven.repo http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo
  16.  
  17. #Install required packages from additional repos
  18. yum install -y git unzip httpd mod_ssl java-1.7.0-openjdk java-1.7.0-openjdk-devel apache-maven
  19.  
  20. #cleanup
  21. yum clean all
  22.  
  23. #build environment fixups
  24. export PATH=$PATH:/usr/share/apache-maven/bin
  25. export JAVA_HOME=/usr/lib/jvm/jre-1.7.0-openjdk.x86_64/
  26. ln -s /usr/share/apache-maven/bin/mvn /usr/bin/mvn
  27.  
  28. #Build commafeed:
  29. git clone https://github.com/Athou/commafeed.git
  30. cd commafeed
  31. mvn clean package tomee:build -Pprod
  32.  
  33. #install commafeed
  34. mkdir -p /opt/commafeed/logs
  35. cd /opt/commafeed
  36. unzip $HOME/commafeed/target/commafeed.zip
  37. echo 'export JAVA_OPTS="-Djava.net.preferIPv4Stack=true -Xmx1024m -XX:MaxPermSize=256m -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC"' > bin/setenv.sh
  38. chmod +x bin/*.sh
  39.  
  40. #create commafeed user so we don't run as root
  41. useradd -d /opt/commafeed -s /bin/bash -c "commafeed" commafeed
  42. chown -R commafeed:commafeed /opt/commafeed/
  43.  
  44. #allow https through firewall
  45. iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
  46. service iptables save
  47.  
  48. #configure https proxy through apache:
  49. setsebool -P httpd_can_network_connect 1
  50.  
  51. cat << EOF > /etc/httpd/conf.d/commafeed.conf
  52. <Location /commafeed>
  53.     ProxyPass http://localhost:8082/commafeed
  54.     ProxyPassReverse http://localhost:8082/commafeed
  55. </Location>
  56. EOF
  57.  
  58. #Enable apache
  59. chkconfig httpd on
  60.  
  61. #configure startup script for commafeed:
  62.  
  63. cat << EOF > /etc/init.d/commafeed
  64. #!/bin/bash
  65. #
  66. ### BEGIN INIT INFO
  67. # Provides: commafeed
  68. # Short-Description: CommaFeed
  69. # Description: CommaFeed RSS reader application
  70. ### END INIT INFO
  71.  
  72. # chkconfig: - 90 10
  73.  
  74. # See how we were called.
  75. case "\$1" in
  76.   start)
  77.         pgrep -f 'java.*commafeed' || su - commafeed -c /opt/commafeed/bin/startup.sh
  78.         ;;
  79.   stop)
  80.         pgrep -f 'java.*commafeed' && su - commafeed -c /opt/commafeed/bin/shutdown.sh
  81.         ;;
  82.   *)
  83.         echo \$"Usage: \$0 {start|stop}"
  84.         exit 2
  85. esac
  86.  
  87. exit \$?
  88.  
  89. EOF
  90.  
  91. chmod +x /etc/init.d/commafeed
  92. chkconfig --add commafeed
  93. chkconfig commafeed on
  94.  
  95. #Reboot to enable updates and start everything
  96. reboot
  97.  
  98. #
  99. # When the system restarts, CommaFeed will take a momment to start
  100. # Browse to the site (accept self-signed certificate)
  101. # Replace xx.xx.xx.xx in the URLs below with your IP or hostname
  102. #
  103. # https://xx.xx.xx.xx/commafeed
  104. #
  105. # user: admin
  106. # pass: admin
  107. #
  108. # Set public URL on the to the same as above on the application
  109. # settings page: https://xx.xx.xx.xx/commafeed/#/admin/settings
  110. #
  111. # Change the admin user password and create new user on the user
  112. # management page: https://xx.xx.xx.xx:8082/commafeed/#/admin/user/list
  113. #
  114. # Don't forget to delete the demo user
  115. #

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

comments powered by Disqus
worth-right
worth-right