Mereo

Mereo User Guide

Table of Contents

1 - Compatibility
2 - Purpose
3 - How To Setup A Server
4 - How To Use The Commandline Interface
5 - Mereo At System Startup
6 - How To Use The Favorites
7 - Customizable Error Pages
8 - Configuration File Format Specification
9 - Character Sets
10 - Default Settings
11 - FAQ (Frequently Asked Questions)
12 - License

1 - Compatibility

Users of Windows 9x variants will need to install the "Microsoft Layer for Unicode on Windows ME/98/95 Systems" from Microsoft.

Windows 95 users will need to install the following items:

2 - Purpose

Mereo is a simple and small HTTP server designed to run on all Windows platforms.

3 - How To Setup A Server

Step 1:
Execute 'mereo.exe'.
Step 2:
Click the menu 'Server'.
Step 3:
Click the menu item 'Select Directory'.
Step 4:
Browse for a directory you want to host.
Step 5:
If you want viewers to be able to see the files in the directory
select 'Directory browsing' (optional). This will show the files
in the directory if no 'index.html' or 'index.htm' file is found.
Step 6:
Type in a port number or leave it at 80 (default).
Step 7:
Click the menu 'Server'.
Step 8:
Click the menu item 'Host'.
Step 9:
If everything went fine, the tray-icon will change
its color and the status bar will state 'Server running'.

You can now minimize Mereo, it will stay visible in the tray-icon area. If
you double click the tray-icon, Mereo will be set to the foreground again.
If you then again double click the tray-icon, Mereo will hide itself.

Right-click the tray-icon of Mereo to start, stop, restore or exit the server.

4 - How To Use The Commandline Interface

The commandline interface supports the following commands:

-b [ADDRESS] Limits outside access to the specified address.

(This can be handy when for example you only want a friend to download a file from you but not other leechers.)

A space between the option and [ADDRESS] is required.
-de Enables 'Directory browsing'
-p [NUMBER] Specifies the port to use for incoming connections.

The valid port range is 0 - 65536 (i.e. any number between them).

A space between the option and [NUMBER] is required.
-h [DIRECTORY] Specifies the directory to use as root.

If this option is specified, the program will automatically start hosting the directory after the program has started up, unless one of the other passed arguments pertaining to hosting are invalid (e.g., an invalid port was passed as argument to the '-p' option).

If there is a space in the path (like with "C:\Documents and Settings", then you need to insert a quote (" character) before and after the path, but it's not necessary with a path like "C:\WEBROOT", because there is no space in it.

A valid path can be a relative path like 'WEBROOT', which would mean a directory called 'WEBROOT' exists in the directory where 'mereo.exe' is located.

Or a valid path can be an absolute path like 'C:\WEBROOT'.

If this option is specified, Mereo will automatically start hosting (only if the path specified is valid).

If you want to host the directory where Mereo itself is located, you can easily use the -h option like this: '-h .\'
The .\ part will make Mereo host the relative path .\ which is the directory of 'mereo.exe' itself.

A space between the option and [DIRECTORY] is required.
-hide Hides the Mereo into the system tray at startup.

Please check the batch files in the 'batch' directory for examples on how to use the commandline interface.

5 - Mereo At System Startup

Step 1:
Check the box 'Auto-start at Windows logon'.
Step 2:
Enter the desired configuration for Mereo.
Step 3:
Press 'Finish'.

6 - How To Use The Favorites

Step 1:
Click 'Add Favorite' from the menu 'Favorites'.
Step 2:
Enter the desired name as alias for the webroot.
Then enter the full (or relative from directory of 'mereo.exe')
path to the webroot.

If you do not specify a port, the default HTTP port (80) will
be used.

Turn on the 'Directory browsing' feature if you want users to be
able to view the contents of the directories if no 'index.htm' or
'index.html' is found.
Step 2 Screenshot
Step 3:
Now you can use the favorite:
Step 4 Screenshot

7 - Customizable Error Pages

You can use customized error pages for the error code range 400-501.
In the root directory where 'mereo.exe' resides, create a subdirectory
called 'errorpages'. In there put the error page, which should be called:
{ERROR_CODE}.html (for example '404.html')

It is recommended to use inline styles in the error pages so as to minimize HTTP requests to the server.

8 - Configuration File Format Specification

NOTE:
The line endings of the 'mereo.cfg' file must be in Windows
format, that means one Carriage Return followed by a Line Feed.
In the hexadecimal numbering system, this sequence is known as
0x0D followed by 0x0A
Example File:
Charset=ISO-8859-1

[Favorite1]
Name=fav1
Path=c:\windows

[Favorite2]
Name=fav2
Path=c:\windows\system
Port=22
DirectoryBrowsing=true
BindAddress=10.0.0.2


9 - Character Sets

NOTE:
At the moment there is one known problem with the 'ISO-8859-1'
character set and the 'Directory browsing' feature, please set
the character set to 'GBK' to prevent the layout from cluttering.
A few common character sets:
ISO-8859-1 (standard)
GBK (Chinese)
Shift JIS (Japanese)
EUC-KR (Korean)

Further reference: http://en.wikipedia.org/wiki/Character_encoding

10 - Default Settings

The listing below describes the default values used when a setting could not be found in the configuration file.

Charset=ISO-8859-1

DirBrowseForce=0

LogEnable=1

MaxThreads=1000

LogMem=1048576

UpdateInterval=0

UpdateCheckAtProgramStart=1


10 - FAQ (Frequently Asked Questions)

CSS problems


Question:
I'm testing my website (hosted with Mereo) and my browser (for example Firefox or Internet Explorer) does not load my CSS stylesheet correctly, what can I do?
Answer:
The Content Type for the '.css' file extension is not correctly set on the server. Please run 'files/css_patch.reg' at the server computer to make sure the Content Type header of a HTTP response will be set to 'text/css'.

Using the settings file from CD


Question:
I want to run Mereo from a CD, can the 'mereo.cfg' still be used?
Answer:
Yes and no. The 'mereo.cfg' file will be read, parsed and used in the favorites menu, but you can't add new favorites when running from a CD or when 'mereo.cfg' is set to READ-ONLY.

CD Autorun


Question:
I want to automatically run Mereo when inserting my CD with 'mereo.exe' on it, is this possible?
Answer:
Definitely. If you have some experience with 'autorun.inf' files on CD's you can create a batch file (or pick one from the 'batch' directory included in the package) and specify the arguments for Mereo.

After you have done that, create a file called 'autorun.inf' and put the following information in it:
autorun.inf:
[autorun]
open=run.bat

You also have to edit the example batch file (of your choice) to startup Mereo
with the -hide option. An example 'run.bat':
run.bat:
mereo.exe -de -h .\web -p 8080 -hide

This will make Mereo startup hidden with 'Directory browsing' enabled, hosting the directory .\web and using port 8080.

Now you have two files called 'autorun.inf' and 'run.bat', put them both in the root directory of the CD.

Router Port Forwarding


Question:
Other users can't view my website, how come?
Answer:
One of the possible causes is that you don't use the default HTTP port 80. Please verify this.

Another possible cause is that your connection is behind a router, if you have access to the router, please verify port 80 is forwarded to the local IP address. Usually you can find this information under a button 'Port Forwarding' or 'Virtual Server' etc.

READ ERROR message in the log


Question:
I see a 'READ ERROR' message in my log, what is this?
Answer:
A file requested by the client was probably in use or locked, or the computer was low on memory at the time of the request. You should both check whether this happens often and check if the computer is low on memory.

Custom MIME types


Question:
Can I change the MIME type for a specific file type?
Answer:
Yes you can. Use a registry editor (for example Windows' 'regedit.exe') and browse to the key HKEY_CLASSES_ROOT\.<FILE_TYPE_HERE>.

There you will see a key named "Content Type". You can change that key to the desired value.

For example: HKEY_CLASSES_ROOT\.wmv contains the "Content Type" key for the file type ".WMV".

The 'maximum number of threads' setting doesn't seem to work


Question:
When checking the number of threads running for the Mereo process, I've spotted that more threads are running than the number I've set in the preferences.
Answer:
Sometimes it can occur that more threads are running than the maximum number of threads that you've configured in the preferences. The difference between the actual number of threads running and the configuration shouldn't differ a lot. It occurs because the 'maximum number of threads' setting only controls how much threads are actually used for connection handling. Some other threads might run because the Windows API (Application Programming Interface) started them.

How can all the preferences at once be reset to their defaults?


Question:
How can all the preferences at once be reset to their defaults?
Answer:
You have to (re)move/rename the file 'mereo.cfg'.

It seems the 'log memory' setting can't be changed


Question:
In the Preferences dialog; when trying to change the amount of memory used for the log, it seems changing the option is disabled.
Answer:
You temporarily have to stop hosting, this enables changing the setting. This is done on purpose. After that, the settings dialog has to be closed and re-opened to be able to change the setting.

Access denied for http://localhost/ after setting the bind address


Question:
Why can't I visit http://localhost/ after setting the bind address to some address other than 'localhost' or '127.0.0.1'?
Answer:
Because that would enable other users on the local system to access the web server, which may not be desirable.

License

Copyright (C) 2006-2011 by Jelle Geerts

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.