linux+apache+mysql+php+phpmyadmin+zend+eaccelerator安裝文檔

來源:互聯網
上載者:User

環境 Centos 5.5 32位 伺服器位址 192.168.1.250
1 安裝apache
  tar -zxvf httpd-2.2.17.tar.gz
  cd httpd-2.2.17
  ./configure --prefix=/usr/local/httpd --enable-so --enable-rewrite --with-mpm=worker
   make
   make install
   /usr/local/httpd/bin/apachectl  start
   echo "/usr/local/httpd/bin/apachectl start &">>/etc/rc.d/rc.local
  
  檢驗安裝情況
   a 檢驗/usr/local/httpd是否存在
   b檢查編譯進來的模組 /usr/local/httpd/bin/apachectl -l(靜態模組查看) 輸出結果應包含 worker.c 和mod_rewrite.c
   c檢查apache能否正常運行 執行命令: /usr/local/httpd/bin/apachectl -t(檢查apache文法)只要輸出 Systax OK 就可以了
   d 訪問http://192.168.1.250/ 查看
2 安裝mysql
   請參考我寫的mysql安裝
3 安裝php準備工作
  a curl安裝
   tar -zxvf curl-7.15.0.tar.gz
     cd curl-7.15.0
    ./configure --prefix=/usr/local/curl
    make && make install
  b expat安裝
  tar -zxvf expat-2.0.1.tar.gz
  cd expat-2.0.1
  ./configure --prefix=/usr/local/expat
  make && make install
  c gzip安裝
  tar -zxvf gzip-1.3.5.tar.gz
  cd gzip-1.3.5
   ./configure --prefix=/usr/local/gzip
   make && make install
  D.libxml2安裝
   tar -zxvf libxml2-2.6.19.tar.gz
   cd libxml2-2.6.19
   ./configure --prefix=/usr/local/libxml2
   make && make install
  E.zlib安裝
  tar -zxvf zlib-1.2.3.tar.gz
  cd zlib-1.2.3
  ./configure
  make && make install
  F.jpeg6安裝
   mkdir -p /usr/local/jpeg6
   mkdir -p /usr/local/jpeg6/bin
   mkdir -p /usr/local/jpeg6/lib
   mkdir -p /usr/local/jpeg6/include
   mkdir -p /usr/local/jpeg6/man
   mkdir -p /usr/local/jpeg6/man1
   mkdir -p /usr/local/jpeg6/man/man1
   tar -zvxf jpegsrc.v6b.tar.gz
   cd jpeg-6b
   ./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static
    make && make install
  G.安裝libpng
   tar -zxvf libpng-1.2.37.tar.gz
   cd libpng-1.2.37
   ./configure   //這個如同上面zlib的說明一樣,不要帶參數,讓它預設安裝到相應目錄
   make && make install
  H 安裝 freetype
   tar -zvxf freetype-2.3.5.tar.gz
    cd freetype-2.3.5
    mkdir -p /usr/local/freetype
     ./configure --prefix=/usr/local/freetype
    make && make install
   I  安裝libmcrypt 加解密包(以免登陸phpmyadmin 報錯)
   tar zxvf libmcrypt-2.5.7.tar.gz
   cd libmcrypt-2.5.7
   ./configure
   make  && make install
  J 安裝fontconfig
  tar zxvf fontconfig-2.4.2.tar.gz
  cd fontconfig-2.4.2
  ./configure --prefix=/usr/local/fontconfig   --with-freetype-config=/usr/local/freetype/bin/freetype-config
  make && make install
  k 安裝gettext-devel
   yum -y install gettext gettext-devel
  (如果不安裝,make gd時報錯 `AM_ICONV’ not found in library )
  k 安裝gd
  tar -zxvf gd-2.0.35.tar.gz
  cd gd-2.0.35
   ./configure --prefix=/usr/local/gd --with-jpeg=/usr/local/jpeg6/ --with-png --with-zlib --with-freetype=/usr/local/freetype/ --with-fontconfig=/usr/local/fontconfig
  make && make install
4 安裝php
  tar -zxvf php-5.2.11.tar.gz
  cd php-5.2.11
  ./configure --prefix=/usr/local/php --with-gd=/usr/local/gd --with-apxs2=/usr/local/httpd/bin/apxs --enable-mbregex --enable-bcmath --with-mysql=/usr/local/mysql -with-zlib-dir --enable-mbstring=all --with-pdo-mysql --with-freetype-dir=/usr/local/freetype --with-mcrypt --enable-sockets
    (編譯報錯 configure: error: Cannot find MySQL header files under 執行  cp /usr/local/mysql/bin/mysql_config /usr/bin/mysql_config 和 ln -s /usr/local/mysql/include/mysql/mysql.h  /usr/include/) 然後重新make
  make && make install
  cp php.ini-dist /usr/local/php/lib/php.ini
  說明 --with-mcrypt (以免登陸phpmyadmin報錯) --enable-sockets (cacti 需要)
 
5驗證安裝
 a 看/usr/local 下是否有 gd和php
 b 檢查php於apache相關聯情況 包括 在 /usr/local/httpd/modules 自動產生 libphp5.so 和在apache主設定檔中自動插入 LoadModule php5_module modules/libphp5.so
 c 更全面檢查 在/usr/local/httpd/htdocs 下建立test.php  內容為
  <?
   PHPinfo();
  ?>
 d 稍微修改apache設定檔 在<IfModule mime_module> </IfModule>之間增加  AddType application/x-httpd-php .php .php3 .phtml 和  AddType application/x-httpd-php-source .phps
  修改 DirectoryIndex index.php index.html
 e 執行apache語法檢查 /usr/local/httpd/bin/apachectl -t 沒問題後手動啟動apache服務 /usr/local/httpd/bin/apachectl start
 f 檢查apache進程和監聽 lsof -i:80
 g  在瀏覽器輸入http://192.168.1.2/test.php 看是否正常
 h 把我提供的index.php上傳到 /usr/local/httpd/htdocs/下 測試mysql (記得將附件改名為index.php)
6 安裝phpmyadmin
 tar -zxvf phpMyAdmin-3.2.2.1-all-languages.tar.gz
 mkdir /usr/local/httpd/htdocs/phpmysql
 mv phpMyAdmin-3.2.2.1-all-languages/* /usr/local/httpd/htdocs/phpmysql/
 cd /usr/local/httpd/htdocs/phpmysql
 cp config.sample.inc.php  config.inc.php
7 安裝 ZendOptimizer
tar -zxvf ZendOptimizer-3.3.0a-linux-glibc21-i386.tar.gz
cd ZendOptimizer-3.3.0a-linux-glibc21-i386
./install
中途填寫php.ini路徑 /usr/local/php/lib
apachectl路徑 填寫 /usr/local/httpd/bin/apachectl
其餘點ok或者下一步 按照系統預設走
 Zend Optimizer Installation
 ------------------------------------------------------------------------------
+-------------------------- Zend Optimizer 3.3.0a ---------------------------+
|                                                                            |
| The following configuration changes have been made:                        |
|                                                                            |
| - The php.ini file has been relocated from /usr/local/php/lib to /usr/local/
Zend/etc                                                                     |
| - A symbolic link for the php.ini file has been created in /usr/local/php/li
b.                                                                           |
| - The original php.ini was backed up to                                    |
|  /usr/local/php/lib/php.ini-zend_optimizer.bak                             |
|                                                                            |
|                                                                            |
|                                                                            |
+----------------------------------------------------------------------------+
|                                   <  OK  >                                 |
+----------------------------------------------------------------------------+
8 安裝 eaccelerator
tar -jxvf eaccelerator-0.9.5.2.tar.bz2
cd eaccelerator-0.9.5.2
/usr/local/php/bin/phpize
./configure --enable-eaccelerator=shared --with-php-config=/usr/local/php/bin/php-config
make && make install
vi /usr/local/php/lib/php.ini
[eaccelerator]
extension_dir="/usr/local/php/lib/php/extensions"
extension="/no-debug-zts-20060613/eaccelerator.so"
eaccelerator.shm_size="128"
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="300"
eaccelerator.shm_prune_period="120"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
建立快取檔案夾
mkdir /tmp/eaccelerator
chmod 0777 /tmp/eaccelerator
重啟apache讓配置生效
/usr/local/httpd/bin/apachectl restart
至此 配置完畢,歡迎拍磚。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.