Dependency
- Setup Timezone
- Initialized CentOS Server
Option
Script
# Setup Timezone
function isinstalled {
if yum list installed | grep "$@"; then
true
else
false
fi
}
RED=`tput setaf 1`
GREEN=`tput setaf 2`
RESET=`tput sgr0`
if isinstalled "ntp"; then
echo "Install ntp .......... [${GREEN}OK${RESET}]";
else
yum install ntp -y;
mv /etc/localtime /etc/localtime.bak
ln -s /usr/share/zoneinfo/Asia/Bangkok /etc/localtime
ntpd
chkconfig ntpd on
echo "Install ntp .......... [${GREEN}Installed${RESET}]";
fi
# Initialized CentOS Server
yum groupinstall "Development tools" -y
yum install nano wget -y
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel -y
yum install libjpeg-devel freetype-devel libpng-devel -y
yum install libxml2-devel libxslt-devel -y
yum install epel-release -y
setenforce 0
# TODO: disable
# nano /etc/selinux/config
# SELINUX=disabled
# Install MySQL
yum install mysql-devel mysql-server mysql -y
chkconfig mysqld on
service mysqld start
mysql_secure_installation