Skip to content

Instantly share code, notes, and snippets.

@cblanquera
Last active December 11, 2017 04:56
Show Gist options
  • Save cblanquera/d01b1706f9bf245f34f5fcd4a5a58ca8 to your computer and use it in GitHub Desktop.
Save cblanquera/d01b1706f9bf245f34f5fcd4a5a58ca8 to your computer and use it in GitHub Desktop.
PHP 7 MySQL 5.7 Redis 2.8.3 Elastic 5.1 RabitMQ 3.6.6 CentOS 6

ElasticSearch 5.1

sudo yum install java-1.8.0-openjdk.x86_64
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
vi /etc/yum.repos.d/elasticsearch.repo

Paste

[elasticsearch-5.x]
name=Elasticsearch repository for 5.x packages
baseurl=https://artifacts.elastic.co/packages/5.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
yum install elasticsearch
vi ~/.ssh/bash_profile
export ES_HEAP_SIZE=10g
chkconfig --add elasticsearch
chkconfig elasticsearch on
service elasticsearch start

MySQL 5.7

yum localinstall https://dev.mysql.com/get/mysql57-community-release-el6-9.noarch.rpm
yum install mysql-community-server
chkconfig mysqld on
service mysql start

PHP 7

yum remove php*
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
yum install php70w php70w-opcache php70w-bcmath php70w-cli php70w-common php70w-gd php70w-imap php70w-mbstring php70w-mcrypt php70w-mysqlnd php70w-pdo php70w-pgsql php70w-xml php70w-pecl-redis
service httpd restart

RabbitMQ 3.6.6

yum -y update
wget https://www.rabbitmq.com/releases/erlang/erlang-18.2-1.el6.x86_64.rpm
sudo rpm -ivh erlang-18.2-1.el6.x86_64.rpm
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
rpm -i epel-release-latest-6.noarch.rpm
yum install socat
wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.6/rabbitmq-server-3.6.6-1.el6.noarch.rpm
rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
yum install rabbitmq-server-3.6.6-1.el6.noarch.rpm
rabbitmq-plugins enable rabbitmq_management
cd /usr/lib/rabbitmq/lib/rabbitmq_server-3.6.6/plugins/
wget https://bintray.com/rabbitmq/community-plugins/download_file?file_path=rabbitmq_delayed_message_exchange-0.0.1.ez
mv download_file?file_path=rabbitmq_delayed_message_exchange-0.0.1.ez rabbitmq_delayed_message_exchange-0.0.1.ez
cd ~
rabbitmq-plugins enable rabbitmq_delayed_message_exchange
chkconfig rabbitmq-server on
service rabbitmq-server start

Redis 2.8.3

rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
vi /etc/sysctl.conf

Add vm.overcommit_memory=1

sysctl vm.overcommit_memory=1
sysctl -w fs.file-max=100000
chkconfig --add redis
chkconfig redis on
chkconfig --level 345 redis on
service redis start/stop/restart

Supervisord 3.3.1

yum -y update
yum install python-setuptools
easy_install supervisor
echo_supervisord_conf > /etc/supervisord.conf
mkdir /etc/supervisord.d/
vi /etc/supervisord.conf

Add files = /etc/supervisord.d/*.conf at the bottom

Remove comment from [inet_http_server] and port=

Change port to *:9001

vi /etc/rc.d/init.d/supervisord
#!/bin/sh
#
# /etc/rc.d/init.d/supervisord
#
# Supervisor is a client/server system that
# allows its users to monitor and control a
# number of processes on UNIX-like operating
# systems.
#
# chkconfig: - 64 36
# description: Supervisor Server
# processname: supervisord

# Source init functions
. /etc/rc.d/init.d/functions

prog="supervisord"

prefix="/usr/"
exec_prefix="${prefix}"
prog_bin="${exec_prefix}/bin/supervisord"
PIDFILE="/var/run/$prog.pid"

start()
{
       echo -n $"Starting $prog: "
       daemon $prog_bin --pidfile $PIDFILE
       [ -f $PIDFILE ] && success $"$prog startup" || failure $"$prog startup"
       echo
}

stop()
{
       echo -n $"Shutting down $prog: "
       [ -f $PIDFILE ] && killproc $prog || success $"$prog shutdown"
       echo
}

case "$1" in

 start)
   start
 ;;

 stop)
   stop
 ;;

 status)
       status $prog
 ;;

 restart)
   stop
   start
 ;;

 *)
   echo "Usage: $0 {start|stop|restart|status}"
 ;;

esac
chmod +x /etc/rc.d/init.d/supervisord
chkconfig --add supervisord
chkconfig supervisord on
service supervisord start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment