Apache HTTP Server Version 1.3.11 (Amiga)
FAQ
- Using Amiga-Apache
- Compiling Amiga-Apache
Go to the old FAQ.
What is it?
Q: What is this program actually about?
A: Amiga Apache is the Amiga port of Apache, the web server used
on most of the machines in the internet. It allows others to access web
pages on your computer you want to publish. It doesn't cost you any money -
since the original Apache is distributed under the GPL (GNU public licence),
the port also it, which basically means its free.
Anyway, if you want to tell me you're using Amiga Apache,
feel absolutely free to send me a postcard from your home town
to:
Rüdiger Kuhlmann
Im Gießenbach 59
57234 Wilnsdorf
GERMANY
Who is doing it?
Q: Who is doing all this work?
A:
The Amiga port of Apache has been compiled by Jeff Shepherd with some changes and bug fixes by
Rüdiger Kuhlmann.
The website was originally hosted and maintained by Bert Vortman (who seems to have
disappeared from the net) at http://www.xs4all.nl/~albertv/apache/index.html,
and is now maintained by Rüdiger Kuhlmann at http://amiga-apache.home.pages.de,
who also runs the mailinglist and did the last Aminet upload.
The FAQ was somewhen maintained by Brett Burridge, who seems not
to be involved in the Amiga anymore, and seems like I have to continue his
work.
Remember that all persons are volunteers - feel free to contribute.
Apache won't start. I'm using
AFS/PFS/PFS3.
Q: When I try to start Apache, it complains that it can't open it's logfiles.
I'm using AFS/PFS/PFS3. What is going on?
A: AFS/PFS/PFS3 has the bug to not allow programs to open a
file several times at the same time in MOD_READWRITE, although this is
perfectly legal. Unfortunately, AmigaApache spawns a bunch of subprocesses,
and each one tries to open the necessary log files during it's startup.
Hence, you have to put your logfiles onto a non-AFS/PFS/PFS3/partition;
FFS, SFS or even RAM and RAD will do.
UPDATE: There is an update on Aminet in the
biz/patch
directory to fix this problem for PFS3.
configure
doesn't
even find cat, rm, sed etc.
Q: I'm trying to recompile, but configure doesn't even find cat, rm, sed etc, although
I can start them using my Amiga shell. It's strange anyway, these files are listed as if
they were directories. I'm using SFS < 1.62. This is what configure says, when I use the
supplemented config.status.68040 file:
1.Tmp:apache_1.3.11> sh ./config.status.68040
./configure: ./configure[104]: cat: not found
./configure: ./configure[104]: grep: not found
./configure: ./configure[104]: sed: not found
Configuring for Apache, Version
src/helpers/PrintPath: src/helpers/PrintPath[86]: sed: not found
[...]
configure:Error: Path layout definition not found or incorrect
1.Tmp:apache_1.3.11>
A: You should update SFS to at least version 1.62. There is a bug
in GG which prevent symbolic links to work properly using ixemul, which
doesn't show up when you use FFS. A workaround was added for SFS 1.62.
The newest version of SFS can always be found at
http://www.xs4all.nl/~hjohn/,
but it might still be a beta release. As for SFS 1.84, do not use the defragmenter
unless you want to be a beta-tester.
make
breaks with an error about "struct timeval".
Q: I'm trying to recompile, but when I type
make
, it breaks with an error about "struct timeval". Here is
what it says:
1.Tmp:apache_1.3.11> make
===> src
make[1]: Entering directory /Tmp/apache_1.3.11'
make[2]: Entering directory /Tmp/apache_1.3.11/src'
===> src/os/amiga
gcc -c -I../../os/amiga -I../../include -m68040 -O2 -resident32 -mstackextend -Dfork=vfork -DNO_DBM_REWRITEMAP ../../apaci os.c
In file included from /gg/include/dos/dosextens.h:26,
from /gg/include/clib/dos_protos.h:18,
from /gg/include/proto/dos.h:11,
from ../../include/ap_config.h:285,
from ../../include/httpd.h:71,
from os.c:7:
/gg/include/devices/timer.h:25: redefinition of `struct timeval'
make[3]: *** [os.o] Error 1
make[2]: *** [subdirs] Error 1
make[2]: Leaving directory /Tmp/apache_1.3.11/src'
make[1]: *** [build-std] Error 2
make[1]: Leaving directory /Tmp/apache_1.3.11'
make: *** [build] Error 2
1.Tmp:apache_1.3.11>
A: This is a conflict between the unix and the AmigaOS definition
of "struct timeval". There used to be a patch, which fiddled around with the
AmigaOS include (bad idea), but I can't find it anymore. Anyway, the cleaner
way to do it is the following: In the file /gg/include/sys/time.h
,
replace the following code:
#ifndef DEVICES_TIMER_H
/* Use whatever was included first, standard or Amiga (devices/timer.h)
* includes (jch). */
struct timeval {
long tv_sec; /* seconds */
long tv_usec; /* and microseconds */
};
#else
#define tv_sec tv_secs
#define tv_usec tv_micro
#endif
into the following lines:
/* Always use Amiga include */
#include <devices/timer.h>
#define tv_sec tv_secs
#define tv_usec tv_micro
And everything will be fine.
The Amiga port of the Apache webserver - Frequently
asked questions.
This document is version 1.12 of the Amiga Apache FAQ.
It was last modifed on the 8 August 1997. All comments, questions etc.
about this FAQ should be addressed to apache@babylon6.demon.co.uk
or alternatively use the feedback form located here.
Note that will I accept no responsibility for any losses incurred as a
result of following any of the procedures described in this document -
proceed at your own risk.
Note that this is an early draft of the FAQ
- there's still a lot of work to be done, and as I am about to start a new job, little time to do it in. If you want to add to the FAQ,
or have suggestions for additions, then send mail to the address above.
I am well aware of the problems with the poor layout of the FAQ in Voyager-NG,
there's nothing I can do about that :-( (it looks fine in AWeb-II, AMosaic,
MS IE4 and Netscape 2). At the moment, I am particularly interested in
the following:
Known Amigas connected to the WWW. It
would be useful to list a few Amiga Apache webservers, just to show that
the Amiga really can be used as a server. Note that I'm only really interested
in sites permanently connected to the WWW.
Cool AREXX scripts to use with the server. The Amiga's
biggest advantage over other systems as far as Apache is concerned is AREXX,
so let's show what the machine is capable of.
1.Background
2. Technical aspects
1. Background
What is Apache?
The Apache webserver software was created as an alternative
to the popular NCSA httpd webserver. It has more features greater functionality,
and is now the most popular webserver software on the Internet. Put very
simply, Apache is the software that allows people to run websites on their
machines. The webserver originated on Unix systems, but has since been
ported to many other systems, including the Amiga.
The Apache server project is completely run by volunteers,
and there is no official technical support.
The Amiga version
The Amiga port of the Apache webserver has been compiled
by Jeff Shepherd, (jshepher@mks.com)
with the documentation and main Amiga Apache web site being maintained
by Bert Vortman (apache@dsdelft.nl).
This FAQ is maintained by Brett Burridge (apache@babylon6.demon.co.uk),
with contributions from Jeff, Bert and other Amiga Apache users. As with
the original Unix version of Apache, all persons connected with the Amiga
Apache project are volunteers.
What you need
to run it
An Amiga ;-) Any model should do, but
a minimum of 4Mb fast RAM is a good thing for running the machine
offline. If you want your server permanently connected to the WWW, you
will need a truck load of RAM to prevent it chocking if several users are
logged in simultaneously. A 68030 or above is a very good thing.
Plenty of HD space - though the actual server is small, installations of
associated applications like Perl 5 take up quite large amounts of HD real
estate.
A TCP/IP stack for the Amiga. AMITCP 4.0 onwards
will do. Miami 2.0 will also work (and is IMHO easier to configure!) The
TCP/IP stack must be running for Apache to function. Note that you shouldn't
need to start the Apache server - the TCP/IP client will automatically
start it if you get an incoming HTTP request. Although if Apache unexpectedly
stops, you may need to restart it manually (I've configured a DOPUS button
for this.
The Apache files from the main site (more details
below). There are also additional files required if you want to run CGI
scripts etc.
A good understanding of the Amiga is essential.
Web server installation is not a trivial task on any system. Some knowledge
of Unix is very useful, and if you want to write your own CGI scripts,
Perl, Unix shell, AREXX or C programming skills are essential.
Where to download
it
The Amiga port of the Apache webserver
may be downloaded from here.
The most recent version of the server is kept here, along with the archives
containing related files.
Extra files and
things
need to write this section :-( Here will be information
about extra bits and pieces.
Known
Amigas running Apache on the WWW
My A1200 is at http://158.152.178.241,but
it isn't presently connected as I need a browser with a shockwave plugin, and that means
connecting up the Pentium :-).
Several other people have emailed their server addresses,
but I haven't been able to log in to any of them so far, with the exception
of this one: amiga.3wis.nl. An interesting
site, but beware - it contains a lot of images.
There is also supposed to be an Amiga at www.tibb.at, but I haven't tried this one yet.
Where to get help &
information
The usenet newsgroup comp.sys.amiga.networking
is often a good place for asking specific questions about the Apache server,
AmiTCP, Miami and any other Amiga networking type things. As for Apache
problems, the newsgroup comp.infosystems.www.servers.unix
could be a good place to try, due to the higher traffic level than c.s.a.networking,
but don't ask Amiga-specific questions there or you'll be in for a good
flaming!
Contact the FAQ maintainer by email to: apache@babylon6.demon.co.uk.
Note that I will try
and answer any questions asked, but I know nothing about ppp.devices or
BBS systems. General Amiga questions, Unix-related things and Apache installation/configuration
are more easily answered by my good self.
Join the mailing list for the Amiga Apache beta testers.
Details of the list are on the main Amiga Apache.
For general information about the Apache webserver,
visit the main page at www.apache.org
but note that you are unlikely to find Amiga specific information here.
The main Apache FAQ may be obtained from www.apache.org
or from here
in the UK. This document contains information about the history of the
server, amd answers to some of the more common problems (like turning on
SSI). And if you want to know why the server is called Apache - here's
where you'll find the answer.
Apache Week is available from this
website and is an essential source of information for the latest Apache
news etc. They also have a fully searchable index for back issues. Again,
there isn't a great deal of Amiga specific information (just one article
in fact) but as more Amiga users get the Apache server installed, perhaps
we can rectify that...
A book I find useful is Webmaster in a nutshell:
A desktop quick reference (O'Reilly - ISBN 1-56592-229-8) which details
all of the directives available in the server configuration files. There
are also quick references to using HTML, Perl and Javascript - indispensible!
Another good book to have if you are not familiar with Unix is something
like Unix for Dummies - if you don't know what I'm referring to
by mentioning chmod, then you would be advised to get a book such
as this.
1. Technical aspects
Using Apache with
Miami
Miami is an easy to use integrated TCP/IP stack and
dialup networking client for the Amiga. A demo version is available in
Aminet (comm/tcp/Miami20g.lha).
Note that not all of these settings may be essential - I messed around
with Miami for a couple of hours before getting Apache to work, so some
of the settings I changed may not be essential, and some of them may already
be set by default. If anyone manages to follow these instructions successfully,
please email me so that I know they are correct, and that I haven't forgotten
anything.
Configuration of Miami to use the Apache server is
very straightforward:
-
Download and install Miami version 2.0 or above. Configure
it to allow connection to the WWW through your usual Internet Service Provider/
Ethernet connection. (i.e. set up things such as the locations of DNS servers,
your domain name etc.)
-
There are a number of settings to add to Miami before
Apache will work:
Interface:
Ensure you have typed in a valid IP address for your
machine.
Database:
Under services, add an extra entry as follows:
Name: http ID: 80
Protocol: tcp
Under hosts, you may need to add an extra
entry as follows: IP address: 127.0.0.1
Name: localhost
(the IP address 127.0.0.1 loops back to your own
machine, i.e. the localhost).
Under networks, add the following: Name:
loop ID: 127
Aliases: loopback
Under INETD, add: Service: http
Socket: stream Protocol: tcp
Wait: nowait User: root
Server: apache:httpd
(if you have installed the Apache httpd executable
file elsewhere, change the server location! Mine is in an assign called
apache:, yours might not be.)
Users: you might need to add a user, as Apache
didn't seem to work without this. I added user: brett,
and under Home dir, added root.
Groups: as with users, you might need
to add something here - I added a group called brettgroup,
and made brett a user.
That's everything for the Miami side of things. Make
sure you save these settings, or you'll have to retype it all.
To make sure it works, start Miami (you don't need
to connect to the WWW - just ensure the Miami program is running), fire
up an Amiga browser (any will do) and assuming you have configured Apache,
if you type http://127.0.0.1 or http://localhost/,
you should get a response from Apache.
Using
Apache with a Demon Internet account
If you have an account with Demon Internet (one of the
largest ISPs in the UK), then you will be provided with a permanent IP
address. This is a very good thing for setting up your own server. While
you are connected to the WWW, and assuming you have correctly configured
Apache, your server will reside at http://IP_address/
(for example, I have the IP address 158.152.178.241, so if I am online,
people can access my Amiga website on http://158.152.178.241/
. Remember that this address has nothing to do with your WWW site on Demon
Internet itself.
How to
use server-side includes
One thing to remember when running CGI scripts on Apache is that the initial stack
size of the httpd program must be high enough. A stack size of 150000 bytes is a
good start, but I it probably depends on how many cgi programs you are running.
CGI scripting
using Perl
Take a look around the WWW and you will find out that
most of the CGI scripts are written in Perl. The advantage of this is that
Perl scripts may be ported to different machines with minimal changes.
Perl is available for most systems, including the Amiga (version 5 can
be obtained from the Aminet directory dev/lang
- an older version is supplied as one of the files in the archive of additional
files on the main Amiga Apache site).
This
Perl is a nightmare, can't I write my CGI scripts in C?
You certainly can! In fact, scripts can be written in
any language you may have on your Amiga, but C is especially useful. C
executable files generally run a lot faster than their Perl equivalents,
so this will reduce server load. There are also lots of resources available
on the web to assist with the creation of CGI scripts written in C. A particularly
useful starting point is the cgihtml library for C. This may be
downloaded from http://www.eekim.com/software/
. Note that I have so far been unable to port this to the Amiga (don't
yet know enough C!) but the source code may be examined to give you a good
idea of how to write CGI scripts in C.
Can I write CGI scripts using SAS/C?
-
There is a problem with not being able to access environment variables when using SAS/C to write CGI scripts. This is due to the C programs not being compiled with the ixemul.library, as they are with the GCC compiler. The latest version of Apache does apparently fix this problem.
OK,
I've got SSI working, where can I find some cool scripts?
-
The main Amiga Apache site has a section for scripts.
-
The Amiga Apache FAQ site also contains a few examples
on (ap_script.html) this page (or it will if I get round to
writing documentation. No problem getting them to work - just writing about
them!)
-
The best place on the whole WWW for Perl scripts is
Matt's script archive.
This is a superb site, with well documented example scripts for access
counters, random quotes, etc. etc. Most of the scripts are written in Perl,
and can be ported to the Amiga with a minimum of fuss (even by non-Perl
programmers such as myself).
When
my sh scripts need to access external AmigaDOS functions, I get
a requestor asking for IXPIPE:
The IXPIPE: device is required to allow some scripts
written with the sh shell access to AmigaDOS functions. IXPIPE: can be
found in one of the gnu C compiler distribution archives, gcc272-base.lha,
available from Aminet by clicking here.
Why
can't I access certain files and directories through the server?
Occasionally, you may get error reports through the
browser informing you that you are unable to access certain files and directories.
This appears to be due to the access rights for the file, and changing
them with the utility chmod normally does the trick. The Amiga port
of chmod is included with the lha archive of useful extras
available from the main Amiga Apache site. To use it, type chmod o+rx
filename in an AmigaDOS window (handy hint: it is extremely useful
to set up a chmod button in a filemanager such as DOPUS.)
Problems in
standalone mode
-
I think I have some problems with the standalone
mode of httpd, or maybe I forgot something when reconfiguring amitcp (after
the crash), I can't see or find what, so maybe you can shine some light
on it. When I start httpd I got this message:
getpeername: Socket operation on non-socket
getsockname: Socket operation on non-socket
Error getting local address
-
It does not matter if I use it online or offline.
INETD works fine, no problems with that. Strange is it?
- Bert Vortman.
-
Check conf/httpd.conf
to make sure the ServerMode is standalone when running standalone. If you
try running in standalone mode with the ServerMode set to inetd you get
that message.
- Jeff Shepherd
Problems
with usergroups - what to do about them?
-
Every time I try to run httpd, I am told
that http is a bad group (or something similar.) If I try changing the
user/group in httpd.conf, I get the same message. httpd seems to ignore
alternate config files. For example, httpd -f /directory/which/does/not/exist.conf
produces the same message as httpd -f /apache/conf/httpd.conf.
-
Well, you mentioned it yourself, so I don't
have to do that ;). But to be serious,
it IS confusing. First thing you have to know is that Apache is
not programmed for the Amiga, it is a port
of a Unix program. Unix, is a multiuser
system, and apache relies on that multiuser aproach. I see that
you use multiuser yourself, so that makes
things easier to explain.
-
First of all, make a user httpuser (or http,
or whatever you like) and make a group
daemon. Download the ADE programs which you can find on the apache
homepage. Especially the fileutils archive is needed. Or maybe mufs
has the proper support already. But download
it anyway, it makes things easier. Do
that also for the perl and other archives. Make the 'httpuser' owner and
'daemon' group of the cgi-bin directory with
the command:
chown httpuser:daemon
cgi-bin
-
you have to do this for all files and directories
in the apache: directory.
-
you can use 'chown httpuser:daemon
*' for all files&directories in a directory
-
If you have done that for ALL files &
directories, then you need to make the
cgi-bin files executable with the command: chmod
775 <filename> or use the '*'
for a lot of files at once.
-
After that, add the same user&group in
the httpd.conf. Well, then things should run.
If you download from aminet the unixdirs3 archive (in util/boot i think)
then you can use scripts a bit easier. It
is possible that you have to set the
S protection bit for some scripts. Also very handy is the executehack
also on Aminet in: util/cli.
-
NOTE: if you change a script, don't forget
to set all permissions right. Just think
that your amiga becomes a true unix clone ;) and everything works fine.
How
do I stop users accessing certain directories?
Information about how to do this will be added shortly
- I now have all the required software and knowledge, but no time to sit
down and write about it. :-)
apache@babylon6.demon.co.uk
Apache HTTP Server Version 1.3.11 (Amiga)