Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #****************************************/
- #* @Project: wmc_serverscripts */
- #* @Author: Joel Kuder */
- #* @Filename: wmc_srv_install_brokerstar*/
- #* Aenderung: 08.06.2016 */
- #****************************************/
- ICH=`whoami`;
- if [[ $ICH != root ]];then
- echo "Sorry Bro, you are not root"
- exit 1
- fi
- echo "----------------- ADD NEW REPO's -----------------"
- apt-get install --allow-unauthenticated -y apt-transport-https
- echo -e "deb http://packages.dotdeb.org jessie all\n deb-src http://packages.dotdeb.org jessie all\n" > /etc/apt/sources.list.d/dotdeb.list
- echo -e "deb http://www.d7031.de/debian jessie-experimental main\n" > /etc/apt/sources.list.d/http2.list
- echo -e "deb http://dl.google.com/linux/mod-pagespeed/deb/ stable main \n" > /etc/apt/sources.list.d/mod-pagespeed.list
- echo -e "deb https://deb.nodesource.com/node_4.x jessie main\n deb-src https://deb.nodesource.com/node_4.x jessie main\n" > /etc/apt/sources.list.d/nodesource.list
- wget https://www.dotdeb.org/dotdeb.gpg
- apt-key add dotdeb.gpg
- apt-get update && apt-get dist-upgrade --allow-unauthenticated
- echo -e "______________________________________________________\n\n"
- echo "----------------- wkhtmltopdf -----------------"
- cd /tmp/
- wget https://github.com/h4cc/wkhtmltopdf-amd64/archive/0.12.3.tar.gz
- tar -zxvf 0.12.3.tar.gz wkhtmltopdf-amd64-0.12.3/bin/wkhtmltopdf-amd64
- mv wkhtmltopdf-amd64-0.12.3/bin/wkhtmltopdf-amd64 /usr/local/bin/wkhtmltopdf
- rm 0.12.3.tar.gz
- echo -e "______________________________________________________\n\n"
- echo "----------------- Install required Packages for Brokerstar -----------------"
- apt-get update && apt-get dist-upgrade --allow-unauthenticated && apt-get install --allow-unauthenticated -y sudo curl build-essential node-uglify apache2 libapache2-mod-php7.0 node-uglify mysql-client vim-nox git apachetop mytop vnstat htop dnstop iftop ssh memcached libmemcached-tools openssh-server xvfb fontconfig libxrender1 libfontconfig1 pdftk ttf-mscorefonts-installer php7.0 php7.0-apcu php7.0-cli php7.0-bz2 php7.0-common php7.0-curl php7.0-gd php7.0-intl php7.0-imap php7.0-json php7.0-mysql php7.0-readline php7.0-opcache php7.0-soap php7.0-bcmath php7.0-xml php7.0-zip php7.0-mbstring php7.0-memcached
- echo -e "______________________________________________________\n\n"
- echo "----------------- write php.ini configs -----------------"
- echo -e "post_max_size=100M \n upload_max_filesize=100M \n date.timezone = \"Europe/Zurich\" \n memory_limit = 512M \n max_input_vars = 10000 \n " >> /etc/php/7.0/apache2/php.ini
- echo "----------------- enable new apache modules -----------------"
- a2enmod http2
- a2enmod ssl
- a2enmod rewrite
- a2enmod expires
- a2enmod proxy_http
- a2enmod proxy_http2
- a2enmod proxy
- echo "----------------- Install Composer -----------------"
- cd /tmp/
- curl -sS https://getcomposer.org/installer | php
- mv composer.phar /usr/local/bin/composer
- echo "----------------- Install nodejs -----------------"
- curl -sL https://deb.nodesource.com/setup_4.x | bash -
- apt-get install --allow-unauthenticated -y nodejs
- echo "----------------- Install UglifyCSS -----------------"
- cd /usr/bin/
- git clone git://github.com/fmarcia/UglifyCSS.git
- mv UglifyCSS /usr/local/bin/uglifycss
- echo "----------------- Adduser WMC ------------------------"
- echo "-> für ssh dev zugang und apache user"
- PASS=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12)
- adduser --disabled-password wmc
- echo "wmc:".${PASS} | chpasswd
- echo "----------------- Adduser bash_profile ------------------------"
- mkdir /home/wmc
- cp /opt/wmc_serverscripts/src/debian/root/.bash_profile /home/wmc/.bash_profile
- cp /opt/wmc_serverscripts/src/debian/root/.dircolorsrc /home/wmc/.dircolorsrc
- chown wmc:wmc /home/wmc/.bash_profile
- chown wmc:wmc /home/wmc/.dircolorsrc
- echo "----------------- Gebe volle SUDO rechte an WMC ------"
- echo "wmc ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
- service sudo restart
- echo "----------------- ändere Apache user auf wmc ------"
- echo -e "\n\nexport APACHE_RUN_USER=wmc\nexport APACHE_RUN_GROUP=wmc\n" >> /etc/apache2/envvars
- service apache2 restart
- echo "----------------- ändere Apache user auf wmc ------"
- cp /opt/wmc_serverscripts/src/default_html/var/www/html/* /var/www/html
- chown wmc:wmc /var/www -R
- echo "----------------- ssh key für wmc ------"
- #GIT
- mkdir /home/wmc/.ssh
- ssh-keygen -t rsa -b 4096 -f /home/wmc/.ssh/id_rsa
- cat /home/wmc/.ssh/id_rsa.pub
- chown wmc:wmc /home/wmc/.ssh -R
- echo "----------------- log ordner für wmc ------"
- mkdir /var/log/wmc
- chown wmc:wmc /var/log/wmc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement