How To Configure Your Linux Web Server To Serve Non-WordPres

Post Reply
MWD
Posts: 180
Joined: Mon Feb 10, 2014 10:31 pm
os: windows
Contact:

How To Configure Your Linux Web Server To Serve Non-WordPres

Post by MWD »

http://www.freespeechme.org/how-to-conf ... -properly/

By Frank Bieser, Big Head Press
http://bigheadpress.com
http://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.

Code: Select all

$ vi /etc/apache2/sites-enabled/000-default
In there you probably have a stanza that looks like…

Code: Select all

<VirtualHost *:80>
ServerName http://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 …

Code: Select all

<VirtualHost *:80>
ServerName http://www.mydomain.bit
ServerAlias mydomain.com *.mydomain.bit
DocumentRoot /var/www/mydomain
[…]
</VirtualHost>
Save your changes and restart the web service.

Code: Select all

$ 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.
Namecoin, Dot-Bit and MeowBit are a complete new Internet ecosystem, building the roads to Web 4.0. http://www.meowbit.com
Dot-Bit Kitty Pix! The ONLY .bit-only kitty cat website in the world! http://dotbitkittypix.bit

Post Reply