How To Configure Your Linux Web Server To Serve Non-WordPress Dot-Bit Web Sites Properly

A-naut2
By Frank Bieser, Big Head Press.com / BigHeadPress.bit

THE PROBLEM
Now that you have your .bit domain registered and updated with your web sites IP address, you need to reconfigure and re-start your web service, so it will recognize the new .bit name.

If you’re on WordPress, that can be done from the WordPress install. We have code and directions for doing that here.

THE SOLUTION
For non-WordPress sites, below is the info from the Web server end to make things link and work perfectly:

These steps should work for any flavor of GNU/Linux running one of the Apache web server variants.  If it supports name-based virtual-hosting, the VirtualHost, serverName, and ServerAlias items will be there (and they are the only ones we care about). If you are running a website on AWS, good chances you are running it on an Ubuntu GNU/Linux instance with apache2, which is what I will use in my examples….

Start by editing the web service config file you modified when you set your site up initially with your favorite linux editor.  Let’s assume your site was mydomain.com.

$ vi /etc/apache2/sites-enabled/000-default

In there you probably have a stanza that looks like…

<VirtualHost *:80>
ServerName www.mydomain.com
ServerAlias mydomain.com *.mydomain.com
DocumentRoot /var/www/mydomain
[…]
</VirtualHost>

Copy the lines of that stanza, and make a new stanza, changing all cases of mydomain.com to mydomain.bit.  It should look like …

<VirtualHost *:80>
ServerName www.mydomain.bit
ServerAlias mydomain.com *.mydomain.bit
DocumentRoot /var/www/mydomain
[…]
</VirtualHost>

Save your changes and restart the web service.

$ sudo service apache2 restart

(The one problem you may run into; if your website uses absolute references when linking to local things, like images and other files.  Those linking to your DNS-based domain (mydomain.com), won’t work if DNS resolution fails.  By making them all relative, the web server will do the work for you.)

IN CONCLUSION
This will serve your Dot-Bit sites up with all links and images showing the .bit links, which would keep you drone-proof if your .com domain name were seized. And this workaround does not affect the serving of your Dot-Com site from the same files.

Leave a Reply

Your email address will not be published. Required fields are marked *