LAMP叢集項目四 安裝apache、php及其外掛程式

來源:互聯網
上載者:User

標籤:modules   login   擴充   首頁   curl   eve   eps   make   ttf   

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-develyum 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.gzibiconv庫[1]  為需要做轉換的應用提供了一個iconv()的函數,以實現一個字元編碼到另一個字元編碼的轉換。./configure --prefix=/usr/local/libiconvmakemake install

bin/apachectl -t  檢查文法

for n in `ls /data0/www `;do echo $n > /data0/www/$n/index.html; done修改hosts檔案C:\Windows\System32\drivers\etc192.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 FollowSymLinks    AllowOverride None    Order allow,deny    Allow from all</Directory>

改為

 

<Directory "/data0/www">    Options -Indexes FollowSymLinks    AllowOverride None    Order allow,deny    Allow from all</Directory>Index加 - 號,不需要索引
apachectl graceful 平滑重啟命令

 

安裝php

http://museum.php.net/php5/   舊版的php

安裝PHP 使用5.3.8以上

tar xf php-5.5.15.tar.bz2yum install openssl openssl-devel  curl-devel  libxslt-devel  -yln -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 .phtmlAddType application/x-httpd-php-source .phpsLoadModule php5_module        modules/libphp5.so在65行將user和group都改為 ett使用者 (但是沒有找到)useradd ett -M -s /sbin/nologinvi 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-configmake && make install

 安裝memcache緩衝擴充模組

tar zxf memcache-2.2.5.tgz/application/php/bin/phpize./configure --with-php-config=/application/php/bin/php-configmake && 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.soextension = pdo_mysql.soextension = imagick.so;--cache ext end by oldboy 2012-4-18--EOFtail -5 /application/php/lib/php.inicd /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/eacceleratorchown -R ett.ett /tmp/eacceleratorcat >> /application/php/lib/php.ini<<EOF[eaccelerator]extension=eaccelerator.soeaccelerator.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 [email protected]‘10.0.0.%‘ identified by ‘123456‘;

 

LAMP叢集項目四 安裝apache、php及其外掛程式

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.