-
- # tar zxvf httpd-2.2.6.tar.gz
- # cd httpd-2.2.6
- # ./configure --prefix=/cdusr /local/apache2 --enable-so --enable-track-vars --enable-proxy --enable-vhost-alias --enable-cache --enable-disk-cache --enable-mem-cache --enable -rewrite --enable-mods-shared=all
- # make
- # make install
複製程式碼
3,JPEG包
-
- # tar zxvf jpegsrc.v6b.tar.gz
- # cd jpeg-6b/
- # mkdir /jpegdir /jpeg ># mkdir /usr/local/jpeg/bin
- # mkdir /usr/local/jpeg/lib
- # mkdir /usr/local/jpeg/include
- # mkdir /usr/local/jpeg/man
- # mkdir /usr/local/jpeg/man/man1
- # ./configure --prefix=/usr/local/jpeg
- # make
- # make install
- # make install- lib
-
複製程式碼
4,TTF包
- # tar zxvf freetype-2.1.10.tar.gz
- # cd freetype-2.1.10
- # . =/usr/local/freetype
- # make
- # make install
-
複製程式碼
5,zlib包
- # tar zxvf zlib-1.2.3.tar.gz
- # cd zlib-1.2.3
- # ./configure
- # make
- # make install
-
複製程式碼
6,libpng包
- # tar zxvf libpng-1.2.12.tar.gz
- # cd libpng-1.2.12
- # make install
-
-
複製程式碼
7,php gd庫
# tar zxvf gd-2.0.33.tar.gz- # cd gd-2.0.33
- # ./configure
- # make
- # make install
- # cp gd.h /usr/local/lib/
-
-
複製程式碼
8,XML庫(libxmlxml)
# tar jxvf libxml2-2.6.23.tar.bz2- # cd libxml2-2.6.23# make install
-
-
- 複製程式碼
-
9,php
# tar zxvf php-5.2.5.tar.gz # cd php-5.2.5 # ./configure --prefix =/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-gd --with-jpeg-dir=/usr/local/jpeg --with-ttf --with -freetype-dir=/usr/local/freetype --with-zlib --with-png --with-mysql=/usr/local/mysql/ --with-mbstring --enable-mbstring=all --enable- mbstr-enc-trans --enable-mbregex --enable-track-vars- # make
- # make install
- # cp php.ini-dist /usr/local/php/lib/php.ini
-
-
- 複製程式碼
-
httpd.conf
AddType application/x-httpd-php .php .phtml 10、禪德
# tar zxvf ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz # cd ZendOptimizer-3-i386.tar.gz # cd ZendOptimizer-3.3. -i386- # ./install.sh
-
-
- 複製程式碼
四,建立測試頁面
phpinfo(); ?>
複製代碼
頁面搜尋gd,顯示則表示成功:
RewriteEngine On- RewriteRule ^/a([0-9] ).html$ /a$11 。 php [L]
-
複製程式碼成功
測試是否:
目錄下有a1.php a2.php a3.php
輸入a1.html a2.html a3.html時,訪問的是以上php檔案
在做專案時已將其中的連結全寫成html格式。
六,--enable-rewrite防盜鏈
RewriteEngine on RewriteCond %{HTTP_REFERER} !^http:// www. 123.com/.*$ [NC]- RewriteRule .*/.(ppt|zip|rar|doc|wps)$ http://www.123.com/404.html [L]
-
-
-
- 複製程式碼
-
七,關於shtml
apache預設是不支援SSI的,需要更改httpd.conf來進行設定。
# vim /usr/local/apache2/conf/httpd.conf
把這行前面的#去掉
AddType text/html .shtml AddOutputFilter INCLUDES .shtml
-
- 複製程式碼
- 複製程式碼
然後,搜尋"Options Indexes FollowSymLinks"
在搜尋到的那一行後面加上"Includes"
即將該行改為:
Options Indexes FollowSymLinks Includes
測試,建立檔案test.shtml,內容如下:
|