Apache Cgi problème invalid hostname

Apache Cgi problème invalid hostname - Windows & Software

Marsh Posté le 30-06-2005 à 14:47:29    

Bonjour à tous,
j'essaie de faire fonctionner un script cgi sous mandrake 10. Mais sans succès. J'ai prit soins de vérifier la configuration de mon serveur Apache ainsi que l'installation des modules nécessaires.
 
Afin d'etre certain que le problème ne venait pas de mon scipt cgi, j'ai fait un script test simple que voici :

Code :
  1. #/usr/bin/perl -w
  2. use CGI;
  3. print "Content-Type: text/html\n\n";
  4. #Création du fichier html de retour à l'execution du script perl##################
  5. print "<html>";
  6. print "<h3>Test CGIIIIIIIIIIIIII</h3>";
  7. print "</html>";


Ce script est placé dans var/www/cgi-bin/
 
Je lance ce script via une page html simple (dans var/www/html/public_html/):
 

Code :
  1. <
  2. <html>
  3. <head>
  4. </head>
  5. <body>
  6.   <form method="POST" name="form" action="/cgi-bin/toto.pl">
  7.   <input type="submit" value="Envoyer">
  8.   </form>
  9. </body>
  10. </html>


 
Voila le message d'erreur que j'obtiens:

Code :
  1. Internal Server Error
  2. The server encountered an internal error or misconfiguration and was unable to complete your request.


 
J'ai donc exploré ensuite le fichier httpd/error_log

Code :
  1. [Thu Jun 30 13:55:54 2005] [error] [client 127.0.0.1] Premature end of script headers: toto.pl, referer: http://127.0.0.1/public_html/test_cgi.php
  2. [Thu Jun 30 13:55:54 2005] [error] [client 127.0.0.1] mod_auth_radius: WARNING! INVALID HOSTNAME! Assuming 127.0.0.1, referer: http://127.0.0.1/public_html/test_cgi.php


 
Je ne trouve pas la solution, merci pour votre aide  :hello:

Reply

Marsh Posté le 30-06-2005 à 14:47:29   

Reply

Marsh Posté le 30-06-2005 à 16:30:15    

:bounce:

Reply

Marsh Posté le 01-07-2005 à 09:10:41    

JE vous colle ici le httpd.conf:

Code :
  1. ### Main Configuration Section
  2. ### You really shouldn't change these settings unless you're a guru
  3. ###
  4. ServerType standalone
  5. ServerRoot /etc/httpd
  6. #ServerName localhost
  7. #LockFile /etc/httpd/httpd.lock
  8. PidFile /var/run/httpd.pid
  9. ScoreBoardFile /etc/httpd/httpd.scoreboard
  10. ErrorLog logs/error_log
  11. LogLevel warn
  12. ResourceConfig /dev/null
  13. AccessConfig /dev/null
  14. DocumentRoot /var/www/html
  15. ### Dynamic Shared Object (DSO) Support
  16. ###
  17. ###
  18. #LoadModule mmap_static_module modules/mod_mmap_static.so
  19. LoadModule env_module         modules/mod_env.so
  20. LoadModule config_log_module  modules/mod_log_config.so
  21. LoadModule agent_log_module   modules/mod_log_agent.so
  22. LoadModule referer_log_module modules/mod_log_referer.so
  23. #LoadModule mime_magic_module  modules/mod_mime_magic.so
  24. LoadModule mime_module        modules/mod_mime.so
  25. LoadModule negotiation_module modules/mod_negotiation.so
  26. LoadModule status_module      modules/mod_status.so
  27. LoadModule info_module        modules/mod_info.so
  28. LoadModule includes_module    modules/mod_include.so
  29. LoadModule autoindex_module   modules/mod_autoindex.so
  30. LoadModule dir_module         modules/mod_dir.so
  31. LoadModule cgi_module         modules/mod_cgi.so
  32. LoadModule asis_module        modules/mod_asis.so
  33. LoadModule imap_module        modules/mod_imap.so
  34. LoadModule action_module      modules/mod_actions.so
  35. #LoadModule speling_module     modules/mod_speling.so
  36. LoadModule userdir_module     modules/mod_userdir.so
  37. LoadModule proxy_module       modules/libproxy.so
  38. LoadModule alias_module       modules/mod_alias.so
  39. LoadModule rewrite_module     modules/mod_rewrite.so
  40. LoadModule access_module      modules/mod_access.so
  41. LoadModule auth_module        modules/mod_auth.so
  42. LoadModule anon_auth_module   modules/mod_auth_anon.so
  43. #LoadModule dbm_auth_module    modules/mod_auth_dbm.so
  44. #LoadModule db_auth_module     modules/mod_auth_db.so
  45. LoadModule digest_module      modules/mod_digest.so
  46. #LoadModule cern_meta_module   modules/mod_cern_meta.so
  47. LoadModule expires_module     modules/mod_expires.so
  48. LoadModule headers_module     modules/mod_headers.so
  49. LoadModule usertrack_module   modules/mod_usertrack.so
  50. #LoadModule example_module     modules/mod_example.so
  51. #LoadModule unique_id_module   modules/mod_unique_id.so
  52. LoadModule setenvif_module    modules/mod_setenvif.so
  53. LoadModule vhost_alias_module    modules/mod_vhost_alias.so
  54. #  Reconstruction of the complete module list from all available modules
  55. #  (static and shared ones) to achieve correct module execution order.
  56. #  [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE UPDATE THIS, TOO]
  57. ClearModuleList
  58. #AddModule mod_mmap_static.c
  59. AddModule mod_env.c
  60. AddModule mod_log_config.c
  61. AddModule mod_log_agent.c
  62. AddModule mod_log_referer.c
  63. #AddModule mod_mime_magic.c
  64. AddModule mod_mime.c
  65. AddModule mod_negotiation.c
  66. AddModule mod_status.c
  67. AddModule mod_info.c
  68. AddModule mod_include.c
  69. AddModule mod_autoindex.c
  70. AddModule mod_dir.c
  71. AddModule mod_cgi.c
  72. AddModule mod_asis.c
  73. AddModule mod_imap.c
  74. AddModule mod_actions.c
  75. #AddModule mod_speling.c
  76. AddModule mod_userdir.c
  77. AddModule mod_proxy.c
  78. AddModule mod_alias.c
  79. AddModule mod_rewrite.c
  80. AddModule mod_access.c
  81. AddModule mod_auth.c
  82. AddModule mod_auth_anon.c
  83. #AddModule mod_auth_dbm.c
  84. #AddModule mod_auth_db.c
  85. AddModule mod_digest.c
  86. #AddModule mod_cern_meta.c
  87. AddModule mod_expires.c
  88. AddModule mod_headers.c
  89. AddModule mod_usertrack.c
  90. #AddModule mod_example.c
  91. #AddModule mod_unique_id.c
  92. AddModule mod_so.c
  93. AddModule mod_setenvif.c
  94. AddModule mod_vhost_alias.c
  95. ###
  96. ### Global Configuration
  97. ###
  98. # We now support multiple apache configurations on the same server. In
  99. # common.conf, we put all directives that are common to all implementations
  100. # (httpd, httpd-perl, etc.)
  101. Include conf/commonhttpd.conf
  102. ###
  103. ### IP Address/Port and Proxied configuration section
  104. ###
  105. # The APACHEPROXIED setting can be set in /etc/rc.d/init.d/httpd if you
  106. # are using a proxy or accelerator, like the Apache-SGI or khttpd, so that
  107. # the fast web server serves static content while Apache handles the
  108. # cgi or php files
  109. #BindAddress *
  110. <IfDefine APACHEPROXIED>
  111.   Port 8080
  112.   Listen 8080
  113. </IfDefine>
  114. <IfDefine !APACHEPROXIED>
  115.   Port 80
  116.   Listen 80
  117. </IfDefine>
  118. # Likewise, we can set apache as the server by default and send perl
  119. # requests via ProxyPass to apache-mod_perl. It increases performance
  120. # since the perl interpreter is only used for perl and the standard apache
  121. # does all the html and image files, with a smaller footprint.
  122. #
  123. # If you install apache and apache-mod_perl, this is the default config.
  124. # If you don't want two web servers to use perl, uninstall apache, and
  125. # apache-mod_perl will not be proxied.
  126. <IfDefine PERLPROXIED>
  127.   RewriteEngine on
  128.   RewriteRule ^proxy:.*  -  [F]
  129.   RewriteRule ^(.*\/perl\/.*)$  http://%{HTTP_HOST}:8200$1 [P]
  130.   RewriteRule ^(.*\/cgi-perl\/.*)$  http://%{HTTP_HOST}:8200$1 [P]
  131. </IfDefine>
  132. ###
  133. ### Log configuration Section
  134. ###
  135. #Single logfile with access, agent and referer information
  136. #This is the default, if vlogs are not defined for the main server
  137. CustomLog logs/access_log combined env=!VLOG
  138. #If VLOG is defined in conf/vhosts/Vhost.conf, we use this entry
  139. CustomLog "|/usr/sbin/advxsplitlogfile" vhost env=VLOG
  140. ###
  141. ### Virtual Hosts
  142. ###
  143. # We include different templates for Virtual Hosting. Have a look in the
  144. # vhosts directory and modify to suit your needs.
  145. Include conf/vhosts/Vhosts.conf
  146. #Include conf/vhosts/DynamicVhosts.conf
  147. #Include conf/vhosts/VirtualHomePages.conf
  148. ###
  149. ### Performance settings Section
  150. ###
  151. #
  152. # Timeout: The number of seconds before receives and sends time out.
  153. #
  154. Timeout 300
  155. #
  156. # KeepAlive: Whether or not to allow persistent connections (more than
  157. # one request per connection). Set to "Off" to deactivate.
  158. #
  159. KeepAlive On
  160. #
  161. # MaxKeepAliveRequests: The maximum number of requests to allow
  162. # during a persistent connection. Set to 0 to allow an unlimited amount.
  163. # We recommend you leave this number high, for maximum performance.
  164. #
  165. MaxKeepAliveRequests 100
  166. #
  167. # KeepAliveTimeout: Number of seconds to wait for the next request from the
  168. # same client on the same connection.
  169. #
  170. KeepAliveTimeout 15
  171. #
  172. # Server-pool size regulation.  Rather than making you guess how many
  173. # server processes you need, Apache dynamically adapts to the load it
  174. # sees --- that is, it tries to maintain enough server processes to
  175. # handle the current load, plus a few spare servers to handle transient
  176. # load spikes (e.g., multiple simultaneous requests from a single
  177. # Netscape browser).
  178. #
  179. # It does this by periodically checking how many servers are waiting
  180. # for a request.  If there are fewer than MinSpareServers, it creates
  181. # a new spare.  If there are more than MaxSpareServers, some of the
  182. # spares die off.  The default values are probably OK for most sites.
  183. #
  184. MinSpareServers 4
  185. MaxSpareServers 10
  186. #
  187. # Number of servers to start initially --- should be a reasonable ballpark
  188. # figure.
  189. #
  190. StartServers 4
  191. #
  192. # Limit on total number of servers running, i.e., limit on the number
  193. # of clients who can simultaneously connect --- if this limit is ever
  194. # reached, clients will be LOCKED OUT, so it should NOT BE SET TOO LOW.
  195. # It is intended mainly as a brake to keep a runaway server from taking
  196. # the system with it as it spirals down...
  197. #
  198. MaxClients 150
  199. #
  200. # MaxRequestsPerChild: the number of requests each child process is
  201. # allowed to process before the child dies.  The child will exit so
  202. # as to avoid problems after prolonged use when Apache (and maybe the
  203. # libraries it uses) leak memory or other resources.  On most systems, this
  204. # isn't really needed, but a few (such as Solaris) do have notable leaks
  205. # in the libraries. For these platforms, set to something like 10000
  206. # or so; a setting of 0 means unlimited.
  207. #
  208. # NOTE: This value does not include keepalive requests after the initial
  209. #       request per connection. For example, if a child process handles
  210. #       an initial request and 10 subsequent "keptalive" requests, it
  211. #       would only count as 1 request towards this limit.
  212. #
  213. MaxRequestsPerChild 500


 
Un peu d'aide please  :(

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed