TOPページ掲示板
作成日:2005年01月20日 作成:Yosi

Vine Linuxで自宅サーバーの掲示板で過去に質問された内容です。

No.298 Apacheの基本設定


No.298 投稿時間:2005年01月20日(Thu) 17:52 投稿者名:ystep URL:http://my-hobby.ddo.jp
タイトル:Apacheの基本設定

お世話に成ります
YosiさんのApacheの基本設定の頁で質問です、
現在:DocumentRoot /home/httpd/mastor
グループ:adminn ユーザーmasutor
ProFTPD:ホームデレクトリーhome/masutor
グループ  adominn
-------------------------------------------------------------
デレクトリーの設定変更の行で
/home/httpd/cgi-binデレクトリの移動で
自分の場合も下記で良いですか?
-----------------------------------------------------------
# cd /home/httpd
# cgi-bin html ←htmlで良いのか
#chgrp -R adminn/home/httpd
#chown -R mastor/home/httpd
----------------------------------------------------------
現在bbs.cgiとindex.htmlの混じった掲示板をcgi-binの下に設定すると、index.htmlがポート80エラーに成るので
例:httpd/cgi-bin/pppp/bbs.cgi
httpd/pppp/index.html で設定してますが
-----------------------------------------------------------
デレクトリの設定変更で
httpd/cgi-binの下で無く
httpd/masutorの下にcgi の設定可能になるのですか?
sgさんのお陰でほんの少し解る様に成ったのですが未だ未熟故説明が下手なのですが宜しくお願い致します


No.299 投稿時間:2005年01月20日(Thu) 18:47 投稿者名:sg URL:http://tsuttayo.sytes.net/
タイトル:面倒なので

$ su -
# emacs /etc/httpd/conf.d/ystep.conf
ここで、次のようなファイルを作ってしまったらどうでしょう。

#---------------------------------
# ルート・ディレクトリの指定
DocumentRoot /home/httpd/mastor

# CGIスクリプトの拡張子
AddHandler cgi-script .cgi

# DocumentRootの各種設定
<Directory /home/httpd/mastor>
# Options ExecCGI: CGI実行を許可する
Options ExecCGI
# AllowOverride All: .htaccessで設定値の変更をすべて可能とする
AllowOverride All
</Directory>
#---------------------------------

このファイルを作ってApacheを再起動し、動作確認してダメなら
このファイル自体を削除すりゃー、元の状態に戻るので
一度、やってみてくださいな。
ただし、すでにたくさんhttpd.confを書き換えているようなので
上記で必ずうまくいくかはわかりません。


No.300 投稿時間:2005年01月20日(Thu) 21:22 投稿者名:ystep URL:http://my-hobby.ddo.jp
タイトル:Re: 面倒なので

> $ su -
> # emacs /etc/httpd/conf.d/ystep.conf
> ここで、次のようなファイルを作ってしまったらどうでしょう。
>
> #---------------------------------
> # ルート・ディレクトリの指定
> DocumentRoot /home/httpd/mastor
>
> # CGIスクリプトの拡張子
> AddHandler cgi-script .cgi
>
> # DocumentRootの各種設定
> <Directory /home/httpd/mastor>
> # Options ExecCGI: CGI実行を許可する
> Options ExecCGI
> # AllowOverride All: .htaccessで設定値の変更をすべて可能とする
> AllowOverride All
> </Directory>
> #---------------------------------
>
> このファイルを作ってApacheを再起動し、動作確認してダメなら
> このファイル自体を削除すりゃー、元の状態に戻るので
> 一度、やってみてくださいな。
> ただし、すでにたくさんhttpd.confを書き換えているようなので
> 上記で必ずうまくいくかはわかりません。
-----------------------------------------------------------

現在の状態です
-----------------------------------------------------------、
user nobody
Group nobody
-----------------------------------------------------------------------
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>

#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#

#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory /home/httpd/html>←**変更で良いですか(master)

#
# This may also be "None", "All", or any combination of "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
Options ExecCGI FollowSymLinks Includes

#
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"
#
AllowOverride None

#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>

#
# UserDir: The name of the directory which is appended onto a user's home
# directory if a ~user request is received.
#
# The path to the end user account 'public_html' directory must be
# accessible to the webserver userid. This usually means that ~userid
# must have permissions of 711, ~userid/public_html must have permissions
# of 755, and documents contained therein must be world-readable.
# Otherwise, the client will only receive a "403 Forbidden" message.
#
# See also: http://httpd.apache.org/docs/misc/FAQ.html#forbi
-----------------------------------------------------------------------------
ScriptAlias /cgi-bin/ /home/httpd/cgi-bin/ #コメントアウトするのですか?

#
# "/home/httpd/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory /home/httpd/cgi-bin>
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
------------------------------------------------------------------------

# If you want to use server side includes, or CGI outside
# ScriptAliased directories, uncomment the following lines.
#
# To use CGI scripts:
#
AddHandler cgi-script .cgi.pl
AddHandler image/gif .gif
AddHandler image/jpeg .jpeg
AddHandler image/png .png
AddHandler text/html .html .htm

#
# To use server-parsed HTML files
#
AddType text/html .shtml
AddHandler server-parsed .shtml

#
# Uncomment the following line to enable Apache's send-asis HTTP file
# feature
#


No.301 投稿時間:2005年01月20日(Thu) 22:02 投稿者名:sg URL:http://tsuttayo.sytes.net/
タイトル:現在は関係ない

現在の状況は無関係。上に書いたことをもう一度よく読んで。


No.302 投稿時間:2005年01月20日(Thu) 22:47 投稿者名:ystep URL:http://my-hobby.ddo.jp
タイトル:Re: 現在は関係ない

> 現在の状況は無関係。上に書いたことをもう一度よく読んで。
/etc/httpd/conf.d/ystep.conf
-------------------------------------
DocumentRoot /home/httpd/master
AddHandler cgi-script .cgi
<Directory /home/httpd/master>
Options ExecCGI
AllowOverride All
</Directory>
で保存で良いですか、


No.303 投稿時間:2005年01月20日(Thu) 23:02 投稿者名:ystep URL:http://my-hobby.ddo.jp
タイトル:Re^2: 現在は関係ない

> > 現在の状況は無関係。上に書いたことをもう一度よく読んで。
> /etc/httpd/conf.d/ystep.conf
> -------------------------------------
> DocumentRoot /home/httpd/master
> AddHandler cgi-script .cgi
> <Directory /home/httpd/master>
> Options ExecCGI
> AllowOverride All
> </Directory>
> で保存で良いですか、
------------------------------------------------
有難う御座います
何がどうなって作用してるか解りませんが?
出来ました、仮テストで
http://my-hobby.ddo.jp/aska/aska.cgi


No.304 投稿時間:2005年01月20日(Thu) 23:05 投稿者名:sg URL:http://tsuttayo.sytes.net/
タイトル:よくよんてで

もう一度、よく読んで。

それと、どうしてわざわざコメントをはずすんでしょうか?
コメントを入れておいたほうが明らかにわかりやすいのに。


No.305 投稿時間:2005年01月20日(Thu) 23:15 投稿者名:ystep URL:http://my-hobby.ddo.jp
タイトル:Re: よくよんてで

> もう一度、よく読んで。
>
> それと、どうしてわざわざコメントをはずすんでしょうか?
> コメントを入れておいたほうが明らかにわかりやすいのに。

#が有れば日本語も問題無いのですか?
今から挿入可能ですか。


No.306 投稿時間:2005年01月20日(Thu) 23:34 投稿者名:sg URL:http://tsuttayo.sytes.net/
タイトル:Re^2: よくよんてで

> #が有れば日本語も問題無いのですか?

そうです。
だから、設定ファイルには、わかったところだけでも日本語でコメントを入れましょう。
これをずーっと続けていれば、いつかはわかるようになりますよ。

> 今から挿入可能ですか。

できます、emacsで編集しましょう。


No.307 投稿時間:2005年01月20日(Thu) 23:41 投稿者名:ystep URL:http://my-hobby.ddo.jp
タイトル:Re^3: よくよんてで

> > #が有れば日本語も問題無いのですか?
>
> そうです。
> だから、設定ファイルには、わかったところだけでも日本語でコメントを入れましょう。
> これをずーっと続けていれば、いつかはわかるようになりますよ。
>
> > 今から挿入可能ですか。
>
> できます、emacsで編集しましょう。
有難うございます、頭悪いけれど少しずつ分かる気がします。



TOPページ掲示板▲頁先頭