PageRenderTime 3388ms CodeModel.GetById 25ms RepoModel.GetById 3ms app.codeStats 0ms

/tatooine/home/azuremaster/scripts/server_first_install.sh

https://gitlab.com/fbatiga/config-files
Shell | 46 lines | 42 code | 3 blank | 1 comment | 25 complexity | 8997618b97eae6024bcbb370f5ebe1d4 MD5 | raw file
  1. #!/bin/bash
  2. apt-get update && \
  3. apt-get install -y python-software-properties software-properties-common apt-utils
  4. export LC_ALL=C.UTF-8
  5. export LANG=en_US.UTF-8
  6. export LANGUAGE=en_US
  7. export LC_ALL=en_US.UTF-8
  8. locale-gen
  9. add-apt-repository ppa:ondrej/php
  10. cat /dev/zero | ssh-keygen -q -N ""
  11. apt-get update
  12. apt-get install nginx && \
  13. apt-get install -y nano sudo git logrotate zip unzip htop php5.6-cli php5.6-fpm php5.6-bcmath php5.6-mongodb php5.6-redis && \
  14. apt-get install -y php5.6-bz2 php5.6-dba php5.6-imap php5.6-intl php5.6-mcrypt php5.6-soap php5.6-tidy && \
  15. apt-get install -y php5.6-common php5.6-curl php5.6-gd php5.6-mysql php5.6-xml php5.6-zip php5.6-gettext php5.6-mbstring && \
  16. mkdir /tmp/composer/ && \
  17. cd /tmp/composer && \
  18. curl -sS https://getcomposer.org/installer | php && \
  19. mv composer.phar /usr/local/bin/composer && \
  20. chmod a+x /usr/local/bin/composer && \
  21. cd / && \
  22. rm -rf /tmp/composer && \
  23. apt-get remove -y python-software-properties software-properties-common && \
  24. apt-get autoremove -y && \
  25. rm -rf /var/lib/apt/lists/*
  26. sed -i -e '/s%admin ALL=(ALL) ALL/%admin ALL=(ALL) PASSWORD: ALL/' /etc/sudoers
  27. useradd -m -p -s /bin/bash azuremaster
  28. cd /home/azuremaster
  29. git clone git@gitlab.com:kenweego/config-files.git
  30. cd config-files
  31. cp -R tatooine/* /
  32. chown -R azuremaster:azuremaster /home/azuremaster
  33. rm -rf /etc/nginx/sites-enabled/default /etc/nginx/sites-available/default && \
  34. sed -i -e 's/^user = www-data$/;user = www-data/g' /etc/php/5.6/fpm/pool.d/www.conf && \
  35. sed -i -e 's/^group = www-data$/;group = www-data/g' /etc/php/5.6/fpm/pool.d/www.conf && \
  36. sed -i -e 's/^listen.owner = www-data$/;listen.owner = www-data/g' /etc/php/5.6/fpm/pool.d/www.conf && \
  37. sed -i -e 's/^listen.group = www-data$/;listen.group = www-data/g' /etc/php/5.6/fpm/pool.d/www.conf && \
  38. sed -i -e 's/fastcgi_param SERVER_PORT $server_port;/fastcgi_param SERVER_PORT $http_x_forwarded_port;/g' /etc/nginx/fastcgi_params && \
  39. mkdir --mode 777 /var/run/php && \
  40. chmod 755 /hooks /var/www && \
  41. chmod -R 777 /var/www/html /var/log && \
  42. chmod 666 /etc/nginx/sites-enabled/ /etc/passwd /etc/group && \
  43. mkdir /apps && chmod 777 /apps