Self-serving

Uniqki embeds a mini HTTP server so that it can serve itself. This mini server can be used to create a portable Uniqki site using the Strawberry Perl Portable edition.

1   Create a self-signed certificate

Since no certificate authorities issue a certificate for localhost, you have to create a self-signed certificate if you want to run the self-serving Uniqki on localhost or IP address 127.0.0.1. Even if you run Uniqki on localhost, other users on the same network may still be able to access your Uniqki if you don’t secure the site. Uniqki can be served on port 80 without any encryption, but it’s not recommended.

Create a new self-signed certificate using OpenSSL:

openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes

This new certificate will be valid for 365 days. Copy key.pem and cert.pem to the Uniqki directory where you keep the Uniqki script or somewhere else if you want.

2   UN*X

Start the Uniqki server:

./u start -c cert.pem -k key.pem -r

You can access this Uniqki server at https://localhost/u.

It will fork itself and run in the background. You can stop the service:

./u stop

If you want to self-serve on port 80 without encryption (http://localhost/u), start the server like this:

./u start -r

However, running the server without a certificate is not recommended.

3   Windows

Install the Strawberry Perl Portable edition and make sure that perl.exe is in the PATH environment variable.

Download servu.bat to the Uniqki directory and start the Uniqki server by double-clicking the batch file from Explorer. It will open a new command window, which you can close to stop the service.

You can access this Uniqki server at https://localhost/u.

If you want to self-serve on port 80 without encryption (http://localhost/u), start the server like this from a command window:

perl u start -r

However, running the server without a certificate is not recommended.