<? echo('<?xml version="1.0" encoding="utf-8"?>') ?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="ja">
<title>Olive-Design CGI PHP Linux Server Memo</title>
<link rel="alternate" type="text/html" href="http://www.olive-design.com/~cgi/MT/" />
<modified>2006-02-03T10:32:08Z</modified>
<tagline>Server Technical Memo</tagline>
<id>tag:www.olive-design.com,2006:/~cgi/MT//1</id>
<generator url="http://www.movabletype.org/" version="3.151-ja">Movable Type</generator>
<copyright>Copyright (c) 2005, yuuya</copyright>
<entry>
<title>ntpサーバーの設定</title>
<link rel="alternate" type="text/html" href="http://www.olive-design.com/~cgi/MT/archives/2005/09/ntp.html" />
<modified>2006-02-03T10:32:08Z</modified>
<issued>2005-09-10T12:41:35Z</issued>
<id>tag:www.olive-design.com,2005:/~cgi/MT//1.7</id>
<created>2005-09-10T12:41:35Z</created>
<summary type="text/plain">サーバーの正確な時間をセットする為にNTPクライアントを使ってNTPタイムサーバ...</summary>
<author>
<name>yuuya</name>


</author>
<dc:subject>時間合わせNTPサーバー</dc:subject>
<content type="text/html" mode="escaped" xml:lang="ja" xml:base="http://www.olive-design.com/~cgi/MT/">
<![CDATA[<p>サーバーの正確な時間をセットする為にNTPクライアントを使ってNTPタイムサーバーに情報を取りに行く様に設定します。</p>

<p>（１）まず最初にntp.confを修正します<br />
<table border=0 width=95%><tr><td><br />
<table bgcolor=black width=100% border=1 cellspacing=0><tr><td><font color=white>#vi /etc/ntp.conf<br />
</font></td></tr></table><br />
</td></tr></table></p>

<p>ファイルを開いたら<br />
<table border=0 width=95%><tr><td><br />
<table bgcolor=black width=100% border=1 cellspacing=0><tr><td><font color=white><br />
#<br />
# Undisciplined Local Clock. This is a fake driver intended for backup<br />
# and when no outside source of synchronized time is available. The<br />
# default stratum is usually 3, but in this case we elect to use stratum<br />
# 0. Since the server line does not have the prefer keyword, this driver<br />
# is never used for synchronization, unless no other other<br />
# synchronization source is available. In case the local host is<br />
# controlled by some external source, such as an external oscillator or<br />
# another protocol, the prefer keyword would cause the local host to<br />
# disregard all other synchronization sources, unless the kernel<br />
# modifications are in use and declare an unsynchronized condition.<br />
#<br />
#server 127.127.1.0     # local clock<br />
fudge   127.127.1.0 stratum 10</p>

<p>#<br />
# Drift file.  Put this in a directory which the daemon can write to.<br />
# No symbolic links allowed, either, since the daemon updates the file<br />
# by creating a temporary in the same directory and then rename()'ing<br />
# it to the file.<br />
#<br />
driftfile /etc/ntp/drift<br />
multicastclient                 # listen on default 224.0.1.1<br />
broadcastdelay  0.008 </p>

<p>#<br />
# Keys file.  If you want to diddle your server at run time, make a<br />
# keys file (mode 600 for sure) and define the key number to be<br />
# used for making requests.<br />
#<br />
# PLEASE DO NOT USE THE DEFAULT VALUES HERE. Pick your own, or remote<br />
# systems might be able to reset your clock at will. Note also that<br />
# ntpd is started with a -A flag, disabling authentication, that<br />
# will have to be removed as well.<br />
#<br />
#keys           /etc/ntp/keys<br />
</font></td></tr></table><br />
</td></tr></table></p>

<p>このファイルの最後に各プロバイダでも公開されているntpサーバーまたは、<br />
<a href="http://plamo.minidns.net/ntpsites.shtml">国内公開 ntp サイト一覧</a><br />
などを参考にして</p>

<p>server ***.***.***.*** </p>

<p>の行を追加します。(***はntpサーバーアドレス)</p>

<p><br />
（２）ntp.confを修正して保存したら、ntpサーバーと同期をとるために<br />
ntpdateコマンドで時計を合わせ直します。</p>

<table border=0 width=95%><tr><td>
<table bgcolor=black width=100% border=1 cellspacing=0><tr><td><font color=white>#/etc/rc.d/init.d/ntpd stop<br>
#/usr/sbin/ntpdate 210.173.160.57</font></td></tr></table>
</td></tr></table>

<p>（３）NTPDを起動します。<br />
<table border=0 width=95%><tr><td><br />
<table bgcolor=black width=100% border=1 cellspacing=0><tr><td><font color=white>#/etc/rc.d/init.d/ntpd start</font></td></tr></table><br />
</td></tr></table></p>

<p>（４）動作確認<br />
<table border=0 width=95%><tr><td><br />
<table bgcolor=black width=100% border=1 cellspacing=0><tr><td><font color=white>#/usr/sbin/ntpq -p<br />
　remote　　refid　　　　　　st t when　poll 　reach　delay　offset　 jitter<br />
==============================================================================<br />
*ntp2.jst.mfeed. 210.173.160.86　　2 u 　3　64　1　39.731　21.946　0.002<br />
</font></td></tr></table><br />
</td></tr></table><br />
しばらくして*が表示されたら同期完了です。(ローカルの時計との誤差が+-１分ぐらいでないと同期できません。）</p>

<p>（５）再起動後自動起動するように設定します。<table border=0 width=95%><tr><td><br />
<table bgcolor=black width=100% border=1 cellspacing=0><tr><td><font color=white>#/sbin/chkconfig ntpd on<br />
</font></td></tr></table><br />
</td></tr></table></p>]]>

</content>
</entry>
<entry>
<title>Windows＋Apache＋PHPインストール（その3）</title>
<link rel="alternate" type="text/html" href="http://www.olive-design.com/~cgi/MT/archives/2005/09/windowsapacheph_2.html" />
<modified>2005-09-10T12:38:26Z</modified>
<issued>2005-09-08T13:34:46Z</issued>
<id>tag:www.olive-design.com,2005:/~cgi/MT//1.6</id>
<created>2005-09-08T13:34:46Z</created>
<summary type="text/plain">Apacheを再起動させたら最後にPHPの動作確認をしてみましょう。 エデッタ等...</summary>
<author>
<name>yuuya</name>


</author>
<dc:subject>WindowsでPHP</dc:subject>
<content type="text/html" mode="escaped" xml:lang="ja" xml:base="http://www.olive-design.com/~cgi/MT/">
<![CDATA[<p>Apacheを再起動させたら最後にPHPの動作確認をしてみましょう。<br />
エデッタ等でphpinfo.phpというファイル名の以下の内容のファイルを作成します。</p>

<p></p>

<p><br />
</p>]]>
<![CDATA[<table border=0 width=95%><tr><td>
<table bgcolor=black width=100% border=1 cellspacing=0><tr><td><font color=white>
&lt;?<br>
 phpinfo();<br>
?>
</font></td></tr></table>
</td></tr></table>

<p></p>

<p>作成しましたら、このファイルをApacheのDocumentRoot「C:\Program Files\Apache Group\Apache\htdocs」<br />
に保存しておきます。</p>

<p>最後にWEBブラウザから<br />
http://localhost/phpinfo.php<br />
にアクセスします。phpのインフォメーションページが表示されれば成功です。<br />
<img alt="php4-1.gif" src="http://www.olive-design.com/~cgi/MT/archives/images/php4-1.gif" width="250" height="236" /><br />
</p>]]>
</content>
</entry>
<entry>
<title>Windows＋Apache＋PHPインストール（その2）</title>
<link rel="alternate" type="text/html" href="http://www.olive-design.com/~cgi/MT/archives/2005/09/windowsapacheph_1.html" />
<modified>2005-09-08T13:30:21Z</modified>
<issued>2005-09-08T13:17:49Z</issued>
<id>tag:www.olive-design.com,2005:/~cgi/MT//1.5</id>
<created>2005-09-08T13:17:49Z</created>
<summary type="text/plain">PHPのインストールがうまくできたら最後にApacheで.phpファイルが実行で...</summary>
<author>
<name>yuuya</name>


</author>
<dc:subject>WindowsでPHP</dc:subject>
<content type="text/html" mode="escaped" xml:lang="ja" xml:base="http://www.olive-design.com/~cgi/MT/">
<![CDATA[<p>PHPのインストールがうまくできたら最後にApacheで.phpファイルが実行できるようにApacheの設定ファイルの編集をおこないます。</p>

<p><br />
</p>]]>
<![CDATA[<p>スタートメニューからプログラム→　Apache HTTP　Server →　Configurel Apache Server → Edit the Apache httpd.conf Configuration File　を選択します。<br />
<img alt="apache-s1.gif" src="http://www.olive-design.com/~cgi/MT/images/apache-s1.gif" width="500" height="155" /><br />
設定ファイルをメモ帳で開いたら、<br />
次の３行を追加します。記述する場所はどこでもかまいません。</p>

<p><strong>ScriptAlias /php/ "c:/php/"<br />
AddType application/x-httpd-php .php .phtml<br />
Action application/x-httpd-php "/php/php.exe"</strong></p>

<p>これで設定は完了です。<br />
Apacheを再起動させておきましょう。<br />
スタートメニューからプログラム→　Apache HTTP　Server →　Control Apache Server → Restart<br />
<img alt="menu-1.gif" src="http://www.olive-design.com/~cgi/MT/images/menu-1.gif" width="400" height="135" /><br />
</p>]]>
</content>
</entry>
<entry>
<title>Windows＋Apache＋PHPインストール（その１）</title>
<link rel="alternate" type="text/html" href="http://www.olive-design.com/~cgi/MT/archives/2005/09/windowsapacheph.html" />
<modified>2005-09-06T12:58:58Z</modified>
<issued>2005-09-06T12:10:26Z</issued>
<id>tag:www.olive-design.com,2005:/~cgi/MT//1.4</id>
<created>2005-09-06T12:10:26Z</created>
<summary type="text/plain">ここでは、Windows2000をWWWサーバーOSとして、 wwwサーバーには...</summary>
<author>
<name>yuuya</name>


</author>
<dc:subject>WindowsでPHP</dc:subject>
<content type="text/html" mode="escaped" xml:lang="ja" xml:base="http://www.olive-design.com/~cgi/MT/">
<![CDATA[<p>ここでは、Windows2000をWWWサーバーOSとして、<br />
wwwサーバーには「Apache」を使ってPHP用のローカルのテスト環境作成例を紹介します。</p>

<p><br />
</p>]]>
<![CDATA[<p>まず最初に<a href="http://www.olive-design.com/~cgi/MT/archives/2005/06/windowapacheact.html">Windows＋Apache＋ActivePerlインストール（その１）</a><br />
を参考にwwwサーバーApacheをインストールします。</p>

<p>次にPHP4の本体を次のURLよりインストールします。<br />
<a href="http://www.php.net/downloads.php">http://www.php.net/downloads.php</a><br />
ここではPHP 4.4.0 zip package をダウンロードします。<br />
ダウンロードしたZIPファイルを解凍先ディレゥトリをC:\にして解凍します。<br />
フォルダ名はphp-4.4.0-Win32からphpに変更しておきます。</p>

<p><img alt="php1.gif" src="http://www.olive-design.com/~cgi/MT/archives/php1.gif" width="300" height="235" /></p>

<p>次にC:\phpにあるphp4ts.dllファイルをシステムディレクトリにコピーします。<br />
各OSのシステムディレクトリは次のとおり。</p>

<p>・Windows95/98/ME        C:\windows\system<br />
・WindowsNT/2000/XP         C:\winnt\system32</p>

<p>次にC:\phpにあるphp.ini-distファイルをWindowsディレクトリにコピーします。<br />
各OSのWindowsディレクトリは次のとおり。</p>

<p>・Windows95/98/ME        C:\windows<br />
・WindowsNT/2000/XP         C:\winnt　または　C:\winnt40 またはC:\windows</p>

<p>コピーしたら、php.ini-distのファイル名をphp.iniに変更します。</p>]]>
</content>
</entry>
<entry>
<title>Windows＋Apache＋ActivePerlインストール（その3）</title>
<link rel="alternate" type="text/html" href="http://www.olive-design.com/~cgi/MT/archives/2005/07/windowsapacheac_1.html" />
<modified>2005-09-08T14:01:54Z</modified>
<issued>2005-07-06T12:48:07Z</issued>
<id>tag:www.olive-design.com,2005:/~cgi/MT//1.3</id>
<created>2005-07-06T12:48:07Z</created>
<summary type="text/plain">再起動させたら、ApacheのDocumentRoot「C:\Program Files\Apache Group\Apache\htdocs」
にcgiファイルを設置して動作確認してみましょう。
</summary>
<author>
<name>yuuya</name>


</author>
<dc:subject>WindowsでPerl</dc:subject>
<content type="text/html" mode="escaped" xml:lang="ja" xml:base="http://www.olive-design.com/~cgi/MT/">
<![CDATA[<p>ActivePerlのインストールがうまくできたら最後にApacheで.cgiファイルが実行できるようにApacheの設定ファイルの編集をおこないます。<br />
</p>]]>
<![CDATA[<p>スタートメニューからプログラム→　Apache HTTP　Server →　Configurel Apache Server → Edit the Apache httpd.conf Configuration File　を選択します。<br />
<img alt="apache-s1.gif" src="http://www.olive-design.com/~cgi/MT/images/apache-s1.gif" width="500" height="155" /><br />
設定ファイルをメモ帳で開いたら、<br />
&lt;Directory "C:/Program Files/Apache Group/htdocs"><br />
という行を探してください。この<Directory "C:/Program Files/Apache Group/htdocs"><br />
から&lt;/Directory>の間に書かれている設定の内容が「ドキュメントルート」と呼ばれApacheWEBサーバーのトップフォルダに設定されています。C:\Program Files\Apache Group\htdocsの場所がhttp://localhost/<br />
のページが表示するファイルが置かれている場所です。<br />
&lt;Directory "C:/Program Files/Apache Group/htdocs"><br />
から<br />
&lt;/Directory><br />
の間に<br />
Options Indexes FollowSymLinks MultiViews<br />
と書かれている行があります。この行を<br />
Options Indexes FollowSymLinks MultiViews ExecCGI<br />
に変更します。<br />
また<br />
 #   AddHandler cgi-script .cgi<br />
と書かれてる行を探して<br />
先頭の#を外します。<br />
　　AddHandler cgi-script .cgi<br />
これで設定は完了です。<br />
Apacheを再起動させておきましょう。<br />
スタートメニューからプログラム→　Apache HTTP　Server →　Control Apache Server → Restart<br />
<img alt="menu-1.gif" src="http://www.olive-design.com/~cgi/MT/images/menu-1.gif" width="400" height="135" /></p>

<p><br />
</p>]]>
</content>
</entry>
<entry>
<title>Windows＋Apache＋ActivePerlインストール（その２）</title>
<link rel="alternate" type="text/html" href="http://www.olive-design.com/~cgi/MT/archives/2005/06/windowsapacheac.html" />
<modified>2005-06-28T14:05:05Z</modified>
<issued>2005-06-28T12:57:37Z</issued>
<id>tag:www.olive-design.com,2005:/~cgi/MT//1.2</id>
<created>2005-06-28T12:57:37Z</created>
<summary type="text/plain">Apacheがうまくインストールできたら、次はActivePerlをインストール...</summary>
<author>
<name>yuuya</name>


</author>
<dc:subject>WindowsでPerl</dc:subject>
<content type="text/html" mode="escaped" xml:lang="ja" xml:base="http://www.olive-design.com/~cgi/MT/">
<![CDATA[<p>Apacheがうまくインストールできたら、次はActivePerlをインストールします。<br />
以下のURLから最新バージョンをダウンロードしてきます。<br />
<a href="http://www.activestate.com/Products/ActivePerl/">http://www.activestate.com/Products/ActivePerl/</a><br />
最新版のWindows のmsiインストーラパッケージをダウンロードしておきます。<br />
ダウンロードしたファイルをダブルクリックしてセットアップをはじめます。</p>]]>
<![CDATA[<p>まずはじめにNext＞で次に進みます。<br />
<img alt="perl-1.gif" src="http://www.olive-design.com/~cgi/MT/images/perl-1.gif" width="300" height="228" /></p>

<p>ライセンス承諾画面です。「I accept the terms in the Licence Agreement 」を選択してNextで次に進みます。<br />
<img alt="perl-2.gif" src="http://www.olive-design.com/~cgi/MT/images/perl-2.gif" width="300" height="229" /></p>

<p>インストールする対象を選択する画面です。標準の設定で問題ないのですが、Locationインストールするフォルダは注意が必要です。インストールするフォルダはBrowseボタンを押して、C:\usrに変更しておきます。これはなぜかというと、よくCGIファイルの一行目に<br />
#!/usr/bin/perl<br />
とパールの位置を記述しますが、これをプロバイダによく使われるperlの位置にパスに合わせておくと<br />
あとあとパスの記述を変更しなくて済むからです。インストール先を変更したらNextで次にいきます。<br />
<img alt="perl-3.gif" src="http://www.olive-design.com/~cgi/MT/images/perl-3.gif" width="300" height="230" /></p>

<p>ファイルの関連付けなどの設定を外してNextで次にいきます。<br />
<img alt="perl-4.gif" src="http://www.olive-design.com/~cgi/MT/images/perl-4.gif" width="300" height="230" /></p>

<p>インストールの準備ができました。Installボタンを押してインストールを開始します。<br />
<img alt="perl-5.gif" src="http://www.olive-design.com/~cgi/MT/images/perl-5.gif" width="300" height="229" /></p>

<p>うまくインストールができたようです。英語に自信がないので「Display eth release notes」のチェックを外してFinishでインストール終了です。<br />
<img alt="perl-6.gif" src="http://www.olive-design.com/~cgi/MT/images/perl-6.gif" width="300" height="228" /></p>]]>
</content>
</entry>
<entry>
<title>Windows＋Apache＋ActivePerlインストール（その１）</title>
<link rel="alternate" type="text/html" href="http://www.olive-design.com/~cgi/MT/archives/2005/06/windowapacheact.html" />
<modified>2005-07-11T12:37:52Z</modified>
<issued>2005-06-26T13:39:53Z</issued>
<id>tag:www.olive-design.com,2005:/~cgi/MT//1.1</id>
<created>2005-06-26T13:39:53Z</created>
<summary type="text/plain">ここでは、Windows2000をWWWサーバーOSとして、wwwサーバーには「...</summary>
<author>
<name>yuuya</name>


</author>
<dc:subject>WindowsでPerl</dc:subject>
<content type="text/html" mode="escaped" xml:lang="ja" xml:base="http://www.olive-design.com/~cgi/MT/">
<![CDATA[<p>ここでは、Windows2000をWWWサーバーOSとして、wwwサーバーには「Apache」を、Perlエンジンには「ActivePerl」を利用して組み合わせにおける、ローカルのCGIテスト環境作成例を紹介します。</p>]]>
<![CDATA[<p>（１）Apacheの入手<br />
まずWebサーバーApacheを次のURLからダウンロードします。<br />
<a href="http://httpd.apache.org/download.cgi">http://httpd.apache.org/download.cgi</a><br />
Win32 Binary の.msi拡張子が付いているMSIインストーラーを使用したパッケージをダウンロードします。</p>

<p>●Windows95/98/NTはMSIインストーラを入手<br />
　マイクロソフトMSIインストーラはWindows2000以降対応なので、それ以外のWindowsを使用している場合は、別途、MSIインストーラ「InstMSI.exe」が必要になります。<br />
InstMSI.exeはマイクロソフトのサイトからダウンロードできるので、これも合わせてダウンロードインストールしておきましょう。</p>

<p>●Windows95/はWindows Socket2のアップデートも必要<br />
Windows95ではWindows Socket2のアップデートも必要となりますのでこれもマイクロソフトのサイトから入手してインストールしておきます。<br />
Apacheのインストール<br />
まずダウンロードしたファイル「ここではapache_2.0.54-win32-x86-no_ssl.msi」をダブルクリックします。<br />
次の画面のようにインストーラが起動しますのでNEXTボタンで次にすすみます。<br />
◎インストーラーの起動<br />
<img alt="apache1.gif" src="http://www.olive-design.com/~cgi/MT/images/apache1.gif" width="300" height="228" /></p>

<p>次に使用承諾の画面が表示されますので「I accept the terms the license agreement」を選択してNEXTボタンで次に進みます。<br />
◎使用承諾の画面<br />
<img alt="apache2.gif" src="http://www.olive-design.com/~cgi/MT/images/apache2.gif" width="300" height="227" /></p>

<p>次にRead　This Firstはざっと目を通しておいてNEXTボタンで次に進みます。<br />
次はサーバーの情報の画面です。インターネットに公開しないのであれば、適当なドメイン名をつけておきましょう。画面下のInstall Apache HTTP Server 2.0 programs and shortcuts for:の蘭は<br />
Apache Webサーバーに80番ポートでアクセスするか、8080番でアクセスするか、という意味です。<br />
デフォルトの80番ポートのままでよいでしょう。<br />
◎サーバー情報の画面<br />
<img alt="apache3.gif" src="http://www.olive-design.com/~cgi/MT/images/apache3.gif" width="300" height="224" /></p>

<p>次はセットアップの選択です。ここでは「Typical」を選んで次にすすみます。<br />
◎セットアップの選択<br />
<img alt="apache4.gif" src="http://www.olive-design.com/~cgi/MT/images/apache4.gif" width="300" height="227" /></p>

<p>インストール選択画面になります。デフォルトではC:\Program Files\Apache Groupです。このままで問題がないのでNEXTボタンをクリックして次の画面に行って最後にInstallボタンをクリックしてApacheをインストールします。<br />
◎インストール選択画面<br />
<img alt="apache5.gif" src="http://www.olive-design.com/~cgi/MT/images/apache5.gif" width="300" height="226" /><br />
◎最終確認メッセージ<br />
<img alt="apache6.gif" src="http://www.olive-design.com/~cgi/MT/images/apache6.gif" width="300" height="224" /></p>

<p>Apacheの起動<br />
スタートメニューからプログラム→　Apache HTTP　Server →　Control Apache Server → Start<br />
を選択してApacheを起動します。Stopを選択するとApache を停止できます。<br />
<img alt="menu-1.gif" src="http://www.olive-design.com/~cgi/MT/images/menu-1.gif" width="400" height="135" /></p>

<p>Apacheの動作確認<br />
うまく起動できたか確認するために、同じマシン上からブラウザで「http://localhost/」にアクセスします。テスト画面がうまく表示されていたら成功です。</p>

<p></p>

<p><br />
</p>]]>
</content>
</entry>

</feed>