一、安装nginx:
1、安装相关的依赖包:
yum -y install gcc gcc-c++ autoconf automake zlib zlib-devel openssl openssl-devel pcre* make gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel
2.创建用户:
groupadd nginx
useradd nginx nginx
3.下载nginx安装包:
wget http://nginx.org/download/nginx-1.9.15.tar.gz && tar xvf nginx-1.9.15.tar.gz && cd nginx-1.9.15
4.安装nginx:tar xvf nginx-1.9.15.tar.gz && cd nginx-1.9.15
5.编译:./configure --prefix=/usr/local/product/nginx1.9.15 --user=www --group=www --with-http_ssl_module --with-http_v2_module --with-http_stub_status_module --with-pcre
make && make install
ln -s /usr/local/product/nginx1.9.15 /usr/local/nginx
groupadd mysql mkdir -pv /data/mysql useradd -r -g mysql -d /data/mysql -s /sbin/nologin mysql chown -R mysql.mysql /data/mysql2.安装cmake及相关依赖:
yum install cmake gcc* ncurses-devel -y
3.下载mysql安装包:wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.49.tar.gz
4.安装mysql
ar -xvf mysql-5.5.49.tar.gz && cd mysql-5.5.49
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/product/mysql5.5.49 -DDEFAULT_CHARSET=utf8 -DENABLED_LOCAL_INFILE=1 -DMYSQL_DATADIR=/data/mysql -DWITH_EXTRA_CHARSETS=all -DWITH_READLINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_TCP_PORT=3306 -DDEFAULT_COLLATION=utf8_general_ci
make && make install
ln -s /usr/local/product/mysql5.5.49 /usr/local/mysql
chown -R mysql.mysql /usr/local/mysql
#进行编译安装,安装完成后就行软连接并给以权限。cd /usr/local/mysql/support-files/
cp my-medium.cnf /data/mysql/my.cnf
cp mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
cd /usr/local/mysql/scripts
./mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/data/mysql/
修改mysql配置文件my.cnf
/etc/init.d/mysqld start7.登录mysql并创建所需的数据库:
wget http://cn2.php.net/get/php-5.5.35.tar.gz/from/this/mirror2.解压并进行编译:
mv mirror php-5.5.35.tar.gz && tar xvf php-5.5.35.tar.gz && cd php-5.5.35 ./configure --prefix=/usr/local/product/php-5.5.35 --with-config-file-path=/usr/local/product/php-5.5.35/etc --with-bz2 --with-curl --enable-ftp --enable-sockets --disable-ipv6 --with-gd --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-freetype-dir=/usr/local --enable-gd-native-ttf --with-iconv-dir=/usr/local --enable-mbstring --enable-calendar --with-gettext --with-libxml-dir=/usr/local --with-zlib --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-mysql=mysqlnd --enable-dom --enable-xml --enable-fpm --with-libdir=lib64 --enable-bcmath make && make install ln -s /usr/local/product/php-5.5.35 /usr/local/php cp php.ini-production /usr/local/php/etc/php.ini cd /usr/local/php/etc/ cp php-fpm.conf.default php-fpm.conf3.修改php.ini
max_execution_time=300
memory_limit=128M
post_max_size=16M
upload_max_filesize=2M
max_input_time=300
yum install mysql-devel -y
yum install net-snmp-devel -y
3.
解压并进行编译:tar zxf zabbix-3.0.4.tar.gz && cd zabbix-3.0.4
./configure --prefix=/usr/local/zabbix-3.0.4/ --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-libxml2 make && make install 4.创建zabbix使用用户: groupadd zabbix useradd zabbix zabbix 5.导入sql文件:
mysql -uroot -pzabbix zabbix < database/mysql/schema.sql
mysql -uroot -pzabbix zabbix < database/mysql/images.sql
mysql -uroot -pzabbix zabbix < database/mysql/data.sql#顺序不能错
LogFile=/tmp/zabbix_server.log
PidFile=/tmp/zabbix_server.pid
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
3.配置web
站点:/usr/local/nginx/sbin/nginx
2.启动php:
/usr/local/php/sbin/php-fpm3.启动zabbix _server:
/usr/local/zabbix-3.0.4/sbin/zabbix_server七:添加开机自启动:
echo "/usr/local/nginx/sbin/nginx" >>/etc/rc.local
echo "/usr/local/php/sbin/php-fpm" >>/etc/rc.local
echo "/etc/init.d/mysqld start" >>/etc/rc.local
echo "/usr/local/zabbix-3.0.4/sbin/zabbix_server" >>/etc/rc.local八:查看服务端口:
netstat -