cd $install_dir
groupadd mysql
useradd -g mysql mysql
tar -zxvf $mysql_name
if [ -d $install_dir/$mysql_SFX_name ]
then
cp -a ./$mysql_SFX_name /usr/local/mysql
else
exit
fi
cd /usr/local/
chown -R mysql:mysql mysql
cd mysql
if [ "`scripts/mysql_install_db --user=mysql|grep OK|sed '1d'`" = "OK" ]
then
cp support-files/my-medium.cnf /etc/my.cnf
cp support-files/mysql.server /etc/init.d/mysql
chmod 755 /etc/init.d/mysql
chkconfig --add mysql
chkconfig --level 3 mysql on
else
exit
fi
sed -i '/myisam_sort_buffer_size/a\\datadir = /var/lib/mysql' /etc/my.cnf
sed -i 's/3306/6036/g' /etc/my.cnf
sed -i 's/log-bin=mysql-bin/#log-bin=mysql-bin/' /etc/my.cnf
service mysql start
/usr/local/mysql/bin/mysqladmin -u root password ''
/usr/local/mysql/bin/mysqladmin -u root password '123456'
if [ -d $install_dir/$pcre_SFX_name ]
then
cd $pcre_SFX_name
$install_dir/$pcre_SFX_name/configure
if [ $? -eq 0 ]
then
make
else
exit
fi
if [ $? -eq 0 ]
then
make install
else
exit
fi
if [ $? -eq 0 ]
then
echo ok
else
exit
fi
else
exit
fi
cd $install_dir
tar zxvf $install_dir/$nginx_name
if [ -d $install_dir/$nginx_SFX_name ]
then
cd $nginx_SFX_name
$install_dir/$nginx_SFX_name/$bianyi_nginx
if [ $? -eq 0 ]
then
make
else
exit
fi
if [ $? -eq 0 ]
then
make install
else
exit
fi
if [ $? -eq 0 ]
then
cp $nginx_configuration/fcgi.conf /usr/local/nginx/conf/
cp $nginx_configuration/nginx /etc/init.d/
chmod 755 /etc/init.d/nginx
chkconfig --add nginx
chkconfig --level 3 nginx on
mkdir -p /var/log/nginx
cp $nginx_configuration/nginx.conf /usr/local/nginx/conf/
else
exit
fi