centos 6.5 lnmp
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos 6.5 lnmp相关的知识,希望对你有一定的参考价值。
#!/bin/bash
echo "install nginx please waiting"
useradd -M -s /sbin/nologin nginx
yum -y install gcc-c++ zlib-devel pcre-devel ncurses-devel libxml2-devel openssl-devel bzip2-devel
cd /tmp &&tar xf nginx-1.9.3.tar.gz &&cd nginx-1.9.3/ &&./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_stub_status_module
make && make install
if [ $? -eq 0 ];then
echo "/usr/local/nginx/sbin/nginx" >> /etc/rc.d/rc.local &&/usr/local/nginx/sbin/nginx
else
echo "install nginx shibai"
exit
fi
echo "install mysql please waiting"
useradd -M -s /sbin/nologin mysql
cd /tmp/ &&tar xf mysql-5.1.55.tar.gz &&cd mysql-5.1.55 &&./configure --prefix=/usr/local/mysql --with-charset=utf8 --with-collation=utf8_general_ci --with-extra-charsets=gbk,gb2312
if [ $? -eq 0 ];then
make &&make install
echo "ok"
else
echo "install mysql shibai"
exit
fi
yes|cp -f support-files/my-medium.cnf /etc/my.cnf
yes|cp -f support-files/mysql.server /etc/init.d/mysqld
if [ $? -eq 0 ];then
chkconfig --add mysqld
chmod 755 /etc/init.d/mysqld
ln -s /usr/local/mysql/bin/* /bin
else
echo "tianjia --add shibai"
exit
fi
if [ -e /usr/local/mysql/bin/mysql_install_db ];then
/usr/local/mysql/bin/mysql_install_db --user=mysql
else
echo "chushihua shibai"
exit
fi
chown -R root:mysql /usr/local/mysql/
chown -R mysql /usr/local/mysql/var/
/etc/init.d/mysqld start
echo "/etc/init.d/mysqld restart" >> /etc/rc.d/rc.local
echo "install php please waiting"
cd /tmp &&tar xf php-5.3.6.tar.gz &&cd php-5.3.6/ &&./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-libxml-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --with-openssl --with-config-file-path=/usr/local/php --enable-soap --enable-mbstring --enable-sockets --enable-exif --disable-ipv6 --enable-fpm
if [ $? -eq 0 ];then
make &&make install
else
echo "install php shibai"
exit
fi
if [ -e /usr/local/php/php.ini ];then
echo "file cunzai ok"
else
yes|cp /tmp/php-5.3.6/php.ini-development /usr/local/php/php.ini
fi
yes|cp -f /tmp/php-fpm.conf /usr/local/php/etc/php-fpm.conf
echo "/usr/local/php/sbin/php-fpm" >> /etc/rc.d/rc.local
/usr/local/php/sbin/php-fpm
以上是关于centos 6.5 lnmp的主要内容,如果未能解决你的问题,请参考以下文章