xiyou 发表于 2013-3-6 09:03:46

Nagios(一)——LAMP 环境搭建

安装环境# yum -y install wget perl gd gd-devel libpng libpng-devel libjpeg libjpeg-devel zlib zlib-devel pcre-devel gcc gcc-c++make cmake autoconf openssl openssl-devel ncurses-devel patch libxml2 libxml2-devel curl-devel openldap openldap-devel libevent libevent-devel bison icu libicu-devel libtool readline-devel net-snmp-devel 一、搭建LAMP环境(1) 安装apache安装apr# tar zxvf apr-1.4.6.tar.gz# cd apr-1.4.6# ./buildconf# ./configure --prefix=/usr/local/apr# make# make install 安装apr-utl# tar zxvf apr-util-1.4.1.tar.gz# cd apr-util-1.4.1# ./buildconf --with-apr=/root/lamp/apr-1.4.6# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr# make && make install 安装http# tar zxvf httpd-2.2.22.tar.gz# cd httpd-2.2.22#./configure --prefix=/usr/local/apache --enable-so --enable-sl --enable-cgi --enable-rewrite --with-zlib --with-pcre --sysconfdir=/etc/httpd --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util # make && make install启动测试apache# /usr/local/apache/bin/apachectl start

(2) 安装mysql# groupadd -g 88 mysql# useradd -u 88 -g mysql -s /sbin/nologin mysql# mkdir /var/lib/mysql# chown mysql.mysql -R /var/lib/mysql/# cd /root/lamp/# tar zxvf mysql-5.5.29.tar.gz# cd mysql-5.5.29# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DINSTALL_DATADIR=/data/mysql -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=complex -DMYSQL_USER=mysql # make && make install# cd /usr/local/mysql/# scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql # chown -R root .# cp support-files/my-medium.cnf /etc/my.cnf# vim /etc/my.cnfport            = 3306socket          = /tmp/mysql.sockbasedir         = /usr/local/mysqldatadir         = /data/mysqluser            = mysqlcharacter_set_server    = utf8 配置mysql 启动# cp support-files/mysql.server /etc/init.d/mysql# vim /etc/init.d/mysql# service mysql startStarting MySQL... SUCCESS! 查看mysql是否已经启动# netstat -nultp |grep mysqltcp    0   0 0.0.0.0:3306       0.0.0.0:*    LISTEN      64819/mysqld (3) 安装php# tar zxvf php-5.3.2.tar.gz#. /configure--prefix=/usr/local/php--with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-path=/etc --with-freetype-dir --with-jpeg-dir --with-png-dir --enable-zip --with-zlib --enable-xml--with-gd--with-mhash--with-libxml-dir=/usr--enable-mbstring--with-mcrypt --enable-sockets --with-openssl # make# make install (4) 配置apache# vim /usr/local/apache2/conf/httpd.conf找到DirectoryIndex index.html index.html.var修改为DirectoryIndex index.html index.php接着增加如下内容:AddType application/x-httpd-php .php启动httpd服务# /usr/local/apache/bin/apachectl start 至此LAMP环境配置完成!

吸毒的虫子 发表于 2013-3-14 08:04:12

路过,学习下

残缺极品 发表于 2013-5-16 03:49:35

生,容易。活,容易。生活,不容易。

shanghaipc 发表于 2013-5-17 09:22:24

所有刻骨铭心的爱都灵魂游离于床上的瞬间!

爱死你了 发表于 2013-5-18 12:36:31

读书读到抽筋处,文思方能如尿崩!

78144666 发表于 2013-5-19 15:37:13

我是来刷分的,嘿嘿

纸水仙 发表于 2013-5-20 17:56:53

我妈常说,我们家要是没有电话就不会这么穷。
页: [1]
查看完整版本: Nagios(一)——LAMP 环境搭建