Last active
May 31, 2016 07:37
-
-
Save kudarap/75e179273baba3bc8043 to your computer and use it in GitHub Desktop.
OL Server Stack CentOS 6 (run with sudo)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Apache 2 & PHP 5.6 | |
cd ~ | |
yum update -y | |
yum install -y httpd httpd-devel | |
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm | |
yum install -y php56w php56w-opcache php56w-devel php56w-gd php56w-imap php56w-mcrypt php56w-mysql php56w-pdo php56w-pear | |
yum install -y php56w-pecl-geoip php56w-pgsql php56w-bcmath php56w-mbstring git | |
wget https://phar.phpunit.de/phpunit.phar | |
chmod +x phpunit.phar | |
sudo mv phpunit.phar /usr/bin/phpunit | |
phpunit --version | |
curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar | |
chmod +x phpcs.phar | |
sudo mv phpcs.phar /usr/bin/phpcs | |
curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar | |
chmod +x phpcbf.phar | |
sudo mv phpcbf.phar /usr/bin/phpcbf | |
sudo sh -c "echo 'precedence ::ffff:0:0/96 100' >> /etc/gai.conf" | |
curl -sS https://getcomposer.org/installer | php | |
chmod +x composer.phar | |
sudo mv composer.phar /usr/bin/composer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cdh | |
# add fqdn hostname on hosts file | |
# ex 10.10.10.10 cdh-0.novalocal cdh-0 | |
wget http://archive.cloudera.com/cm5/installer/latest/cloudera-manager-installer.bin | |
chmod u+x cloudera-manager-installer.bin | |
sudo ./cloudera-manager-installer.bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# nutch 2.3, JDK 7, HBase 0.94.26, and ElasticSearch 1.4.2 | |
cd ~ | |
# setting up deps | |
yum install java-1.7.0-openjdk -y | |
yum install java-1.7.0-openjdk-devel -y | |
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.8.4-bin.tar.gz | |
tar xvzf apache-ant-1.8.4-bin.tar.gz | |
mv apache-ant-1.8.4 /opt/ant | |
export JAVA_HOME=/usr/lib/jvm/java-openjdk/ | |
export JRE_HOME=/usr/lib/jvm/jre-openjdk/ | |
export ANT_HOME=/opt/ant | |
export PATH=$PATH:$ANT_HOME/bin | |
echo '# crawler setup' >> /etc/profile | |
echo 'export JAVA_HOME=/usr/lib/jvm/java-openjdk/' >> /etc/profile | |
echo 'export JRE_HOME=/usr/lib/jvm/jre-openjdk/' >> /etc/profile | |
echo 'export ANT_HOME=/opt/ant' >> /etc/profile | |
echo 'export PATH=$PATH:$ANT_HOME/bin' >> /etc/profile | |
cd /server; mkdir crawler; cd /crawler | |
# setting up tools | |
wget https://archive.apache.org/dist/hbase/hbase-0.94.26/hbase-0.94.26.tar.gz | |
wget http://mirror.rise.ph/apache/nutch/2.3/apache-nutch-2.3-src.tar.gz | |
tar xvzf hbase-0.94.26.tar.gz | |
tar xvzf apache-nutch-2.3-src.tar.gz | |
# packing tools | |
mv hbase-0.94.26 hbase-0.94 | |
mv apache-nutch-2.3 nutch-2.3 | |
# configuring tools | |
# config hbase | |
# get your name machine name using `hostname` | |
# add `127.0.0.1 [hostname]` to your /etc/hosts | |
# follow this https://gist.github.com/xrstf/b48a970098a8e76943b9 | |
# skip ElasticSearch config | |
# set tike as html parser on parse-plugins.xml | |
# add custom hook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# hadoop | |
sudo yum update -y | |
sudo yum install java-1.8.0-openjdk-devel.x86_64 -y | |
sudo mkdir /server | |
sudo chown dhc-user:dhc-user /server | |
mkdir -p /server/deep/data | |
mkdir -p /server/deep/tmp | |
cd /server/deep | |
wget http://apache.claz.org/hadoop/common/hadoop-2.6.3/hadoop-2.6.3.tar.gz | |
tar xzf hadoop-2.6.3.tar.gz | |
mv hadoop-2.6.3 hadoop | |
echo '# hadoop setup' >> ~/.bashrc | |
echo 'export JAVA_HOME=/etc/alternatives/java_sdk_1.8.0' >> ~/.bashrc | |
echo 'export JRE_HOME=$JAVA_HOME/jre' >> ~/.bashrc | |
echo 'export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin' >> ~/.bashrc | |
echo 'export HADOOP_HOME=/server/deep/hadoop' >> ~/.bashrc | |
echo 'export HADOOP_INSTALL=$HADOOP_HOME' >> ~/.bashrc | |
echo 'export HADOOP_MAPRED_HOME=$HADOOP_HOME' >> ~/.bashrc | |
echo 'export HADOOP_COMMON_HOME=$HADOOP_HOME' >> ~/.bashrc | |
echo 'export HADOOP_HDFS_HOME=$HADOOP_HOME' >> ~/.bashrc | |
echo 'export YARN_HOME=$HADOOP_HOME' >> ~/.bashrc | |
echo 'export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native' >> ~/.bashrc | |
echo 'export PATH=$PATH:$HADOOP_HOME/sbin:$HADOOP_HOME/bin' >> ~/.bashrc | |
source ~/.bashrc | |
# openovate hadoop etc mod | |
rm -rf hadoop/etc | |
wget http://trash.chiligarlic.com/ol-hadoop-etc.tar.bz2 | |
tar jxvf ol-hadoop-etc.tar.bz2 | |
ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa | |
cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys | |
sudo su | |
echo '127.0.0.1' `hostname` >> /etc/hosts | |
exit | |
cd /server/deep | |
hadoop/bin/hdfs namenode -format | |
hadoop/sbin/start-dfs.sh | |
hadoop/sbin/start-yarn.sh | |
cd ~ | |
echo done! visit http://127.0.0.1:50070 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# mongo 3.0 | |
cd /etc/yum.repos.d/ | |
echo '[MongoDB]' > mongodb.repo | |
echo 'name=MongoDB Repository' >> mongodb.repo | |
echo 'baseurl=http://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.0/x86_64/' >> mongodb.repo | |
echo 'gpgcheck=0' >> mongodb.repo | |
echo 'enabled=1' >> mongodb.repo | |
echo '' >> /etc/profile | |
echo 'export LC_ALL=C' >> /etc/profile | |
export LC_ALL=C | |
yum install mongodb-org -y | |
service mongod restart | |
chkconfig mongod on | |
mongo --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MySQL 5.6 & phpMyAdmin | |
cd ~ | |
yum update -y | |
wget http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm | |
yum localinstall mysql57-community-release-el6-*.noarch.rpm -y | |
# switch to 5.6 by editing the repo | |
yum install yum-utils -y | |
yum-config-manager --disable mysql57-community | |
yum-config-manager --enable mysql56-community | |
yum install mysql-community-server -y | |
service mysqld start | |
chkconfig mysqld on | |
chkconfig --list mysqld | |
mysql_secure_installation | |
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm | |
yum --enablerepo=remi install phpmyadmin -y | |
# fix forbidden phpmyadmin | |
cd /etc/httpd/conf | |
echo '' >> httpd.conf | |
echo '<Directory "/usr/share/phpMyAdmin">' >> httpd.conf | |
echo ' Order allow,deny' >> httpd.conf | |
echo ' Allow from all' >> httpd.conf | |
echo '</Directory>' >> httpd.conf | |
service httpd restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# dynamic host | |
cd /; mkdir server; chmod 777 server; mkdir server/conf; mkdir server/conf/apache; mkdir server/public; cd server/conf/apache; | |
echo '# server root' > httpd.conf | |
echo 'DocumentRoot "/server"' >> httpd.conf | |
echo '<Directory "/server">' >> httpd.conf | |
echo ' Options Indexes FollowSymLinks MultiViews' >> httpd.conf | |
echo ' AllowOverride All' >> httpd.conf | |
echo ' Order allow,deny' >> httpd.conf | |
echo ' Allow from all' >> httpd.conf | |
echo '</Directory>' >> httpd.conf | |
echo '' >> httpd.conf | |
echo '# aliens' >> httpd.conf | |
echo '<VirtualHost *:80>' >> httpd.conf | |
echo ' ServerAlias *' >> httpd.conf | |
echo ' UseCanonicalName Off' >> httpd.conf | |
echo ' VirtualDocumentRoot /server/public/%0/current' >> httpd.conf | |
echo ' VirtualScriptAlias /server/public/%0/current' >> httpd.conf | |
echo '</VirtualHost>' >> httpd.conf | |
# include to custom server config | |
cd /etc/httpd/conf | |
echo '' >> httpd.conf | |
echo '# server conf' >> httpd.conf | |
echo 'Include /server/conf/apache/*.conf' >> httpd.conf | |
service httpd restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# supervisord & rabbitmq | |
cd ~ | |
wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.5.6/rabbitmq-server-3.5.6-1.noarch.rpm | |
wget http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm | |
rpm -Uvh erlang-solutions-1.0-1.noarch.rpm | |
rpm --import https://www.rabbitmq.com/rabbitmq-signing-key-public.asc | |
yum install rabbitmq-server-3.5.6-1.noarch.rpm -y | |
service rabbitmq-server start | |
chkconfig rabbitmq-server on | |
easy_install supervisor | |
echo_supervisord_conf > /etc/supervisord.conf | |
# add custom config | |
echo '' >> /etc/supervisord.conf | |
echo '[include]' >> /etc/supervisord.conf | |
echo 'files = /server/conf/supervisord/*.conf' >> /etc/supervisord.conf | |
supervisord -c /etc/supervisord.conf | |
# root exit | |
exit | |
mkdir /server/conf/supervisord |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment