You are here
TurnKey server domain configuration
Why am here? Where is my server homepage?
The most likely reason you have found yourself here is because the TurnKey server you have launched requires an FQDN (fully qualified domain name) but it has not been set. All TurnKey appliances that require an FQDN use example.turnkeylinux.org as the default domain. So it likely that you just accepted the default when doing firstboot configuration.
Why do I need a domain?
Some of the pre-installed third party software on TurnKey servers explicitly require a pre-configured domain name. The specific reason why it is required is due to software design decisions of the software, but generally there are a couple of likely reasons:
- To provide absolute URLs to specific content/resources - e.g., static assets such as images, CSS styling, etc or when storing and/or rewriting content URLs within a database.
- To provide an additional layer of security - i.e. ensure that your server can only be connected to via the specific FQDN/s that you have defined.
It can also be handy to have an FQDN set if/when you wish to generate a CA signed SSL/TLS certificate - e.g. via Let's Encrypt.
How do I access the landing page of my server?
Simply put, there are 2 things that you need to do to access your server, rather than seeing this page:
- Configure a domain
- Reconfigure your server to use the new domain
Configure Domain
If your server is publicly available via the internet then the best path is to buy a custom domain or add a new subdomain to a domain that you already have. Then add "A"/"AAAA" records pointing to your server's IP address. If you have a TurnKey Hub account you also have the option of a free "tklapp.com" subdomain. The Hub also supports custom domains via AWS Route53.
After you have configured your domain, please confirm that it is directing to your server as required. There are a variety of ways to do that, but 'ping' and 'dig' are useful CLI tools to check that your domain maps to the IP address of your server. Google also has an online DIG tool. Another test you could run is accessing Webmin on your server - i.e. https://YOUR_DOMAIN.COM:12321
Reconfigure the domain of your TurnKey Server
Once you have your domain set up and it points to your server, then you will need to reconfigure the web app on your TurnKey server. A full configuration of a TurnKey appliance can be done using the 'turnkey-init' command.
Alternatively, Just the web app iteself can be reconfigured via it's specific initialization script. The script can be found in '/usr/lib/inithooks/bin' and will be 'name-of-the-appliance.py' - e.g. to reinitialize WordPress on the TurnKey Linux WordPress appliance:
/usr/lib/inithooks/bin/wordpress.py
The script will also ask you to (re)set other initialization info such as email and password. You can reuse the same ones if you wish - the only thing that needs to be changed is the domain. Restarting the web server is not strictly required, but is recommended. E.g. Apache2:
systemctl restart apache2
After re-initializing you will need to clear your browser cache and cookies. Otherwise it will used the cached redirect - back to this page.