一健安装LNMP

#下载配置Yum

#rm -rf /etc/yum.repos.d/other

#mkdir /etc/yum.repos.d/other

#mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/other

#wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

#yum clean all

#yum makecache

#配置本地YUM

mount /dev/cdrom /media

rm -rf /etc/yum.repos.d/other

mkdir /etc/yum.repos.d/other

mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/other

cp /opt/CentOS-Media.repo /etc/yum.repos.d/

yum clean all

yum makecahce

#修改主机名

sed -i ‘2d‘ /etc/sysconfig/network

sed -i ‘1a HOSTNAME=zabbix‘ /etc/sysconfig/network

hostname zabbix

#安装源码Nginx

yum -y groupinstall "开发工具" "开发库"

yum -y install gcc gcc-c++ make zlib-devel ncurses-devel libxml2 libxml2-devel libjpeg-devel libpng-devel freetype openldap-devel openldap openssl openssl-devel pcre pcre-devel curl-devel freetype-devel net-snmp-devel mysql-devel

service httpd stop;chkconfig httpd off

service mysqld stop;chkconfig mysqld off;rm -rf /etc/init.d/mysqld

mv /etc/my.cnf /etc/my.cnf.old

sed -i ‘s/SELINUX=enforcing/SELINUX=disabled/g‘ /etc/selinux/config

service iptables stop;setenforce 0

useradd -M -s /sbin/nologin www

tar xf nginx-1.8.0.tar.gz

cd nginx-1.8.0

./configure --prefix=/usr/local/nginx  --pid-path=/usr/local/nginx/nginx.pid --user=www  --group=www --with-http_ssl_module  --with-http_flv_module --with-http_stub_status_module --with-http_gzip_static_module --http-client-body-temp-path=/usr/local/nginx/client --http-proxy-temp-path=/usr/local/nginx/proxy --http-fastcgi-temp-path=/usr/local/nginx/fcgi --http-uwsgi-temp-path=/usr/local/nginx/uwsgi --http-scgi-temp-path=/usr/local/nginx/scgi --with-pcre --without-http_rewrite_module

make

make install

rm -f /usr/local/nginx/conf/nginx.conf

cp /opt/nginx.conf /usr/local/nginx/conf/

cp /opt/nginx /etc/init.d/nginx

#安装cmake编译工具

cd /opt

tar xf cmake-2.8.10.2.tar.gz

cd cmake-2.8.10.2

./bootstrap --prefix=/usr/local/cmake

make

make install

#安装源码MySQL

cd /opt

useradd -M -s /sbin/nologin mysql

tar zxf mysql-5.5.14.tar.gz

cd mysql-5.5.14

/usr/local/cmake/bin/cmake  -DCMAKE_INSTALL_PREFIX=/usr/local/mysql  -DSYSCONFDIR=/etc -DMYSQL_DATADIR=/usr/local/mysql/data  -DMYSQL_TCP_PORT=3306 -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysqld.sock -DMYSQL_USER=mysql -DEXTRA_CHARSETS=all -DWITH_READLINE=1 -DWITH_SSL=system -DWITH_EMBEDDED_SERVER=1 -DENABLED_LOCAL_INFILE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_DEBUG=0 -DMYSQL_USER=mysql

make

make install

chown -R mysql:mysql /usr/local/mysql

/usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data

cp /opt/mysql-5.5.14/support-files/my-medium.cnf /etc/my.cnf

cp /opt/mysql-5.5.14/support-files/mysql.server /etc/init.d/mysqld

sed -i ‘1a /usr/local/mysql/lib/‘ /etc/ld.so.conf

ln -s /usr/local/mysql/bin/* /usr/sbin

ldconfig

#安装php的扩展包

cd /opt

tar xf mhash-0.9.9.9.tar.gz

cd mhash-0.9.9.9

./configure

make

make install

cd /opt

tar -zxf libiconv-1.13.1.tar.gz

cd libiconv-1.13.1

./configure

make

make install

cd /opt

tar zxf libmcrypt-2.5.8.tar.gz

cd libmcrypt-2.5.8

./configure

make

make install

ldconfig

cd /opt/libmcrypt-2.5.8/libltdl/

./configure --with-gmetad --enable-gexec --enable-ltdl-install

make

make install

ln -s /usr/local/lib/libmcrypt* /usr/lib/

ln -s /usr/local/lib/libmhash.* /usr/lib/

ldconfig

cd /opt

tar xf php-5.4.42.tar.gz

cd php-5.4.42

cp -r /usr/lib64/libldap* /usr/lib/

./configure  --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir=/usr/local --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fpm --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap --with-freetype-dir --with-gettext --with-fpm-user=www --with-fpm-group=www

make ZEND_EXTRA_LIBS=‘-liconv‘

make install

cp /opt/php-5.4.42/php.ini-production /usr/local/php/etc/php.ini

cp /opt/index.php /usr/local/nginx/html

cp /opt/testdb.php /usr/local/nginx/html

#配置启动fpm

cp /opt/php-fpm.conf /usr/local/php/etc/

cp /opt/php-5.4.42/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

#服务端配置LAMP使用环境

sed -i ‘s/;date.timezone =/date.timezone = Asia\/Shanghai/g‘ /usr/local/php/etc/php.ini

sed -i ‘s#max_execution_time = 30#max_execution_time = 300#g‘ /usr/local/php/etc/php.ini

sed -i ‘s#post_max_size = 8M#post_max_size = 32M#g‘ /usr/local/php/etc/php.ini

sed -i ‘s#max_input_time = 60#max_input_time = 300#g‘ /usr/local/php/etc/php.ini

sed -i ‘s/;mbstring.func_overload = 0/mbstring.func_overload = 2/g‘ /usr/local/php/etc/php.ini

#启动服务

chkconfig --add nginx;chkconfig nginx on;chmod +x /etc/init.d/nginx;service nginx start

chkconfig --add mysqld;chkconfig mysqld on;chmod +x /etc/init.d/mysqld;service mysqld start

chkconfig --add php-fpm;chkconfig php-fpm on;chmod +x /etc/init.d/php-fpm;service php-fpm start

时间: 2024-10-19 11:12:24

一健安装LNMP的相关文章

阿里云centos6.5实践编译安装LNMP架构web环境

LNMP 代表的就是:Linux系统下Nginx+MySQL+PHP这种网站服务器架构. 本次测试需求: **实践centos6.5编译安装 LNMP生产环境 架构 web生产环境 使用 ngx_pagespeed 优化前端 xcache 优化php 用 google_perftools 优化nginx 和 php内存分配 ** 作为 Web 服务器:相比 Apache,Nginx 使用更少的资源,支持更多的并发连接,体现更高的效率. 作为负载均衡服务器:Nginx 既可以在内部直接支持Rail

centos 5.5 安装 lnmp

centos5.5 安装 lnmp,一定要事先选好版本安装,建议自己下载安装. 1.相关文件目录: nginx: /www/nginx/下面mysql: /usr/share/mysql /usr/bin/mysql (安装时没有配置路径)php : /usr/local/php53 2 A) nginx 启动:/www/nginx/sbin/nginx -c /www/nginx/conf/nginx.conf查看: ps -ef | grep nginx停止:强制停止所有Nginx进程 ps

Mac下安装LNMP(Nginx+PHP5.6)环境

Mac下安装LNMP(Nginx+PHP5.6)环境 安装Homebrew 最近工作环境切换到Mac,所以以OS X Yosemite(10.10.1)为例,记录一下从零开始安装Mac下LNMP环境的过程 确保系统已经安装xcode,然后使用一行命令安装依赖管理工具Homebrew ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 之后就可以使用 brew

CentOS编译安装LNMP环境

这里是教大家如何在centos下利用源码编译安装LNMP环境. 工具/原料 centos服务器一台 自用电脑一台 准备篇 配置好IP.DNS .网关,确保使用远程连接工具能够连接服务器 配置防火墙,开启80端口.3306端口 vi /etc/sysconfig/iptables   #编辑防火墙配置文件 -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT(允许80端口通过防火墙) -A INPUT -m state -

CentOS6.5 编译安装lnmp环境

yum -y install gcc gcc-c++ automake autoconf libtool glibc make libmcrypt安装 mkdir /usr/local/source && cd /usr/local/source #创建并进入源文件目录 [[email protected] source ]# wget "http://downloads.sourceforge.net/mcrypt/libmcrypt-2.5.8.tar.gz?modtime=

cenos6.5源码包安装lnmp环境

虽然centos6可以用yum安装nginx,但是我还是写个教程用源码包安装用于线上环境. 一:在nginx官网下载nginx,并安装 我下载的是nginx-1.6.0 #./configure --prefix=/usr/local/nginx make&& make install 卸载已存在的apache服务和php [[email protected] Desktop]# yum remove httpd php* 安装development Tools [[email prote

centos 6.5 yum安装lnmp

转自:http://blog.csdn.net/lane_l/article/details/20235909 准备篇: 1.配置防火墙,开启80端口.3306端口vi /etc/sysconfig/iptables-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT(允许80端口通过防火墙)-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEP

Centos 7.0 编译安装LNMP(Linxu+nginx+mysql+php)之源码安装nginx (一)

nginx简介:       Nginx (engine x) 是一个高性能的HTTP和反向代理服务器,也是一个IMAP/POP3/SMTP服务器.Nginx是由伊戈尔·赛索耶夫为俄罗斯访问量第二的Rambler.ru站点(俄文:Рамблер)开发的,第一个公开版本0.1.0发布于2004年10月4日. 其将源代码以类BSD许可证的形式发布,因它的稳定性.丰富的功能集.示例配置文件和低系统资源的消耗而闻名.2011年6月1日,nginx 1.0.4发布. Nginx是一款轻量级的Web 服务器

一键安装lnmp报错 pycurl.so: undefined symbol: CRYPTO_set_locking_callback

There was a problem importing one of the Python modulesrequired to run yum. The error leading to this problem was: /usr/lib64/python2.6/site-packages/pycurl.so: undefined symbol: CRYPTO_set_locking_callback Please install a package which provides thi