User Tools

Site Tools


information-technology:2019-web-hosting

Owner's Manual to Having Your Own Website

This article will help you in selecting domain and web hosting providers, along with other aspects of running and maintaining a website.

Researching Web Hosting Options

I wrote this as I went along, researching web hosting technology that was new to me. So it's a story of my discovery process as well as info that may be helpful to you.

I have chosen shared hosting, as it is economical and gives me enough control to make the sites I want, without having to maintain a server on my own. You can have a managed VPS, or managed VPS Cloud, but that costs more.

I don't know how trustworthy these sites are, but I checked them out in searching for web hosting:
http://hostadvice.com
http://hostingfacts.com
http://hosting.review
http://www.reviewhell.com
http://www.hrank.com

If you want a very small company that's been in business since 2002, there is a delightfully small web host called Condorhosting. They have a total of 2 servers in California. Hosting starts at $3 per month. A European based host, Netim, offers free hosting, or 1€ hosting with 1GB of space.

My requirements are:

  • a linux server with cpanel
  • live chat support 24/7 with low wait time
  • multiple domain plan (such as with “addon” domains)
  • a company with a bit of charm

I considered offshore hosting. Offshore hosting can be beneficial when you don't want local authorities to have power over your website. One good choice for offshore hosting is Iceland, since it is a country that values freedom more so than the U.S1. Icelandic hosting services include 1984 (the most used host in Iceland, named after the dystopian novel), OrangeWebsite, and Flokinet.

However, I realized that offshore also means more latency. The website will be slower for those physically located further away from it. You can see the distances a request has to travel on a map of the undersea fiber optics throughout the world. From NYC, hosting at www.host.md (md for Moldova) had ping response times averaging 150ms, whereas a U.S. based host I've been using had response times of 40ms. Google.com responds in 15ms, since they want to be as close to you as possible, and have a net of servers nearby everywhere.

The latency problem can be solved by having servers everywhere like Google. This is where I am just starting to read about cloud hosting.

I am familiar with DNS. When you type in a web address in your web browser, a DNS translates that into an IP address. The IP address is what the web hardware uses to route your request to the website's server. DNS resolves one web address to one IP address, except, that using a certain technology called Anycast, one IP address can exist in more than one location. But is this the “cloud hosting” that a random web hosting provider is offering? Maybe not all web hosting providers are created equally, or maybe that's not what they mean by “cloud hosting”. I *am* more sure that services like Cloudflare's offer this Anycast DNS.

With Anycast, you can also get IAAS (Infrastructure As A Service). In other words, your server is completely virtual. It doesn't exist in one place. When you ftp to upload files to it, you would be uploading the files to whatever is the closest server to your location. If you are working on your laptop while traveling, that may be a different server depending on where you are. Although that's more fancy than the truth. What's most important is a speedy website to your audience.

One such web host is Hostinger, since they offer CloudFlare Integration in their cloud hosting package. Their VPS hosting also comes with what looks like the same cloud features, and costs less at only $3.95/mth. So both services are cloud host based, but the difference is that the cloud hosting is managed, and VPS hosting is not. If you don't manage the server, you don't have root access, but neither do you have to do the work of managing it. I had to chat with a representative to find out, as the site doesn't make the differences clear.

Another such web host provider is Dreamhost. They also have an unmanaged cloud VPS like Hostinger, which they call DreamCompute. They charge $4.50 a month for an entry-level-virtual-server, plus download bandwidth, at a price to be determined in the future (right now it's free). They also have an option for a managed VPS server, which cost 13.75/mth. Same as with Hostinger, it seems like having to manage a VPS is expensive. You save by managing it yourself? Is that what's going on here? Or is it expensive to manage people like me that don't know what they're doing?

Something tells me I may be a little off describing the services by Hostinger and Dreamhost, but I'm ok with that. I think I got the gist of it for my concerns.

Hostinger pointed me in the right direction, bless their hearts. It looks like, just using CloudFlare is enough. Hostinger's cloud hosting package is more expensive in part because you get more-and-better-hardware and managed VPS on their end. That's nice, but I'll make due with shared hosting, like I make due with a 2006 macbook pro laptop running windows.

CloudFlare has a free single-website account signup. I think CloudFlare gets me an array of features, including the “cloud” thing similar to CDN (Content Delivery Network). Quick search for CloudFlare competitors, shows that CloudFlare is the only one with a free account.1 Also, it is popular on alternativeto.net website (with nothing else having substantial “likes”). Update: mention of other free services like Incapsula, jsDelivr, BootstrapCDN, and Coral Content Distribution Network, here and here.

So it seems that I could have chosen an offshore host, and used CloudFlare for the low latency. However, I chose Hostinger, and so far I am pleased. They are quick to answer questions via chat. Also, kudos that they are an employee owned company!1

A shared hosting plan is still enough for me. I don't need the “cloud hosting” advertised all over the place, nor do I need the overhead of having to manage a VPS. For now, there is CloudFlare. However, as in all things tech, nothing stays the same. Wait, CloudFlare has been around since 2009! Me dinosaur.

Update: Cloudflare may have its benefits, but it is not without issues. See following articles:
https://www.reviewhell.com/blog/cloudflare-makes-websites-slower
http://pagepipe.com/cloudflare-doesnt-guarantee-consistent-load-times
http://www.webhostingtalk.com/showthread.php?t=1666238
https://www.quora.com/What-are-the-disadvantages-of-using-CloudFlare
https://internetdevels.com/blog/pros-and-cons-of-cdn


Coming Up With a Cool Domain Name

.com is now lame. Everything is taken. You want a short domain name. Take advantage of all the new TLD's, and all the country codes. Be inventive and use a complete word that has the TLD included. Use misspellings. For example, register a domain name like sereni.li (serenity). A thesaurus is helpful.

The following sites can help you come up with a domain name:
https://www.wordhippo.com/what-is/word-finder-unscrambler.html
https://datayze.com/alternate-spelling-finder
https://tld-list.com/tlds-from-a-z
https://tld-list.com/tld/li ← just replace the li with the tld you want to try


Domain Registration

Way back in the day I read warnings that you shouldn't have the domain name registrar and web hosting provider be from the same company. I'm not too sure why anymore, but let me give you an example. If you are running a pirate domain, and the government wants to shut you down, they will more than likely go after the domain registrar to take down the website. It's nice to have your actual website files with another company, so not all your eggs are in one basket.

Pay attention to the renewal cost when comparing registrars. Sometimes registrars offer a promotional price for new registrations. If you can lock in a promotional price for 5 or 10 years, then in the future you can still transfer the domain to a different registrar if the renewal price is exorbitant.

I chose NameSilo, because they have good prices for .com, .net, and .org domains. I don't know why I try to save on this little stuff. One reason is that it is one of the top 15 registrars. I prefer not using one of the top 5. I am monopoly-averse. Namesilo has a third the number of domains as Namecheap. I think the biggest registrar is Godaddy.

The one setting that must be configured with the registrar, is pointing the domain to the web hosting.
- In the case of shared hosting, you would modify the “name servers” or “custom dns” setting. On this website, that is ns1.bigbytes.net, and ns2.bigbytes.net.
- In the case of a VPS, you would change at least the A record to the IP address of the server.
More details:
https://www.namecheap.com/support/knowledgebase/article.aspx/9837/46/how-to-connect-a-domain-to-a-server-or-hosting
https://www.hostinger.com/tutorials/dns/how-to-point-domain-to-vps


Website Uptime Monitoring

Based on Tanya's Recommendation, along with the likes on alternativeto.net, I'm using FreshPing. I used to use Pingdom. I like the UI on FreshPing a lot better. On the site that I'm using Cloudflare, I will be able to track if it is Cloudflare or my site that is having issues.

I have this site on bigbytes.net shared hosting. One thing that bothers me is that unlike google.com, cnn.com, a hostinger host, or thenewleàfjournal.com, both mekineer.com and bigbytes.net cannot respond reliably to ping requests.

Unreliable Server Ping Response

However, the site does load reliably? Can I rely on freshping or pingdom? Can I rely on the server load display in cPanel? The thread on StackExchange states: “The best way to tell if any given remote service is alive is to ask it to service a request in the way it's meant to - in fact it's the only way to truly know something is working correctly.”

So I tried a free go at the loadster.app website. This online app tests the website under load. The results are rather long so click below to expand the section.

….. click here …..

….. click here …..

Loadster Results Screenshot




File Management

Your hosting package comes with cpanel, which has a file manager built in. This is the simplest, and has the benefit of working with files directly on the server, so you don't have to waste bandwidth downloading them.

Another way, is to use an FTP client such as FileZilla. This is the traditional way. Each access method has its advantages.

With the FileZilla user interface, the local files on the left column, and remote files on the right. If you right-click on a remote file, and choose “edit”, the file will download to your system's temp folder and launch in a native editor. When you edit and save this file, FileZilla prompts asking if you want to upload the change. However, there is the limitation that you can't use native tools for batch operations on files, such as:

  • searching and replacing text
  • file comparison with a local backup, to show modified files on the server

Another way, is to mount the hosting server resource as a local drive. For this, there are programs like WebDrive, NetDrive, and Mountain Duck. Compare this with sync applications such as Google Drive, Mega, or Dropbox, which require a local copy of the files on your hard drive. Either of these methods has the advantage of being able to use native tools when working with files on the server, without having the manual steps of downloading them first, uploading them last.

The protocols used to work with online files as if they were local, are WebDav and SFTP (which is not related to FTP or FTPS). I believe some companies such as Google and Amazon have proprietary protocols for their file hosting, although they may also allow standard WebDav or SFTP connections. (verify) I think SFTP may be superior to WebDav, to use native tools, based on this thread. More info on mounting internet drives in the file sync and backup article.


Email Server

Sometime between 2006 and 2009, I tried to depart from Gmail or other web-based providers, by having email on my web hosting server. It didn't work out well, because a little too often my messages were getting routed to people's spam folder. Maybe because I was on a shared web host, and my server was blacklisted? That didn't seem to be the case, and yet still my messages were sometimes in people's spam folder. Maybe if I paid for a dedicated IP, I wouldn't be blacklisted? I gave up and started using Gsuite (formerly known as Google Apps, just to confuse the heck out of you). I hoped to return to using my own server for email, but the forces that be made it hard for me to do so.

Back to the present. I used a website to test the “spaminess” of emails from my web servers:
https://www.mail-tester.com
https://mxtoolbox.com
In the results, they recommended using DKIM. So I enabled DKIM in Hostinger's cpanel → emails → “mail service control”. Normally, that would be it, since Hostinger would be the acting DNS server. However, I'm using Cloudflare for DNS. So I needed to add the DKIM records to Cloudflare.

In Hostinger's cpanel → advanced → “dns zone editor”, I copied the “host” and “txt” values for DKIM, and pasted them into Cloudflare's DNS records. The records will look like this:

host [ very-jumbled-alphanumeric-string._domainkey ]
txt [ v=DKIM1; k=rsa; p=the-longest-mofo-jumble-of-characters-ever-taking-up-several-lines ]

So on the mail-tester site, I have a score of 10 now, despite not having a DMARC record. Mxtoolbox lists some other issues. I may look into DMARC someday maybe.

This person doesn't recommend mixing email with web hosting. For example, she cites down-time, and difficulty of setup. However, neither of these bother me much.
https://carriedils.com/web-hosting-email

Update: I joined a Diaspora pod, and emails from that community ended up in my gmail spam folder. Upon closer inspection, I saw that the email had a DKIM signature. Perhaps the DKIM was not set up correctly? Perhaps Google has a self-interest?

I used gmass.co to test the “spaminess” or deliverability of emails from my email addresses.

3 of 19: A gmail address had 3 out of 19 end in the spam folder.
5 of 18: A molbio.science address with working dkim and spf on hostinger/cloudflare had 5 out of 18 end up in the spam folder.
0 of 19: A protonmail address, and 0 out of 19 messages ended in spam (protonmail would not let me send to the full number of recipients, so I had to wait an hour before trying again. I could only send to 6 recipients at a time, 12 per hour).
2 of 19: A grandfathered gsuite account with my nerdondemand.com domain had 2 out of 19

So it seems that sending from a server with a better reputation has the best effectiveness. Supported by this reddit tweet: https://www.reddit.com/r/ProtonMail/comments/9oztoc/people_dont_get_your_proton_email
“This can happen with all email providers as every provider has their own custom filtering systems and some false positive rate. If you are a paid user, the @pm.me domain has the highest deliverability rates since it's paid only.” - Protonmail Team

So unless gmass.co is affiliated with protonmail, then this is a pretty good incentive for me to use protonmail. Another factor could be the number of recipients in the messages. To be a fair comparison, I would have to send to 6 recipients at a time from all the accounts.

Like with Gsuite (and maybe also regular gmail accounts), you can use protonmail with your own domain: https://protonmail.com/support/knowledge-base/set-up-a-custom-domain



Mod Rewrite and Regex

The purpose of Apache Mod Rewrite, is to redirect an incoming URL request to a new URL. You modify the original URL to something new, because perhaps you've moved your site to a different directory on the server, or you've changed to a new naming scheme for your pages. If the new naming scheme can be reliably machine translated from the old naming scheme, then you use the rewrite engine. That way, people following links to your page's old location, will still arrive at the new location.

For using Apache Mod Rewrite, you will need to understand some of Regular Expressions. Understand the dot, the asterisk, the question mark, and the () which creates a variable you can call later.

The best way to learn is to try out some expressions at https://regexr.com. They have the entry box pre-filled, so don't let that confuse you: delete it and type your own.

You can also try out your try out your “rewriting” with the htaccess tester at https://htaccess.madewithlove.be

You can also use the cpanel gui instead of manually editing the htaccess file. Basically they have a template for typical rewrites. Accessing your site's cpanel depends on your hosting provider, but can usually be found at your-domain.com/cpanel, or cpanel.your-domain.com (substitute com with your tld). In cpanel look for the redirect option.

The following coding sections are beta. They function but have not been fully tested.

Redirecting To and From a Subfolder

I used to have both Elgg and Dokuwiki installed on this site, and the root page gave you a choice of entering into either application. I ended up using only Dokuwiki. Due to wanting to skip over the root page of the site, and redirect to /dokuwiki, I added the following after “RewriteEngine On” and before the other lines above.

RewriteCond %{HTTP_HOST} ^mekineer\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.mekineer\.com$
RewriteRule ^/?$ "https\:\/\/mekineer\.com\/dokuwiki\/doku\.php\?do\=index" [R=301,L]

Eventually, I removed Elgg completely, and decided to move Dokuwiki to the root of the site. Since Dokuwiki is portable, this was easy to do, only requiring I move the files. So that any URL pointing to the old location would redirect to the new root location, I removed the previous and replaced it with:

RewriteBase /
RewriteRule ^dokuwiki/(.*)$ /$1 [R=301,NC,L]




Enabling SSL

CloudFlare SSL

First step is to get CloudFlare for your site. Then logged into CloudFlare, click on Crypto, find the SSL option and get the “Certificate” and “Private Key”. Paste these into Hostinger's Cpanel SSL option (CABundle not required). In CloudFlare, enable “Always use https”. Hostinger also has a https switch in their cpanel. I don't know the implications of both being enabled; I think one is sufficient. No apache htaccess editing required.

Shared Hosting Server Provides SSL

If you are on a shared server that already supplies free shared SSL, you can do the following to redirect from http to https. Edit the root .htaccess file for your site, as follows:

The key to redirecting traffic on global basis is to add the following to the top of .htaccess

RewriteEngine On
RewriteCond %{https} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L]




SEO Search Engine Optimization

Importance of the URL

A website's URL is important for SEO. For example: https://mekineer.com/information-technology/2019-web-hosting VS\\ http://www.mekineer.com/dokuwiki/doku.php?id=information_technology:2019_web_hosting

In the past this site:

  • didn't use https (SSL)
  • had dokuwiki in a subfolder instead of root
  • used underscores as a word separator (including my own naming of pages and media)
  • used ugly URLs

I followed the steps to use Nice Url's, as described in the dokuwiki documentation, but incoming requests from old links still showed the ugly. This is the normal behavior for Dokuwiki, but I wasn't satisfied. I used htaccess regex to “301” tell user's web browsers and search engines that there is only the one new page, and to stop asking for the old URLs.

Google, the all powerful, say “underscore bad”, unless you are Wikipedia 1. So I renamed all my pages and media with hyphens, and used the plugin “orphans wanted” to clean up internal links. However, existing links created in the past, coming from outside my website, would not find the page's new location. So I used regex to reform the request and provide a 301. The user's web browser then requests the Corrected Nice URL, and the dokuwiki-supplied-regex does it's thing for the internal request.

Here's the current htaccess file dealing with the redirect, before going into the rewriting supplied by the dokuwiki documentation:

RewriteEngine on

RewriteBase /

RewriteRule ^dokuwiki/(.*)$ $1 [R=301,L]

RewriteCond %{QUERY_STRING} ^(id=)([^\:]*)\:(.*)$
RewriteRule $(.*)$ %2/%3 [E=underscores:Yes,QSD]

RewriteCond %{ENV:underscores} ^$
RewriteRule ".?" "-" [S=6]

RewriteRule ^(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)$  $1-$2-$3-$4-$5-$6-$7 [QSD]
RewriteRule ^(.*)_(.*)_(.*)_(.*)_(.*)_(.*)$  $1-$2-$3-$4-$5-$6 [QSD]
RewriteRule ^(.*)_(.*)_(.*)_(.*)_(.*)$  $1-$2-$3-$4-$5 [QSD]
RewriteRule ^(.*)_(.*)_(.*)_(.*)$  $1-$2-$3-$4 [QSD]
RewriteRule ^(.*)_(.*)_(.*)$  $1-$2-$3 [QSD]
RewriteRule ^(.*)_(.*)$  $1-$2 [QSD]

RewriteCond %{HTTP_HOST} ^mekineer\.nerdondemand\.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC,OR]
RewriteCond %{https} off [OR]
RewriteCond %{ENV:underscores} ^Yes$
RewriteRule (.*) https://mekineer\.com/$1 [R=301,L]

The above underscore removal was necessary to be multi-line, because of a deficit of the apache rewrite engine.

Subdomain versus Subdirectory

https://www.impactbnd.com/blog/subdomains-vs-subfolders

I got a super-clear answer on webmasters.stackexchange.com about 301 redirection in the case of this being an addon-domain.

Duplicate Content on Another Domain

I wanted to duplicate the content of the health section of mekineer.com, on the domain lifehacks.science. Except I was worried about how that would affect the SEO ranking of either domain. A lot of articles are posted via syndication, so I wondered about the SEO effect. After reading many answers on the Quora question: “How does duplicate content on a different domain affect SEO?”, I decided to go ahead and do it, and provide a back link from the lifehacks domain to this one.

Sitemap

Dokuwiki creates a sitemap and pings search engines bing, google, and yahoo to look at it. However, Woorank says there is no sitemap.xml file at the root of the site. I followed the following instructions to create a symlink. The chron job command is:
ln -s /home/<username>/public_html/data/cache/sitemap.xml.gz /home/<username>/public_html/sitemap.xml.gz
(replace <username> with your actual username)

Keywords and Meta Tags

Google's Take on Meta Tags:
https://www.youtube.com/watch?v=RBTBEfd7z_Y https://www.youtube.com/watch?v=jK7IPbnmvVU

“Meta Description” tag can be used in the search engine snippet:
source

Quora response to how many keywords per page

What do you do with the keywords? Where do you use them? Tom Gustar on Quora says this is the hierarchy of importance:

  1. keyword in domain
  2. keyword in anchor text
  3. keyword in URL
  4. keyword in title
  5. keyword in meta description
  6. keyword in content ( go sparse, not heavy )

(this section under construction)
https://www.dokuwiki.org/seo
https://www.quora.com/What-is-an-alternative-to-WooRank

Discussion

Enter your comment:
D Q X E P
 
information-technology/2019-web-hosting.txt · Last modified: 2023/05/18 22:48 by marcos