| MAIN | OFFCIAL | BBS | DOWNLOAD | MIRROR | 
再インストール時に Webサーバーもインストールし、起動もしてあったのでユーザーホルダーの設定と httpd.confの設定をする。
 HTTPD起動
 HTTPD起動$ /sbin/service httpd start
※ 間違った httpdの起動だったかも知れないが Fedora起動時の詳細表示で httpd [起動]を確認し Test Pageも確認していた。
 以下、Apache HTTPDサーバーの設定 を参考に設定。
 
以下、Apache HTTPDサーバーの設定 を参考に設定。 パーミッションとwww用フォルダー設定
 パーミッションとwww用フォルダー設定
$ chmod 701 ~
$ mkdir -m 705 ~/public_html
 httpd.confの設定
 httpd.confの設定httpdのフォルダー確認
$  whereis httpd
httpd: /usr/sbin/httpd /usr/sbin/httpd.worker /etc/httpd 〜省略〜
※ /etc/httpd/confにある httpd.confを httpd.conf.orgとしてバックアップをとってから設定の変更をした。
Listen 127.0.0.1:80
ServerName 127.0.0.1:80
# UserDir disable
UserDir public_html
<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes FollowSymLinks Includes ExecCGI
</Directory>
AddDefaultCharset UTF-8   ← このまま設定 ※変更
AddHandler cgi-script .cgi
※ shift-jisを表示する時エンコードし直すのが面倒になったので 変更 した。
#AddDefaultCharset UTF-8   ← 変 更
※※ php 設定 追加
#
# TypesConfig describes where the mime.types file (or equivalent) is
# to be found.
#
TypesConfig /etc/mime.types
    AddType application/x-httpd-php .php .inc .html .htm   ← 追 加
参考とは違って、HTTPDは起動済なので restart してみたところ 起動に失敗した。
$ /sbin/service httpd restart
httpd を停止: [成功]
 
httpd を起動: [失敗]
その後バックアップしてあった httpd.conf.orgを戻して startしても駄目だった。 また、参考ページのコマンドも試してみたが駄目だった。
システムをリブートして起動の詳細を見ても、httpdは [失敗] だった。
その後
「某店長」のアドバイスで SELinuxを無効に設定して httpdを起動したら成功した。
$ /sbin/service httpd start
httpd を起動: [成功]
 
※ 自分は SELinuxが何をするものか理解していない・・・・
ブラウザのアドレス欄に "http://localhost/~hoge/" と入力したら 空のフォルダーが見れた。 次に適当な index.htmlを /home/hoge/public_html にコピーしてブラウザで表示する事を確認した。
 CGI 動作確認
 CGI 動作確認テスト CGIを作成するために perl位置を確認
$ whereis perl
perl: /usr/bin/perl  〜省略〜
 test.cgiの作成
 test.cgiの作成
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<html>\n";
print "<head>\n";
print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n";
print "<title>CGIテスト</title>\n";
print "</head>\n";
print "<body>\n";
print "CGIテスト\n";
print "</body>\n";
print "</html>\n";
 test.cgiの結果
 test.cgiの結果CGIテスト
 ssiの確認
 ssiの確認
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>SSIテスト</title>
<body>
SSIテスト
<!--#config timefmt="%Y/%m/%d %H:%M:%S" -->
<!--#echo var="DATE_LOCAL" -->
</body>
</html>
 ssi.shtmlの結果
 ssi.shtmlの結果
SSIテスト 2007/06/10 07:06:57
 PHPの確認
 PHPの確認
<?PHP
phpinfo();
?>
 info.phpの結果
 info.phpの結果
〜 省 略 〜 実際の結果表示 別窓で開きます。
 helo.php
 helo.php
<?PHP
echo "<br>Hello, world!!<br><br>\n";
?>
 helo.phpの結果
 helo.phpの結果Hello, world!!
 incl.php
 incl.php
<?php
print "---------------<br>\n";
include 'helo.php';
print "---------------<br>\n";
?>
 incl.phpの結果
 incl.phpの結果
---------------
Hello, world!!
---------------
 incl.html
 incl.html
<html>
<body>
---------------<br>
<?php
include 'helo.php';
?>
---------------<br>
</body>
</html>
 incl.htmlの結果
 incl.htmlの結果
---------------
---------------
 httpd.conf に mime types 追加後の結果
 httpd.conf に mime types 追加後の結果
---------------
Hello, world!!
---------------
※※※ ルートで httpd.conf 編修後 httpdの再起動無しでの 設定変更が ブラウザから確認出来た。
 補則確認 (括弧)有り無し・結果同じ
 補則確認 (括弧)有り無し・結果同じ
<?PHP
include ('helo.php');
include 'helo.php';
?>