The yaSSL Open Source Embedded Web Server supports directory aliases. Similar to Apache’s mod_alias, using aliases allows a mapping to be created between URLs and file system paths. This mapping allows content which is not under the web server Document Root to be served as part of the web document tree. In other words, URLs beginning with the url-path will be mapped to local files beginning with the directory-path.
In the yaSSL Embedded Web Server, this can be done two ways:
1) Aliases can be set at runtime by using the -aliases option
2) Aliases can be set in the config file
In the following examples, suppose we wanted to map our local video directory (/home/user/Videos) to the URL “/videos”, and we wanted to map our pictures directory (/home/user/Pictures) to the URL “/pictures”.
Using the first option (setting the aliases at runtime), would look similar to the following.
./yasslEWS -aliases /videos=/home/user/Videos,/pictures=/home/user/Pictures
Using the second option (setting the aliases through the config file), we would need to add a line to our config file, as follows:
To test if the newly set-up aliases are working correctly, point your web browser to one of the two URLs, where you should see a directory listing of the local files.
If this doesn’t work, double check that your paths are correct in your alias definitions and that everything is spelled correctly. Aliases should be able to be created for any drive physically attached to your computer.
To download the yaSSL Embedded Web Server, or to learn more, check out http://www.yassl.com. If you have any questions, contact us at email@example.com.