setup_nginx.sh 777 B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/bash
  2. sed -i 's|localhost|'"$DBHOST"'|g' src/Web.config
  3. # build
  4. . mono-snapshot mono/20141222114925
  5. cd src
  6. rm -rf bin obj
  7. xbuild Benchmarks.sln /p:Configuration=Release
  8. cd ..
  9. # nginx
  10. conf="upstream mono {\n"
  11. current=9001
  12. end=$(($current+$MAX_THREADS))
  13. while [ $current -lt $end ]; do
  14. conf+="\tserver 127.0.0.1:${current};\n"
  15. let current=current+1
  16. done
  17. conf+="}"
  18. echo -e $conf > $TROOT/nginx.upstream.conf
  19. $NGINX_HOME/sbin/nginx -c $TROOT/nginx.conf -g "worker_processes ${MAX_THREADS};"
  20. # Start fastcgi for each thread
  21. # To debug, use --printlog --verbose --loglevels=All
  22. current=9001
  23. end=$(($current+$MAX_THREADS))
  24. while [ $current -lt $end ]; do
  25. fastcgi-mono-server4 --applications=/:${pwd}/src --socket=tcp:127.0.0.1:$current &
  26. let current=current+1
  27. done