網頁

2006年7月5日 星期三

Apache-mod_ssl-PHP-Howto

General Setting
Environment
export CC=[cross compiler name]
export CC=xscale_be-gcc
Prefix
CC=[cross compiler name]
CC=xscale_be-gcc make
Parameter
[CROSS COMPILER KEY WORD]=[cross compiler name or prefix]
./configure –CROSS=xscale_be-

Install Openssl
Openssl
tar zxvf openssl-0.9.7g.tar.gz
cd openssl-0.9.7g
./config ;make ;make install
Tips :
linux-elf-arm openssl-0.9.8 did not supported yet
need to install twice for i386 and arm platforms be good at using linux command link (ln)

Install mod_ssl and Apache
mod_ssl and apache
cd /tmp
tar xvfz apache_1.3.33.tar.gz
tar xvfz mod_ssl-2.8.23-1.3.33.tar.gz
cd mod_ssl-2.8.23-1.3.33
./configure --with-apache=../apache_1.3.33 --with-ssl=/usr/local/ssl/
--prefix=/usr/local/apache --enable-module=so --enable-shared=max
--logfsiledir=/var/log/httpd --htdocsdir=/usr/local/httpd/htdocs --bindir=/usr/bin
--sbindir=/usr/sbin --sysconfdir=/etc/httpd
Tips:
--enable-module=so
--enable-shared=max
Don't install PHP at this time Need to install twice for i386 and arm platforms gen_test_char -> test_char.h
gen_uri_delims -> uri_delims.h

Install PHP
PHP
tar xvfz php-4.0.5.tar.gz (image placeholder)
cd php-4.0.5
./configure --with-apxs=/usr/sbin/apxs --enable-track-vars --enable-sockets --with-config-file-path=/etc --enable-ftp --with-openssl=/usr/local/ssl --enable-force-cgi-redirect --enable-exif
Tips :
Need i386 apache installed first
Some newer Zend API could not be compiled by arm compiler
Don't install gd (----with-gd) and zlib (--with-zlib), because we don't have so
much free spaces to install libpng library and zlib library

Post Install
PHP
cp /tmp/php-4.3.4/php.ini-dist /etc/php.ini
Edit /etc/httpd/httpd.conf and added AddType application/x-httpd-php .php .php4 .php3
Apache
make certificate TYPE=custom

SSL Library Install
Openssl
make libssl.so.0.9.7
xscale_be-ld libcrypto.so (libcrypto)
xscale_be-ld libssl.so (ssl)
Tips:
When finished make libssl.so.0.9.7 system will produce libcrypto.so.0.9.7 and
libssl.so.0.9.7.
Links libcrypto.so, libcrypto.so.0 link from libcrypto.so.0.9.7
Links libssl.so, libssl.so.0 link from libssl.so.0.9.7
Using ln –s to link library name that you want. Ln –s libssl.so.0.9.7 libssl.so.4

startstoprestartreload Shell Script
Create /etc/init.d/httpd
#!/bin/sh
case "$1" in
start)
/usr/sbin/apachectl startssl ;;
stop)
/usr/sbin/apachectl stop
;;
restart)
$0 stop && sleep 3
$0 start
;;
reload)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {startstoprestartreload}"
exit 1
Esac

Html Screen Shot

Web Server - PHP test
PHP
<?php phpinfo(); php?>

PHP Screen Shot

Web Server – CGI test
CGI
#!/bin/sh
echo Content-type: text/plain echo
echo Hello World By Jones Chung.
echo
CGI Screen Shot
Web Server – SSL Test

沒有留言:

張貼留言