error_log には、アクセスするたびに No such file or directory と Premature end of script headers の ふたつが出ます。これを手がかりに調べたのですが、 *.cgi は実在しますし、Perl のパスも合っています。 文字コードはどうやって確認するのかがわからず、今から調べる所です。 ただ Windows から転送したわけではないので、 大丈夫かな、とは思っています。
# apachectl start [Sun Jul 8 13:44:56 2001] [alert] httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName /usr/local/sbin/apachectl start: httpd could not be started
This is ApacheBench, Version 1.3c <$Revision: 1.41 $> apache-1.3 Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Copyright (c) 1998-1999 The Apache Group, http://www.apache.org/
Server Software: Apache/1.3.14 Server Hostname: localhost Server Port: 80
Document Path: / Document Length: 14802 bytes
Concurrency Level: 2 Time taken for tests: 0.157 seconds Complete requests: 100 Failed requests: 0 Total transferred: 1505300 bytes HTML transferred: 1480200 bytes Requests per second: 636.94 Transfer rate: 9587.90 kb/s received
Connnection Times (ms) min avg max Connect: 0 0 3 Processing: 2 2 2 Total: 2 2 5
Syntax: ServerTokens Minimal|ProductOnly|OS|Full Default: ServerTokens Full Context: server config Status: core Compatibility: ServerTokens is only available in Apache 1.3 and later; the ProductOnly keyword is only available in versions later than 1.3.12
なにげに MaxClients を 1000 とかにしたら起動時に怒られてしまいました。 "WARNING: MaxClients of 1000 exceeds compile time limit of 256 servers, lowering MaxClients to 256. To increase, please see the HARD_SERVER_LIMIT define in src/include/httpd.h."
>>189-190 Apache2.0.18-alphaのソースを見たところ こちらではPOSIXスレッドを サポートしているようですね ただ ---------------------------------------- NOTE: If you are building on FreeBSD, you should add the argument --with-mpm=prefork to the configure line. The Apache Group has discovered that threads do not work well with Apache on FreeBSD. For that reason, we disable threads by default on FreeBSD, and you need to build the prefork MPM. If you wish to try to make threads work on FreeBSD, they can be re-enabled by using --enable-threads ---------------------------------------- という但し書きが付いています 以下ソースからの抜粋は簡略化のため一部修正しています ---------------------------------------- The following MPMs currently exist:
prefork ....... Multi Process Model with Preforking (Apache 1.3) perchild ...... Multi Process Model with Threading. Constant number of processes, variable number of threads each child process can have a different uid/gid. threaded ...... Multi Process Model with Threading. Variable number of processes, constant number of threads/child (= Apache/thread) spmt_os2 ...... Single Process Model with Threading on OS/2 winnt ......... Single Process Model with Threading on Windows NT --[prefork/mpm_default.h]--------------- #define HARD_SERVER_LIMIT 256 #define HARD_THREAD_LIMIT 1 --[perchild/mpm_default.h]-------------- #define HARD_SERVER_LIMIT 8 #define HARD_THREAD_LIMIT 64 --[threaded/mpm_default.h]-------------- #ifdef NO_THREADS #define HARD_SERVER_LIMIT 256 #define HARD_THREAD_LIMIT 1 #else #define HARD_SERVER_LIMIT 8 #define HARD_THREAD_LIMIT 64 #endif --[spmt_os2/mpm_default.h]-------------- #define HARD_SERVER_LIMIT 1 #define HARD_THREAD_LIMIT 256 --[winnt/mpm_default.h]----------------- #define HARD_SERVER_LIMIT 1 #define HARD_THREAD_LIMIT 4096 ---------------------------------------- まぁOS次第ではHARD_*_LIMITの値はもっと増やしても大丈夫だろうとは思います
ドメイン名によるアクセス制限ってやらない方が良いのでしょうか? ちょっとプロバイダのDNSがムチャクチャ重いので、 Allow from .jp みたいな事をやると、レスポンスが激重になってしまいます。 これって、 HostnameLookups On と同様で、あまり誉められた行為ではないのでしょうか?
AuthConfig Allow use of the authorization directives (AuthDBMGroupFile, AuthDBMUserFile, AuthGroupFile, AuthName, AuthType, AuthUserFile, Require, etc.).
FileInfo Allow use of the directives controlling document types (AddEncoding, AddLanguage, AddType, DefaultType, ErrorDocument, LanguagePriority, etc.).
Indexes Allow use of the directives controlling directory indexing (AddDescription, AddIcon, AddIconByEncoding, AddIconByType, DefaultIcon, DirectoryIndex, FancyIndexing, HeaderName, IndexIgnore, IndexOptions, ReadmeName, etc.).
Limit Allow use of the directives controlling host access (Allow, Deny and Order).
Options Allow use of the directives controlling specific directory features (Options and XBitHack).
/usr/local/apache/bin/apxs -i -c -a mod_encoding.c
とすると下記のようなメッセージが表示され、
mod_encoding.c: In function `iconv_string': mod_encoding.c:115: warning: passing arg 2 of `libiconv' from incompatible pointer type mod_encoding.c: At top level: mod_encoding.c:336: warning: initialization from incompatible pointer type
/usr/local/apache/bin/apachectl configtestを実行すると、
Syntax error on line 240 of /etc/httpd/httpd.conf: Cannot load /usr/local/apache/libexec/mod_encoding.so into server: ld.so.1: /usr/local/apache/bin/httpd: 重大なエラー: 再配置エラー: ファイル /usr/local/apache/libexec/mod_encoding.so: シンボル libiconv: 参照シンボルが見つかりません。
エラーログには「ensure interpreted scripts have "#!" first line」って、 これって、.htmlファイルも.cgiファイルと見てるわけですよね。 htmlファイルはhtmlファイルとして見るようにするにはhttpd.confで 指定するのかなと思ったんですけど、どこをどう変えるのかわかりません。
/home/xxx/public_html/test/.htaccess: DirectoryIndex not allowed her となってしまいます。 どうすれば有効になるのでしょうか?
http.confには
<Directory /home/*/public_html> AllowOverride FileInfo AuthConfig Limit Options All <Limit GET POST OPTIONS PROPFIND> Order allow,deny Allow from all </Limit> <LimitExcept GET POST OPTIONS PROPFIND> Order deny,allow Deny from all </LimitExcept> </Directory>
Solaris8でapache_1.3.22をインストールしたんですけど、CGIがうまく動作しません。 -------------------------------------------------------------- Method Not Allowed The requested method POST is not allowed for the URL /~public_html/cgi-bin/keiji.cgi. -------------------------------------------------------------- というエラーメッセージがでるのですが、どうすればいいのか教えてください。 。
apachectl status とやると「Forbidden」と出てしまうのですが、何が問題なのでしょう? 設定は Allow from 192.168.0. のようにやっているのですが、ブラウザの場合はこれで問題なく server-statusが見れたりします。 もちろん、Allow from all とやればコンソールでも見れるのですが…
Port 80 Listen 80 Listen 1234 <VirtualHost *> Deny from all Allow from 127.0.0.1 Allow from 192.168.0.0/24 DocumentRoot /path/to/80 </VirtualHost> <VirtualHost *:1234> DocumentRoot /path/to/1234 </VirtualHost>
<VirtualHost *> DocumentRoot "/usr/local/apache/htdocs" <Directory /> Deny from all Allow from 127.0.0.1 Allow from 192.168.0.0/24 Options FollowSymLinks AllowOverride None </Directory> <Directory /home/*/public_html> Options Indexes AllowOverride All </Directory> </VirtualHost>
<VirtualHost *:1234> DocumentRoot "/usr/local/apache/htdocs" <Directory /> Allow from all Options FollowSymLinks AllowOverride None </Directory> <Directory /home/*/public_html> Deny from all AllowOverride None </Directory> <Directory /home/*/public_html/docs> Allow from all Options Indexes AllowOverride All </Directory> </VirtualHost>
<Directory /home/*/public_html> AllowOverride FileInfo AuthConfig Limit Indexes Options All <Limit GET POST OPTIONS PROPFIND> Order allow,deny Allow from all </Limit> <LimitExcept GET POST OPTIONS PROPFIND> Order deny,allow Deny from all </LimitExcept> </Directory>
/home/hiroyuki/public_htm/bbsに置いたcgiをブラウザから開くと
Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log.
こうなって/var/log/httpd-error.logには
[Wed Dec 5 03:17:31 2001] [error] [client 192.168.0.2] Premature end of script headers: /home/hiroyuki/public_html/bbs/light.cgi
Premature end of script headers: /home/hiroyuki/public_html/bbs/light.cgi Can't locate ./jcode.pl in @INC (@INC contains: /usr/libdata/perl/5.00503/mach /usr/libdata/perl/5.00503 /usr/local/lib/perl5/site_perl/5.005/i386-freebsd / usr/local/lib/perl5/site_perl/5.005 .) at /home/naoya/public_html/bbs/light.cgi line 34.
|| Forbidden || You don't have permission to access /cgi-bin/ on this server. || || -------------------------------------------------------------------------------- || Apache/1.3.20 Server at node01.1ch.tv Port 80
を追加して # /etc/rc.d/init.d/httpd restart したら Stopping httpd: [ OK ] Starting httpd: [Fri Dec 21 14:47:57 2001] [warn] VirtualHost 210.255.82.203:80 overlaps w ith VirtualHost 210.255.82.203:80, the first has precedence, perhaps you need a NameVirtua lHost directive [ OK ] というメッセージが出ました。
ええと、httpd restartしたところ >Starting httpd: [Fri Dec 21 14:47:57 2001] [warn] VirtualHost 111.111.111.111 overlaps with VirtualHost 111.111.111.111, >the first has precedence, perhaps you need a NameVirtualHost directive というメッセージが出たので、
# Each directory to which Apache has access, can be configured with respect # to which services and features are allowed and/or disabled in that # directory (and its subdirectories). # # First, we configure the "default" to be a very restrictive set of # permissions. # #<Directory /> # Options FollowSymLinks # AllowOverride None #</Directory>
@echo off rem build.bat -- Build Script for the "Hello, World" Application rem $Id: build.bat,v 1.3.2.2 2000/11/27 22:45:57 craigmcc Exp $
set _CP=%CP%
rem Identify the custom class path components we need set CP=%TOMCAT_HOME%\lib\ant.jar;%TOMCAT_HOME%\lib\servlet.jar set CP=%CP%;%TOMCAT_HOME%\lib\jaxp.jar;%TOMCAT_HOME%\lib\parser.jar set CP=%CP%;%JAVA_HOME%\lib\tools.jar
rem Execute ANT to perform the requird build target java -classpath %CP%;%CLASSPATH% org.apache.tools.ant.Main -Dtomcat.home=%TOMCAT_HOME% %1 %2 %3 %4 %5 %6 %7 %8 %9
You don't have permission to access /dummy.htm on this server. ----------------------------------------------------- Apache/1.3.22 Server at www.dumy.or.jp Port 80 <-この部分
---------------------------- UserDir public_html <Directory /home/*/public_html> AllowOverride FileInfo AuthConfig Limit Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec ExecCGI <Limit GET POST OPTIONS PROPFIND> Order allow,deny Allow from all </Limit> <Limit PUT DELETE PATCH PROPPATCH MKCOL COPY MOVE LOCK UNLOCK> Order deny,allow Deny from all </Limit> </Directory> ----------------------------
# log files $LockFile = "logs/httpd.lock"; # lock file for the server $ErrorLog = "logs/error_log"; # Error logs $PidFile = "logs/httpd.pid"; # stores process ID for httpd
指定されたパスが見つかりません。 (22)Invalid argument: <Perl>:Invalid command 'AccessLog' perhaps mis-spelled or defined by a module not included in the server configuration
エラーまでの一連の作業工程はこういったものです。 # cd mod_perl-1.26 # perl Makefile.PL APACHE_SRC=../apache_1.3.23/src \ DO_HTTPD=1 USE_APACI=1 USE_DSO=1 PREP_HTTPD=1 EVERYTHING=1 # make # cd ../apache_1.3.23/ # ./configure --activate-module=src/modules/perl/libperl.a \ --enable-module=most --enable-shared=max # make # cd ../mod_perl-1.26 # make test
その辺の解説ページにあるように、httpd.confの最終行に Include /usr/local/tomcat/conf/mod_jk.conf-auto を加えて、tomcatのサンプルページ /examples/servlet/SessionExample を表示し、投稿を行うと、
Not Found (404) Original request: /examples/servlet/SessionExample%3bjsessionid=s19i3cbb51 Not found request: /examples/servlet/SessionExample%3bjsessionid=s19i3cbb51
>827 該当時刻に再起動をかけるのはapacheのhttpdだけです。 エラーログをチェックしてみると、シグナルを送った直後に Cannot remove module mod_hoge.c : not foud in module list というようにモジュールを取り除けないというエラーが並んでいます。
Include directive Syntax: Include file-path|directory-path Context: server config Status: Core Compatibility: Include is only available in Apache 1.3 and later. This directive allows inclusion of other configuration files from within the server configuration files.
New in Apache 1.3.13 is the feature that if Include points to a directory, rather than a file, Apache will read all files in that directory, and any subdirectory, and parse those as configuration files.
FreeBSD4.5-Rで1.3.22をpkg_addして http://www.planet-green.com/linux/mod_gzip.html を参考にmod_gzip使おうとしましたが、起動できませんでした # /usr/local/sbin/apachectl start Syntax error on line 205 of /usr/local/etc/apache/httpd.conf: Cannot load /usr/local/libexec/apache/mod_gzip.so into server: Shared object "libc.so.6" not found /usr/local/sbin/apachectl start: httpd could not be started
* Fix the security vulnerability noted in CAN-2002-0061 (mitre.org) regarding the escaping of command line args on Win32. * Prevent invalid client hostnames from appearing in the log file.
New features
The main new features in 1.3.24 (compared to 1.3.23) are:
* Various mod_proxy improvements, such as the new ProxyIOBufferSize directive. * The new ''IgnoreCase' keyword to the IndexOptions directive.
New features that relate to specific platforms:
* Added the module mod_log_nw to handle log rotation under NetWare.
Bugs fixed
The following bugs were found in Apache 1.3.23 (or earlier) and have been fixed in Apache 1.3.24:
* mod_rewrite's 'rnd' was broken and has been fixed. * The '-S' option of 'apxs' was not able to handle quotes; also 'apxs' is now rebuilt when options are changed. * proxy now correctly handles Cookies and X-Cache headers.
The following bugs relate to specific platforms:
* Fixed a problem in TPF when we were using the wrong subpool when opening the error log. * pthread accept() mutexes on Solaris were broken (since we were not linking against pthread)
please recompile it with -DEAPI という事なのでコンパイル?とか思ったのですが portsからapache1.3-modssl,php4をいれてるので make installしかしてないです。 どこでコンパイルって作業すればいいのでしょうか? configureっていう奴ですよね?