環(huán)境OS:centos 5.8 x86_64
創(chuàng)新互聯(lián)建站于2013年創(chuàng)立,先為岱山等服務(wù)建站,岱山等地企業(yè),進(jìn)行企業(yè)商務(wù)咨詢服務(wù)。為岱山企業(yè)網(wǎng)站制作PC+手機(jī)+微官網(wǎng)三網(wǎng)同步一站式服務(wù)解決您的所有建站問題。
這次腳本比上篇有些許修改,腳本如下
- #mkdir /etc/yum.repos.d/backup
- #mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/backup/
- #mv /tmp/lamp/ftp.repo /etc/yum.repos.d/
- #yum clean all
- #yum makecache
- path=`pwd`
- yum -y install gcc gcc-c++ screen autoconf automake libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel pcre pcre-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs-devel krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libtiff libtiff-devel gettext gettext-devel pam pam-devel fontconfig-devel libXpm-devel libtool php-common
- cd $path
- tar -zxvf httpd-2.2.9.tar.gz
- cd $path/httpd-2.2.9
- ./configure --prefix=/usr/local/apache2/ --sysconfdir=/etc/httpd/ --with-included-apr --disable-userdir --enable-so --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared --enable-static-support
- make
- make install
- mv $path/httpd /etc/rc.d/init.d/httpd
- chmod +x /etc/rc.d/init.d/httpd
- chkconfig --add httpd
- chkconfig httpd on
- service httpd start
- #install MySQL-server
- groupadd mysql
- useradd -g mysql mysql
- mkdir -p /data/mysql/var
- cd $path
- tar -zxvf Percona-Server-5.1.58.tar.gz
- cd $path/Percona-Server-5.1.58
- ./configure --prefix=/usr/local/mysql/ --localstatedir=/data/mysql/var --with-extra-charsets=utf8,gbk --with-pthread --enable-thread-safe-client --with-ssl --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --with-plugins=partition,innobase,csv,myisam,innodb_plugin --enable-shared --enable-assembler
- make && make install
- cp support-files/my-medium.cnf /etc/my.cnf
- cp support-files/mysql.server /etc/init.d/mysqld
- chmod +x /etc/init.d/mysqld
- ln -s /usr/local/mysql/bin/* /usr/local/bin/
- ln -s /usr/local/mysql/lib/mysql/lib* /usr/lib/
- /usr/local/mysql/bin/mysql_install_db --basedir=/usr/local/mysql/ --datadir=/data/mysql/var --user=mysql &
- chown -R root.mysql /usr/local/mysql/
- #chown -R mysql.mysql /usr/local/mysql/var/
- chown -R mysql.mysql /data/mysql/
- sed -i '38a\basedir = /usr/local/mysql/ \' /etc/my.cnf
- sed -i '39a\datadir = /data/mysql/var/ \' /etc/my.cnf
- service mysqld start
- #install php
- cd $path
- tar -zxvf libmcrypt-2.5.8.tar.gz
- cd $path/libmcrypt-2.5.8/
- ./configure --prefix=/usr/local/libmcrypt/
- make
- make install
- cd $path/libmcrypt-2.5.8/libltdl
- ./configure --enable-ltdl-install
- make
- make install
- cd $path
- tar -zxvf libiconv-1.13.1.tar.gz
- cd $path/libiconv-1.13.1
- ./configure --prefix=/usr/local/
- make
- make install
- ln -s /usr/local/lib/libmcrypt* /usr/lib
- ln -s /usr/local/lib/libiconv.* /usr/lib
- ln -s /usr/local/lib/libiconv.* /usr/lib64/
- yum -y install libxml2-devel curl-devel libpng-devel openldap-devel
- cd $path
- tar -zxvf php-5.2.6.tar.gz
- cd $path/php-5.2.6
- ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc/ --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-iconv-dir=/usr/local --with-libxml-dir --with-png-dir --with-jpeg-dir --with-freetype-dir --with-gd --with-zlib-dir --with-mcrypt=/usr/local/libmcrypt --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-soap --enable-mbstring=all --enable-sockets
- make ZEND_EXTRA_LIBS='-liconv'
- make install
- ln -s /usr/local/php/bin/php /usr/bin/
- cp php.ini-dist /usr/local/php/etc/php.ini
- sed -i '170 s/DirectoryIndex/ DirectoryIndex index.php/' /etc/httpd/httpd.conf
- sed -i '312a\ AddType application/x-httpd-php .php .phtml \' /etc/httpd/httpd.conf
- cd $path
- tar -zxvf PDO_MYSQL-1.0.2.tgz
- cd PDO_MYSQL-1.0.2
- /usr/local/php/bin/phpize
- ./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysql
- make && make install
- sed -i '486 s/extension_dir/ ;extension_dir/' /usr/local/php/etc/php.ini
- sed -i '597a extension = "pdo_mysql.so" ' /usr/local/php/etc/php.ini
- sed -i 's#;date.timezone.*#date.timezone = "Shanghai/Asia"# '/usr/local/php/etc/php.ini
- cp $path/index.php /usr/local/apache2/htdocs/index.php
- #/usr/local/apache2/bin/apachectl restart
- service httpd restart
- service mysqld restart
想單獨(dú)下載lamp安裝包,地址如下:
http://down.51cto.com/data/596769 免豆下載
補(bǔ)充一下:yum源請(qǐng)事先先設(shè)置好,直接解壓完,執(zhí)行./install-all.sh就可以了
apache安裝目錄:/usr/local/apache2
php:/usr/local/php
mysql:/usr/lcoal/mysql
新聞標(biāo)題:一起搭建linux監(jiān)控平臺(tái)之nagios(一)lamp環(huán)境
路徑分享:http://jinyejixie.com/article0/jojhoo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供關(guān)鍵詞優(yōu)化、小程序開發(fā)、軟件開發(fā)、網(wǎng)站收錄、域名注冊(cè)、標(biāo)簽優(yōu)化
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)