您好,登錄后才能下訂單哦!
安裝平臺(tái) centos 6.8 2.6.32-642.el6.x86_64
關(guān)閉防火墻和selinux
軟件版本 apr-1.5.2 apr-util-1.5.4 pcre-8.39 httpd-2.4.23 php-7.0.11 percona-5.6.26 zabbix-3.2.1
安裝依賴關(guān)系 yum install -y gcc libtool libtool-ltdl libtool-ltdl-devel lynx gcc-c++ make zlib zlib-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers recode-devel php-mbstring php-bcmath lib curl-devel php-mysql tree autoconf httpd-manual mod_ssl mod_perl mod_auth_mysql php-gd php-xml php-ldap php-xmlrpc mysql-connector-odbc libdbi-dbd-mysql net-snmp net-snmp-devel
LAMP環(huán)境編譯安裝
mysql
安裝平臺(tái):centos 6.8 2.6.32-642.el6.x86_64
Percina版本: Percona-Server-5.6.26-74.0-r32f8dfd-el6-x86_64-bundle.tar
獲取地址:https://www.percona.com/downloads/Percona-Server-5.6/Percona-Server-5.6.33-79.0/binary/redhat/6/x86_64/Percona-Server-5.6.33-79.0-r2084bdb-el6-x86_64-bundle.tar
安裝 epel-release-6-8.noarch.rpm libaio-0.3.107-10.el6.x86_64.rpm
安裝依賴關(guān)系 yum install -y gcc gcc-c++ make cmake automake autoconf libxml2 libxml2-devel zlib zlib-devel ncurses ncurses-devel
然后yum jemalloc //tokuDB內(nèi)存分配需要jemalloc支持
Percona-Server-5.6.26-74.0-r32f8dfd-el6-x86_64-bundle.tar 解壓后的安裝順序是:
tar xvf Percona-Server-5.6.26-74.0-r32f8dfd-el6-x86_64-bundle.tar
rpm -ivh Percona-Server-shared-56-5.6.26-rel74.0.el6.x86_64.rpm
rpm -ivh Percona-Server-devel-56-5.6.26-rel74.0.el6.x86_64.rpm
rpm -ivh Percona-Server-client-56-5.6.26-rel74.0.el6.x86_64.rpm
rpm -ivh Percona-Server-server-56-5.6.26-rel74.0.el6.x86_64.rpm
rpm -ivh Percona-Server-tokudb-56-5.6.26-rel74.0.el6.x86_64.rpm
修改系統(tǒng)參數(shù)
echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag
echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag
建議寫到 /etc/rc.local 中,重啟后也可生效
啟動(dòng)服務(wù):/etc/init.d/mysql start
修改mysql配置文件 vim /etc/my.cnf
添加 default-storage-engine=TokuDB
重啟服務(wù):/etc/init.d/mysql restart
輸入:ps_tokudb_admin --enable -uroot -p 密碼默認(rèn)沒有設(shè)置為空
進(jìn)入mysql,驗(yàn)證:
apache
httpd依賴于apr, apr-util pcre-devel apr全稱為apache portable runtime,能實(shí)現(xiàn)httpd跨平臺(tái)運(yùn)行 httpd-2.4 依賴于1.4+及以上版本的apr。
apache MPM event is not supported on this platform. 是因?yàn)閍pr和apr-util的版本較低,需要升級(jí)到1.5.0以上,所以重新選擇apr-1.5.2和apr-util-1.5.4的tar包進(jìn)行再編譯。
pcre(Perl Compatible Regular Expressions)是一個(gè)Perl庫,包括 perl 兼容的正則表達(dá)式庫
tar xf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure && make && make install
vim
/etc/ld
.so.conf.d
/local
.conf
# 編輯庫文件
/usr/local/lib
# 添加該行
:wq
# 保存退出
ldconfig -
v
tar xf apr-1.5.2.tar.gz
cd apr-1.5.2
./configure --prefix=/usr/local/apr
make && make install
//當(dāng)出現(xiàn)rm: cannot remove `libtoolT': No such file or directory錯(cuò)誤時(shí)修改configure文件,RM='$RM' ==> RM='$RM -f'在29605行左右。
tar xf apr-util-1.5.4.tar.gz
cd apr-util-1.5.4
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make && make install
tar xf pcre-8.39.tar.gz
cd pcre-8.39
./configure --prefix=/usr/local/pcre
make && make install
tar xf httpd-2.4.23.tar.gz
cd httpd-2.4.23
./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre --enable-nonportable-atomics=yes --with-crypto --enable-mods-shared=few --enable-so --enable-macro --enable-data --enable-http --with-libxml2 --enable-request --enable-include --enable-deflate --enable-logio --enable-expires --enable-usertrack --enable-ssl --enable-info --enable-cgid --enable-rewrite --enable-negotiation --enable-sed --enable-vhost-alias --enable-ratelimit --enable-allowmethods --enable-authn-db --enable-dbd --enable-charset-lite --enable-cache --enable-cache-disk --enable-cache-socache --enable-authnz-ldap --enable-ldap --enable-dav --enable-dav-fs --enable-dav-lock --with-ldap --enable-authnz-ldap --with-included-apr --enable-deflate
make && make install
cd /usr/local/apache/bin
ln -s /usr/local/apache/bin/apachectl /etc/init.d/httpd
vim /usr/local/apache/conf/httpd/conf
servername 127.0.0.1:80
/etc/init.d/httpd start
httpd -l
//提示錯(cuò)誤:Bundled APR requested but not found at ./srclib/. Download and unpack the corresponding apr and apr-util packages to ./srclib/.時(shí),將apr 和apr-util的解壓目錄cp 到 ./srclib/ 目錄下, 再進(jìn)行編譯。
cp -rf /root/apr-1.5.2 ./httpd-2.4.23/srclib/apr
cp -rf /root/apr-util-1.5.4 ./httpd-2.4.23/srclib/apr-util
php
tar xf php-7.0.11.tar.gz
cd php-7.0.11
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/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/lib/libconv --enable-mbstring --enable-calendar --with-gettext --with-libxml-dir=/usr/local --with-zlib --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --enable-dom --enable-xml --enable-fpm --with-libdir=lib64 --enable-bcmath --enable-zip --enable-pcntl --enable-exif --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-opcache --enable-session --enable-mbregex --with-fpm-user=vagrant --with-fpm-group=nogroup --enable-wddx --with-mcrypt --enable-gd-native-ttf --enable-gd-jis-conv --with-openssl --with-zlib=/usr --with-recode=/usr --with-xmlrpc --enable-inline-optimization --disable-debug --disable-rpath --with-apxs2=/usr/local/apache/bin/apxs
make
make test
make install
vim /usr/local/apache/conf/httpd.conf
找到
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
修改成
<IfModule dir_module>
DirectoryIndex index.php index.html
</IfModule>
找到
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
在后面加一行
AddType application/x-httpd-php .php
[root@localhost bin]# /usr/local/apache/bin/apachectl -t
Syntax OK
測試ok,在pkill httpd
最后重啟apache.
[root@localhost bin]# /usr/local/apache/bin/apachectl start
[root@localhost htdocs]#mv index.html index.php
[root@localhost htdocs]# cat index.php #修改成如下內(nèi)容
<?php
phpinfo();
?>
至此,LAMP環(huán)境編譯安裝完成。
zabbix
groupadd -g 201 zabbix
useradd -g zabbix -u 201 -s /sbin/nologin zabbix
tar zxvf zabbix-3.2.1.tar.gz
cd zabbix-3.2.1
./configure --prefix=/usr/local/zabbix --enable-server --enable-proxy --enable-agent --with-mysql=/usr/bin/mysql_config --with-net-snmp --with-libcurl
make && make install
mysql -e "create database zabbix default charset utf8;"
mysql -e "grant all on zabbix.* to zabbix@localhost identified by 'zabbix';"
mysql -uzabbix -pzabbix zabbix<./database/mysql/schema.sql
mysql -uzabbix -pzabbix zabbix<./database/mysql/p_w_picpaths.sql
mysql -uzabbix -pzabbix zabbix<./database/mysql/data.sql
mkdir /var/log/zabbix
chown -R zabbix.zabbix /var/log/zabbix
ln -s /usr/local/zabbix/etc/ /etc/zabbix
ln -s /usr/local/zabbix/bin/* /usr/bin/
ln -s /usr/local/zabbix/sbin/* /usr/sbin/
cp /root/zabbix-3.2.1/misc/init.d/fedora/core/zabbix_* /etc/init.d
chmod 755 /etc/init.d/zabbix_*
sed -i "s@BASEDIR=/usr/local@BASEDIR=/usr/local/zabbix@g" /etc/init.d/zabbix_server
sed -i "s@BASEDIR=/usr/local@BASEDIR=/usr/local/zabbix@g" /etc/init.d/zabbix_agentd
sed -i "s@DBUser=root@DBUser=zabbix@g" /etc/zabbix/zabbix_server.conf
sed -i "s@#DBPassword=@DBPassword=zabbix@g" /etc/zabbix/zabbix_server.conf
sed -i "s@# DBPassword=@DBPassword=zabbix@g" /etc/zabbix/zabbix_server.conf
sed -i "s@Server=127.0.0.1@Server=127.0.0.1,192.168.10.119@g" /etc/zabbix/zabbix_agentd.conf
sed -i "s@ServerActive=127.0.0.1@ServerActive=$IP:10051@g" /etc/zabbix/zabbix_agentd.conf
sed -i "s@BASEDIR=/usr/local@BASEDIR=/usr/local/zabbix@g" /etc/init.d/zabbix_agentd
sed -i "s@tmp/zabbix_agentd.log@var/log/zabbix/zabbix_agentd.log@g" /etc/zabbix/zabbix_agentd.conf
sed -i "s@^# UnsafeUserParameters=0@UnsafeUserParameters=1\n@g" /etc/zabbix/zabbix_agentd.conf
cp -r /root/zabbix-3.2.1/frontends/php/ /usr/local/apache/htdocs/zabbix/
chown -R apache.apache /usr/local/apache/htdocs/zabbix/
chkconfig zabbix_server on
chkconfig zabbix_agentd on
service zabbix_server start
service zabbix_agentd start
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。