Known Issues
Not yet optimized. May not yet scale for several tens of hits per second with CGI executables yet. For plain HTML it is great and has seen 50-100 requests per second on an older computer. It isn't the fastest server in the world yet and that is being worked on.It uses BeginThread and EndThread without any real special preforking tricks.
Some early benchmarks were done
- On linux 50-100 requests per second for plain html on an older pentium
- On windows, 90-105 requests per second for plain html
- CGI programs were slower, and will be tweaked in the future
Configuration
Just after unpacking Zip
Modify parameters ip and port in file config.cfg. Then modify parameters default and localhost in file vhost.cfg. Read more about those parameters in the following.
Configuration files
All parameters are in following format (BNF-like):
<Parameter name>=<Parameter Value>
config.cfg
ip
IP-address of network interface. Can be used Internet or Ethernet IPv4 address.
Use 127.0.0.1 to use on local mashine.
port
Port to use with Server (1 — 65535). Standart HTTP port is 80. But if you
already have running HTTP-server on port 80, you need to choose other port. To
avoid conflicts, use ports greater than 1024.
deletelog
If true, then log-file will be cleared every time you run server. If false, then
log-file will be just added by new information.
logfile
Filename of log-file.
error404
Filename of page to show if error 404 detected.
error403
Filename of page to show if error 403 detected.
index
Default page in directory. If user types address with terminating slash (www.site.com/fold/),
this string will be added to the end of request (www.site.com/fold/index.html).
mime.cfg
This file defines headers, which server send to client. Every parameter consists of file extention and MIME-type. When client send request for a file with defined extention, server replies with header, which tells browser about file type.
If client requests about file with undefined extention, server will use MIME-type, defined with parameter default.
vhost.cfg
This file defines directories for sites. Every site is located at their own directory. You need to define, which directory belongs to requested hostname.
For example, line
test1=E:\MyProjects\fpc\Aservia/test1
means that site http://test1/ is located at
E:\MyProjects\fpc\Aservia/test1 directory.
Note, that domain www, as well as other subdomain needs their own parameter.
Parameter default defines which directory should be used, when client doesn't request certain domain name or when there is no record for requested domain. For example, you can define directory C:\Aservia\localhost for host localhost (http://localhost/) and directory C:\Aservia\default for undefined host (http://127.0.0.1/). You can use any hostname, which can be in Host field of HTTP header.
blacklist.cfg
This is the black list. On each line can be located one IPv4 address. Client with this IP address will not be abble to get any file from server. The only page he will see is Error 403 page.
For example, file with content
140.12.15.20
45.1.87.29
means that client with referred above IP-addresses cannot access any site
located on Aservia server.
Work with program
Running Aservia
Windows platforms
To run Aservia you need just execute file Aservua.exe.
Linux platforms
To run Aservia you need just execute file aservia under root. Make sure, that file aservia has permissions, enough to execute it.
Stopping Aservia
Type quit or q straight in Aservia console and press Enter.
Changing configuration
First of all you need stop Aservia. Then you can change configuration files. After all changes have been made, just run Aservia server again.
Viewing logs
Log file consists of user requests. There are headers which clients send to server, client IP-addresse and date/time of connections.
Note, that in russian version of Aservia log file will be in ASCII (cp866) charset.
Adding virtual hosts
Add directory which will be used to allocate new site. It can be any directory of your system, even if it is already used by some site. Then change configuration of Aservia as it is described above. You need to change file vhost.cfg.
If you work under Linux, make sure that host directory has right permissions.