Skip to content

Instantly share code, notes, and snippets.

@OSapozhnikov
Last active March 23, 2017 15:06
Show Gist options
  • Save OSapozhnikov/e1e52ee19ff1de6eb33299883b6d4c6c to your computer and use it in GitHub Desktop.
Save OSapozhnikov/e1e52ee19ff1de6eb33299883b6d4c6c to your computer and use it in GitHub Desktop.

Revisions

  1. OSapozhnikov revised this gist Mar 23, 2017. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion baseServerConfigCentOS.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,5 @@
    #!/usr/bin/env bash
    echo " -> Starting Marker"
    sudo su
    echo " -> Add repository"
    rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
    rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
  2. OSapozhnikov created this gist Mar 23, 2017.
    49 changes: 49 additions & 0 deletions baseServerConfigCentOS.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,49 @@
    #!/usr/bin/env bash
    echo " -> Starting Marker"
    sudo su
    echo " -> Add repository"
    rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
    rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
    rpm -Uvh http://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
    rpm -Uvh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm
    rpm --import http://repo.zabbix.com/RPM-GPG-KEY-ZABBIX
    yum clean all
    yum update -y
    echo " -> Config timezone"
    timedatectl set-timezone Asia/Jerusalem

    echo " -> Install packages"
    yum install -y curl htop nmap wget bzip2 perl mlocate fail2ban lnav
    yum install -y httpd mod_ssl memcached php56w php56w-common php56w-mcrypt php56w-cli php56w-gd php56w-xml php56w-xmlrpc php56w-opcache php56w-bcmath php56w-mbstring php56w-pecl-memcache php56w-mysqlnd
    curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
    chmod +x /usr/local/bin/composer

    echo " -> Update PHP conf"
    sed -i 's/^post_max_size = 8M/post_max_size = 16M/' /etc/php.ini;
    sed -i 's/^upload_max_filesize = 2M/upload_max_filesize = 64M/' /etc/php.ini;
    sed -i 's/^max_execution_time = 30/max_execution_time = 60/' /etc/php.ini;
    sed -i 's/^; max_input_vars = 1000/max_input_vars = 2000/' /etc/php.ini;

    echo " -> Config and restart Apache"
    mkdir /etc/httpd/ssl
    mkdir /etc/httpd/sites-available
    mkdir /etc/httpd/sites-enabled
    echo "IncludeOptional sites-enabled/*.conf" >> /etc/httpd/conf/httpd.conf
    echo "ExtendedStatus On
    <Location "/server-status">
    SetHandler server-status
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
    </Location>" >> /etc/httpd/conf/httpd.conf

    systemctl enable httpd
    systemctl start httpd

    echo " -> Install mysql"
    yum -y install mysql

    echo " -> Disabled firewall"
    sed -i 's/^SELINUX=enforcing/SELINUX=disabled/' /etc/sysconfig/selinux;
    systemctl disable firewalld
    systemctl stop firewalld