LAMP集群项目四 安装apache、php及其插件
rpm -qa httpd* 查看是否有apache
rpm -e httpd-2.2.22.2? 卸載該文件,如果不讓卸載,則加參數:--nodeps 不做軟件中的依賴檢查
?
./configure --prefix=/application/apache/ --enable-deflate --enable-expires --enable-headers --enable-modules=most --enable-so --with-mpm=worker --enable-rewrite
make && make install
配置http.conf
修改ServerName
打開 vhosts?? cd extra/??
配置vhost?
mkdir /app/logs -p 創建日志文件
rpm -qa zlib-devel libxml2-devel libjpeg-devel freetype-devel libpng-devel yum install zlib libxml libjepg freetype libpng ge curl libiconv zlib-devle libxml2-devel libjpeg-devel freetype-devel libpng-devel gd-devel crul-devel -y 安裝libiconv庫 wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz ibiconv庫[1] 為需要做轉換的應用提供了一個iconv()的函數,以實現一個字符編碼到另一個字符編碼的轉換。 ./configure --prefix=/usr/local/libiconv make make install bin/apachectl -t 檢查語法 for n in `ls /data0/www `;do echo $n > /data0/www/$n/index.html; done 修改hosts文件C:\Windows\System32\drivers\etc 192.168.1.27 bbs.etiantian.org blog.etiantian.org www.etiantian.org hao123.etiantian.org status.etiantian.org 采用egrep 來查看 egrep -v "#|^$" httpd.conf <Directory "/application/apache//htdocs">Options Indexes FollowSymLinksAllowOverride NoneOrder allow,denyAllow from all </Directory>改為
?
<Directory "/data0/www">Options -Indexes FollowSymLinksAllowOverride NoneOrder allow,denyAllow from all</Directory>Index加 - 號,不需要索引 apachectl graceful 平滑重啟命令?
安裝php
http://museum.php.net/php5/?? 舊版的php下載地址
安裝PHP 使用5.3.8以上
tar xf php-5.5.15.tar.bz2 yum install openssl openssl-devel curl-devel libxslt-devel -y ln -s /usr/lib64/libssl.so /usr/lib/編譯:需要指定php和mysql的路徑 ./configure \ --prefix=/application/php5.3.15 \ --with-apxs2=/application/apache/bin/apxs \ --with-mysql=/usr/local/mysql \ --with-xmlrpc \ --with-openssl \ --with-zlib \ --with-freetype-dir \ --with-gd \ --with-jpeg-dir \ --with-png-dir \ --with-iconv=/usr/local/libiconv \ --enable-short-tags \ --enable-sockets \ --enable-zend-multibyte \ --enable-soap \ --enable-mbstring \ --enable-static \ --enable-gd-native-ttf \ --with-curl \ --with-xsl \ --enable-ftp \ --with-libxml-dirmake && make installln -s /application/php5.3.15 /application/php 創建鏈接 復制配置文件: cp php.ini-production /application/php/lib/php.ini 配置apache支持php 在311行 加入 AddType application/x-httpd-php .php .phtml AddType application/x-httpd-php-source .phpsLoadModule php5_module modules/libphp5.so 在65行 將user和group都改為 ett用戶 (但是沒有找到) useradd ett -M -s /sbin/nologin vi httpd.conf +166 在166行 添加一個首頁文件 index.php 然后檢查語法: ../bin/apachectl -t ../bin/apachectl graceful重啟apache
http://www.etiantian.org/phpinfo.php
?
安裝php擴展
echo 'export LC_ALL=C'>> /etc/profile . /etc/profile 安裝 eaccelerator-0.9.6.tar.bz2 加速擴展(不兼容高版本的PHP) tar jxf eaccelerator-0.9.6.tar.bz2 /application/php/bin/phpize ./configure --enable-eaccelerator=shared --with-php-config=/application/php/bin/php-config make && make install?安裝memcache緩存擴展模塊
tar zxf memcache-2.2.5.tgz /application/php/bin/phpize ./configure --with-php-config=/application/php/bin/php-config make && make install安裝PDO_MYSQL擴展模塊(非必須)
/application/php/bin/phpize
./configure? --with-php-config=/application/php/bin/php-config --with-pdo-mysql=/usr/local/mysql
?
配置php相關擴展插件模塊:
?
ls -l /application/php/lib/php/extensions/no-debug-zts-20090626/cat >> /application/php/lib/php.ini<<EOF ;--cache ext start by oldboy 2012-4-18-- extension = memcache.so extension = pdo_mysql.so extension = imagick.so ;--cache ext end by oldboy 2012-4-18-- EOFtail -5 /application/php/lib/php.ini cd /application/php/lib/ cp php.ini php.oldboy.20120418- sed -i 's#; extension_dir = "./"#extension_dir = "/application/php5.3.15/lib/php/extensions/no-debug-zts-20090626/"#g' php.ini #注意:路徑一定要寫對 grep "extension_dir =" php.ini?配置eAccelerator插件
mkdir -p /tmp/eaccelerator chown -R ett.ett /tmp/eaccelerator cat >> /application/php/lib/php.ini<<EOF [eaccelerator] extension=eaccelerator.so eaccelerator.shm_size="64" eaccelerator.cache_dir="/tmp/eaccelerator" eaccelerator.enable="1" eaccelerator.optimizer="1" eaccelerator.check_mtime="1" eaccelerator.debug="0" eaccelerator.filter="" eaccelerator.shm_max="0" eaccelerator.shm_ttl="3600" eaccelerator.shm_prune_period="3600" eaccelerator.shm_only="0" eaccelerator.compress="1" eaccelerator.compress_level="9" EOF
?
檢查加速情況:
?
查看緩存目錄:
ll? /tmp/eaccelerator
配置xcache 加速
echo >>php.iniecho ';xcache config by oldboy 20120418----------------------' >>php.initail -2 php.inicat /home/oldboy/tools/xcache-1.3.2/xcache.ini >>php.ini?http://www.etiantian.org/phpinfo.php? 訪問網站查看安裝插件的情況
安裝wordpress,Discuz ,dedeCMS
mv wordpress/* /data0/www/blog/ mv DedeCMS-V5.7-GBK-SP1-Full/uploads/* /data0/www/www/ unzip Discuz_X2.5_SC_GBK.zip mv upload/* /data0/www/bbs/創建數據庫 create database www; create database bbs; create database blog; grant select,insert,update,delete,alert,create on www.* to www@'10.0.0.%' identified by '123456';?
轉載于:https://www.cnblogs.com/taiguyiba/p/6523146.html
總結
以上是生活随笔為你收集整理的LAMP集群项目四 安装apache、php及其插件的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Cogs 727. [网络流24题] 太
- 下一篇: echarts中如何使用timeline