Apache PHP 基本構成のインストール メモ
Apache/PHP 基本構成のインストール
・Apache2.0.54
・PHP5.0.4
Apache 2 マルチプロセスモデル(prefork)
[ 構築に必要なツール ]
・autoconf
・automake
・libtool(バージョン1.4以降)
・GNU make
・gcc
$ rpm -q XX
にて確認する。
RedHat 9はOK
[ 構築の際に使用するライブラリ ]
・zlib
・libxml2(PHP5.1の場合は、2.6.3以降である必要があります。)
http://www.zlib.org/
# zlib(zlib-1.2.1.tar.gz)
http://xmlsoft.org/
# libxml2(lixml2-2.6.17.tar.gz)
# zlib
$ tar xzvf zlib-1.2.1.tar.gz
$ cd zlib-1.2.1
$ ./configure
$ make
$ sudo make install
# libxml2
$ tar xzvf libxml2-2.6.17.tar.gz
$ cd libxml2-2.6.17
$ ./configure
$ make
$ sudo make install
[ Apacheのインストール ]
http://www.apache.org/
# httpd-2.0.55.tar.gz
$ tar xzvf httpd-2.0.55.tar.gz
$ cd httpd-2.0.55
$ ./configure --enable-so
(DSO:Dynamic Shared Objectを使用可能とするためのオプションを指定)
$ make
$ sudo make install
Apacheは、デフォルトの状態で/usr/local/apache2以下にインストールされます。
[ /usr/local/apache2/conf/httpd.conf ]
# アクセスを受け付けるサーバ名/ポート番号
Listen 80
# WebサーバプロセスのユーザID
User nobody
# WebサーバプロセスのグループID
Group nobody
# Webサーバ名
ServerName 192.168.11.222
日本語の処理や表示をする場合、
AddDefaultCharsetにISO-8859-1が指定されていたら設定をコメントアウトします。
[ httpd.confの記述状態の確認 ]
/usr/local/apache2/bin/apachectl configtest
Syntax OK
[ Apacheの起動 ]
/usr/local/apache2/bin/apachectl start
[ Apacheの自動起動 ]
/etc/rc.d/rc/localに以下の記述を追加する
---
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
ここから
if [ -x /usr/local/apache2/bin/apachectl ]; then
/usr/local/apache2/bin/apachectl start
fi
ここまで
---
[ PHPのインストール ]
http://www.php.net/downloads.php
# php-5.1.2.tar.tar
$ tar xzvf php-5.1.2.tar.tar
$ cd php-5.1.2
configureオプションを追加して実行します。
$ ./configure --with-apxs2=/usr/local/apache2/bin/apxs --enable-mbstring --enable-zend-multibyte --with-zlib --enable-sqlite-utf8 --enable-memory-limit
Thank you for using PHP.
ここでは、Apache2にDSOモジュールとしてPHPを組み込むためのオプション
--with-apxs2
マルチバイト拡張モジュールとZendエンジンのマルチバイト機能を有効にするオプション
--enable-mbstring
--enable-zend-multibyte
を指定しています。
その他のオプションについては、
configure --help
にて。
$ make
$ sudo make install
これにより、コマンドライン版のPHPが
/usr/local/bin
にインストールされ、Apache2 DSO版の(libphp5.so)が
/usr/local/apache2/module/
にインストールされます。
[ php.ini ]$ sudo cp php.ini-dist /usr/local/lib/php.ini
; マルチバイト拡張(エクステンション)で日本語が選択され、内部文字コードとして
; UTF-8が使用されるようになります。
mbstring.language = Japanese
mbstring.internal_encoding = UTF-8
; HTTP出力文字コードの出力を内部文字コードから特定の文字コードに自動変換する
output_handler = mb_output_handler
mbstring.http_output = UTF-8
; HTTP入力の文字コードを検出し、内部文字コードに自動変換したい場合
mbstring.http_input = auto
mbstring.encoding_translation = On
; PHPスクリプトをサーチするパス
; PEARなどの標準クラスライブラリ
include_path = ".:/usr/local/php"
; エクステンション(拡張モジュール)をサーチするパス
extension_dir = "/usr/local/lib/php/extensions"
; 下記を確認する
register_globals = Off
[ コマンドライン版PHPのテスト ]
$ php -i |less
[ Apacheの再設定(/usr/local/apache2/conf/httpd.conf)とテスト ]
# PHP5のDSOモジュールを組み込む設定(インストール時点で追加されてるかも)
LoadModule php5_module modules/libphp5.so
# 拡張子.phpのファイルがPHPスクリプトとして認識する設定
# (index.php)の追加
DirectoryIndex index.html index.html.var index.php
# Apacheの再起動
HTML関連
http://www.htmq.com/index.htm
Web標準普及プロジェクト
http://www.mozilla.gr.jp/standards/index.html
JS
<script>
var MILLIS_DAY = 24 * 60 * 60 * 1000;
var ADDDAY_DAY = 14;
var date_current = new Date();
var date_add14 = new Date();
alert(date_current.getTime());
// 14日後の1970年1月1日9時0分0秒からの経過時刻を取得します。
var millis_add14 = (date_current.getTime()) + (MILLIS_DAY * ADDDAY_DAY);
date_add14.setTime(millis_add14);
alert(date_add14.getYear() + '/' + (date_add14.getMonth() + 1) + '/' +
date_add14.getDate());
</script>
CSS関連
http://ykr414.com/css/
あわものHTML
http://amo.versus.jp/hp/style/index.html
Cascading Style Sheets解説
http://www.anslasax.net/css-make/
ばけらのCSSリファレンス
http://www.ne.jp/asahi/minazuki/bakera/html/css/reference
CSS Maker - スタイルシート作成ツール
http://www.cssmaker.com/
Linux関連
日経 Linuxコマンド集
http://homepage2.nifty.com/cs/linux_command/command/index.html
SearchMan
http://www.searchman.info/fedoracore4/sev1000.html
VIのEncode変更
http://fumika.jp/nikki/2004/07/vimrc
JavaScript関連
http://www.din.or.jp/~hagi3/JavaScript/JSTips/DHTML/Library.htm
Programing Note
http://www.geocities.jp/woodstock_tomo/programing/javascript/js_getval.html
あなたのウェブページでウェブ標準を
http://www.mozilla-japan.org/docs/web-developer/upgrade_2.html
初めてのホームページ講座
(JavaScript Dynamic HTML SAMPLES)
http://www.hajimeteno.ne.jp/dhtml/index.html
UML関連
http://www.asahi-net.or.jp/~DP8T-ASM/java/uml/index.html
UML入門
ここで紹介される統一モデル化言語 UML は OMG が発表した仕様
「OMG Unified Modeling Language Specification Version1.3, March 2000」に準拠します。
http://wisdom.sakura.ne.jp/solution/uml/index.html
スタックアスタリスク
http://www.stackasterisk.jp/tech/engineer/uml03_01.jsp
PHP関連
http://www.php.net/
日本 PHP ユーザ会
http://www.php.gr.jp/
Apache + PHP + PostgreSQL 実験室
http://www.hizlab.net/app/index.html
スタックアスタリスク(PHP基礎)
http://www.stackasterisk.jp/tech/php/php01_01.jsp
PHP入門
http://www.scollabo.com/banban/php/index.html