Apache --Long-- question, very frustrated!

Les Pendleton kpendle1 at tampabay.rr.com
Wed Jun 14 16:33:24 EDT 2000


I think I might just be a complete moron, but I can't get jack to work
on my system (All Apache related).  I've gone through 2 different books
and still can't figure out anything.

Here were all the files reside for Apache

[les cgi-bin]# find / -name httpd -print
/etc/rc.d/init.d/httpd
/etc/httpd
/var/log/httpd
/var/lock/subsys/httpd
/var/cache/httpd
/home/httpd
/usr/sbin/httpd

First:  I wanted to see what modules are running so I typed httpd -l to
try out the command, I got a reply command not found... I figured that
the path were the executable resides wasn't set, so I cd into every
directory which I felt might might contain that binary and tried it
again, still no luck.  Note:  the server is up and running, you can see
my test page --  http://242827hfc151.tampabay.rr.com/Test/MENU.htm   --
I can't guarantee that the server will be up.. (and with my luck I have
an open door to my entire system, who knows).  I used Netscape's rpm
version for Apache and installed it as follows:   rpm -U {filename}.
seemed to be ok.  I even Managed to update BIND without any problems (or

were there, who knows).   So basically the Apache Sever appears to be
working, but is it fully functional which leads to my second question.

File Permissions and Java Applets (which i asked about earlier and
received 1 reply), which had some good ideas that seemed very logical,
but then again I may be a moron as I stated previously.... the response
stated the following:

Basically I was told to look in the  httpd.conf file and see what groups

and users had the rights to execute stuff, and here's what I found:

# User/Group: The name (or #number) of the user/group to run httpd as.
#  . On SCO (ODT 3) use "User nouser" and "Group nogroup".
#  . On HPUX you may not be able to use shared memory as nobody, and the

#    suggested workaround is to create a user www and use that user.
#  NOTE that some kernels refuse to setgid(Group) or semctl(IPC_SET)
#  when the value of (unsigned)Group is above 60000;
#  don't use Group nobody on these systems!
#
User nobody
Group nobody

Using that information  i went into the directory where my html file are

and changed the owner and group to nobody for all the files that were
used with the applet:

-rwxr-xr-x   1 nobody   nobody      17445 Jun  9 11:58 font.vac
-rwxr-xr-x   1 nobody   nobody       3076 Jun  9 11:58 text.class
-rwxrwxr-x   1 nobody   nobody      10975 Jun  9 11:58 text3d.class

however, I did not change anything on the htm file (by the way all of
the files in my html directory have the following permissions, is this
even correct?  It seems to work -- doesn't mean it's correct.

-rwxr-xr-x   1 root     root         3944 Jun 13 17:46 MENU.htm

And not surprisingly it still doesn't work.  I have no clue on how to
get the applet to work, I thought that Applets were run on the client
side, not on the server --- again I could be incorrect.

Just for the hell of it I typed group to see what groups I have and this

is what resulted:

[root html]# groups
root bin daemon sys adm disk wheel

This seems kind of odd --- nobody isn't listed, does this mean it isn't
a group or is it just a special group that doesn't show up on this
command...

When I did the command:   ps -ef|grep httpd       this is what follows:

root       585     1  0 12:05 ?        00:00:00 httpd
nobody     589   585  0 12:05 ?        00:00:00 httpd
nobody     590   585  0 12:05 ?        00:00:00 httpd
nobody     591   585  0 12:05 ?        00:00:00 httpd
nobody     592   585  0 12:05 ?        00:00:00 httpd
nobody     593   585  0 12:05 ?        00:00:00 httpd
nobody     594   585  0 12:05 ?        00:00:00 httpd
nobody     600   585  0 12:05 ?        00:00:00 httpd
nobody     601   585  0 12:05 ?        00:00:00 httpd

Does this look correct?
Why can't I get the applet running?

One last Question from el moron....
CGI ...... fun fun.

I setup a basic perl program called mailer.pl, which parses stuff
created from a form, here's the link:
http://242827hfc151.tampabay.rr.com/cgi_test.html

Here's the permissions for the perl file:

-rwxr-xr-x   1 nobody   nobody        616 Jun 14 15:27 mailer.pl

Also, my alias for /cgi-bin/ should be correct:
This is what is listed in the httpd.conf file:

ScriptAlias /cgi-bin/ "/home/httpd/cgi-bin/"

Once I submit the info typed on the web page I got the following error
in my error_log:

[Wed Jun 14 15:11:49 2000] [error] (8)Exec format error: exec of
/home/httpd/cgi-bin/mailer.pl failed
[Wed Jun 14 15:11:49 2000] [error] [client 24.28.27.151] Premature end
of script headers: /home/httpd/cgi-bin/mailer.pl

Here is the perl code:

#/usr/bin/perl
use CGI qw(:standard);

print header(), start_html( "Mail from results" ),\
h1( "Mail from results" );

my $to = parse( "to" );
my $from = parse( "from" );
my $subject = parse( "subject" );
my $body = parse( "body" );


open (MAIL, "|/var/qmail/bin/qmail-inject $to") || die "<p>Error:
Couldn't execute qmail. \n";

print MAIL "To: $to\n";
print MAIL "From: $from\n";
print MAIL "subject: $subject\n\n";
print MAIL "$body\m";
close MAIL;

print p( "All right, mailed the following to <tt>$to</tt>:" );
print p( "<pre>\nTo: $to\nFrom: $from\nsubject:
$subject\n\n$body\n</pre> );
print end_html();

One comment about the code, I recently compiled and configured qmail,
what a pain for a novice -- and this is one of those I think it's
working but I really have no clue.  Keep in mind that this perl script
was copied from a book and I made one change:

The book said to use
open (MAIL, "|/usr/lib/sendmail $to") || die "<p>Error: Couldn't execute

qmail. \n";

and i used Becuase the book said to modify code if you use a different
mail system -- I don't know if it's right.

open (MAIL, "|/var/qmail/bin/qmail-inject $to") || die "<p>Error:
Couldn't execute qmail. \n";

I also noticed in my httpd.conf file that the Module for perl was
commented out,
Here's a list of the modules in listed in the file:  Do I need to
un-comment this?

# Note: The order is which modules are loaded is important.  Don't
change
# the order below without expert advice.
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#LoadModule mmap_static_module modules/mod_mmap_static.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule env_module         modules/mod_env.so
LoadModule config_log_module  modules/mod_log_config.so
LoadModule agent_log_module   modules/mod_log_agent.so
LoadModule referer_log_module modules/mod_log_referer.so
#LoadModule mime_magic_module  modules/mod_mime_magic.so
LoadModule mime_module        modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule status_module      modules/mod_status.so
LoadModule info_module        modules/mod_info.so
LoadModule includes_module    modules/mod_include.so
LoadModule autoindex_module   modules/mod_autoindex.so
LoadModule dir_module         modules/mod_dir.so
LoadModule cgi_module         modules/mod_cgi.so
LoadModule asis_module        modules/mod_asis.so
LoadModule imap_module        modules/mod_imap.so
LoadModule action_module      modules/mod_actions.so
#LoadModule speling_module     modules/mod_speling.so
LoadModule userdir_module     modules/mod_userdir.so
LoadModule alias_module       modules/mod_alias.so
LoadModule rewrite_module     modules/mod_rewrite.so
LoadModule access_module      modules/mod_access.so
LoadModule auth_module        modules/mod_auth.so
LoadModule anon_auth_module   modules/mod_auth_anon.so
LoadModule db_auth_module     modules/mod_auth_db.so
LoadModule digest_module      modules/mod_digest.so
LoadModule proxy_module       modules/libproxy.so
#LoadModule cern_meta_module   modules/mod_cern_meta.so
#LoadModule cern_meta_module   modules/mod_cern_meta.so
LoadModule expires_module     modules/mod_expires.so
LoadModule headers_module     modules/mod_headers.so
LoadModule usertrack_module   modules/mod_usertrack.so
#LoadModule example_module     modules/mod_example.so
#LoadModule unique_id_module   modules/mod_unique_id.so
LoadModule setenvif_module    modules/mod_setenvif.so
#LoadModule bandwidth_module   modules/mod_bandwidth.so
#LoadModule put_module          modules/mod_put.so

# Extra Modules
#LoadModule perl_module        modules/libperl.so
#LoadModule php_module         modules/mod_php.so
#LoadModule php3_module        modules/libphp3.so

#  Reconstruction of the complete module list from all available modules

#  (static and shared ones) to achieve correct module execution order.
#  [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE UPDATE THIS, TOO]
ClearModuleList
#AddModule mod_mmap_static.c
AddModule mod_vhost_alias.c
AddModule mod_env.c
AddModule mod_log_config.c
AddModule mod_log_agent.c
AddModule mod_log_referer.c
#AddModule mod_mime_magic.c
AddModule mod_mime.c
AddModule mod_negotiation.c
AddModule mod_status.c
AddModule mod_info.c
AddModule mod_include.c
AddModule mod_autoindex.c
AddModule mod_dir.c
AddModule mod_cgi.c
AddModule mod_asis.c
AddModule mod_imap.c
AddModule mod_actions.c
#AddModule mod_speling.c
AddModule mod_userdir.c
AddModule mod_alias.c
AddModule mod_rewrite.c
AddModule mod_access.c
AddModule mod_auth.c
AddModule mod_auth_anon.c
AddModule mod_auth_db.c
AddModule mod_digest.c
AddModule mod_proxy.c
#AddModule mod_cern_meta.c
#AddModule mod_cern_meta.c
AddModule mod_expires.c
AddModule mod_headers.c
AddModule mod_usertrack.c
#AddModule mod_example.c
#AddModule mod_unique_id.c
AddModule mod_so.c
AddModule mod_setenvif.c
#AddModule mod_bandwidth.c
#AddModule mod_put.c

# Extra Modules
#AddModule mod_perl.c
#AddModule mod_php.c
#AddModule mod_php3.c

I wouls appreciate any help , I'm getting sick of playing with what
should very trivial stufff.... Somebody shouls rith a book that answers
basic questions in a straight forward way like to get an CGI-script to
work for your first time do this .... you'll make a million.

Les Pendleton





-
Subcription/unsubscription/info requests: send e-mail with
"subscribe", "unsubscribe", or "info" on the first line of the
message body to discuss-request at blu.org (Subject line is ignored).



More information about the Discuss mailing list