Stem_Cell
10/28/13 09:25PM
How to host a site
In light of the current desire for a roleplay forum, it seems to be useful to lay down how any of you could host a site and do whatever you want with it. For example, a roleplay forum! Also, maybe if SlayerDuck ever feels less charitable about us, it would be nice to have our own server (so we could host IRC and other things with no guilt).

So let's start with an introduction of what hosting is.

When you visit a site, you type (or follow) a link to a "domain name", such as hypnohub.net. The browser looks up that name in a global database (specific to each top-level domain, for example .net is administered by Verisign, and .de by a German authority, etc), then converts that address to an IP address. That IP address would point to your server, more on this later.

So the first part is that you need to pay to have a domain name, so that you can point a name (like hypnohub.net) to an IP of your choice.

Depending on the hosting company, they can include domain name and hosting in the same package. Don't do that, and run away from these backhanded offers. Vanndril lost a good domain name that he still had to pay (AFAIK) because of such an offer from HostGator (IIRC). It's cheaper and more secure if you order them separatedly.

The prices on domain names vary wildly. While many cost about $10 or less per year, some might cost even a thousand or more. This has no bearing with how popular a top-level domain is - some are popular and cheap, some are obscure and cheap, some are obscure and illogically expensive. Also, your ideal domain name has to be either available or for sale - choose available names, "buying" a name from someone else is too expensive.

Another two quick notes on this - you don't buy them, actually, just rent them and renew each year(s). And they follow a hierarchy in reverse order - the top-level domain is .net, the second-level domain is hypnohub, and if you own hypnohub.net you can have forum.hypnohub.net (you can call that a "subdomain").

What I do is use some site that looks up domains, such as 101domain, and register it from somewhere else if it's cheaper (like an Islandic domain name I once had to register).

For example, <<www.101domain.com/domain-...mp;sa.y=-60&sa=Search|rphub.net is available>> (isn't that a kick-ass name!). You can register from them, or from somewhere else (look online for ".net registrar" and see which company you would trust the most).

Then, you'd need actual servers. Here comes the tricky part, because it's not just one option. There are several types of hostings to choose from. The most common are:

* Shared hosting. The cheapest of all, and for a reason. Your code will run under the same machine and operating system than several other people, you will not have control over your own OS, and you'll be like an user sharing a computer with maybe a hundered other costumers. What I don't like about these types of hostings is that you have no control over the server and can't for example run an irc server on it (usually your only option is to run PHP code in some restricted sandbox mode, on a MySQL database, with server settings that who knows how were set up. Your only access is by filesystem/cPanel. Usual prices are about $5/month.

* Dedicated hosting. The most expensive option, but also for a reason. You own an entire machine on a server rack just for yourself, hosted and taken care of by professionals to be online 24/7. You can do whatever you want, and even can provide them with your own hardware for them to just allocate on their infrastructure. The prices for this vary a lot, because it depends on what kind of computer you want. You can expect that it isn't cheap to have a whole computer rented and taken care of just for you.

* Virtual Private Server or VPS. This is the sweet compromise. In a powerful server (way above a high-end gaming computer) they host several virtual machines, one of which is yours. You are promised a share of processing power and RAM usage (that you choose and pay for accordingly), and unlike shared hosting, you do whatever you want with it, almost as if it were a real physical machine. The prices for this also vary, but you'll see that it's possible to get a good deal for this.

Now, VMs are complicated so just imagine a computer inside a computer. If you've never seen it, look at <<cdn.cultofmac.com/wp-cont...011-09-16-at-12.04.19.png|some screenshot>> and imagine just how cool of a technology that is. On a server though, most of the time you want Linux, as it kicks ass as a server OS.

Here comes another variation: there are several different virtualization technologies, and their costs vary. Two of the most common are OpenVZ and KVM. Let's just say that OpenVZ is cheaper and that you'll be well-served by it (the main advantage of KVM is that you can run Windows on KVM and not on OpenVZ, but again, Windows is not the kind of OS that makes a good server). OpenVZ depends on the OS being able to handle it (Linux does), so generally you'll be presented with a list of choices to choose from. I recommend Ubuntu as it's the most user-friendly and has a huge community.

So you might be wondering how much you'll have to pay for a VPS running a OpenVZ-enabled Ubuntu. It turns out I found one company that has great prices and everyone seems to recommend it, I tried it and liked it - it's called <<ramnode.com|RamNode>>.

You're free to take my word with a grain of salt and instead look for a company you think you'll like more. I do promise that I neither work for them nor I'll post any affiliate link or any other kind of bullshit. I'm really recommending as a happy costumer.

I'm paying $14.19 USD quarterly ($4.73/month) for a server with the following configuration:

* 120GB hard drive space cached by SSDs
* 2 CPU Cores at 3.3GHz
* 512MB RAM (Linux uses about 60MB to run unlike goddamn Windows which would grind to a halt with so little) + 512MB swap partition
* 2 Terabytes monthly bandwidth limit
* 1GB/s max network speed
* One static IPv4 IP and 12 static IPv6 IPs
* Weekly backups
* They allow porn, Minecraft servers, using it as a VPN, etc.

Now, their prices look higher than that. The reason my prices are better is because I googled "RamNode coupom" and used one in particular ("LEB35") which slashes the price by 35%, and it's recurring so it will always be 35% off, lifetime. I confirm that it works for me. Note that the savings will only show up when it's time to pay, so don't worry that when it's time to check out, your price will be that good.

The longer your chosen payment cycle, the cheaper it is, but I went for 3 months anyway, and it's a good compromise for me. Paying each month could cost a bit more in the long run, but that's your choice. Also, 512MB is more than enough for a server, so if you are on a tight budget you might want a 256MB plan, but I just think the price is ok so I went with 512 MB.

Done. You know what to buy. Now what?

Well, a VPS is a Virtual Private Server. Your machine. With shared hosting you can expect some sort of support, but with VPS they'll only help you set up the OS, what you do with it is your business (this means that you're not supposed to call support for things like "how do I set up a forum?").

Maybe you're like me and you like to be in control. Well, here you are. Now how do you control it?

This might sound daunting to anyone who never saw command lines in his life, but a Linux server is managed by console access. You use a SSH client (PuTTY is a great one for Windows) in your computer, and you type commands that run somewhere far away. It looks like this: i.imgur.com/Kr9kdee.png

You might want to read on how the Linux command line works, but let me assure you: it blows the Windows one out of the water. Once you get used to it, it's damn easy and powerful too.

For example, if you've choosen Ubuntu as an OS, you can install software via the APT package manager. How easy is that? Well, let's say you want PhpMyAdmin to manage your database. You install it like this:
apt-get install phpmyadmin

Installers are a thing of the past. All of your software will be kept updated for you by your Linux distribution.

You can also install some sort of web-accessible control panel that way too, if that's your thing. Since you own that (virtual) machine, you can do whatever you want.

So you might want to install a forum. Look for some forum solution that you like. If it's written in PHP, your server has to run PHP (alongside a database, usually MySQL, all on top of some HTTP server, like Apache). Unlike shared hosting, this might not be available out of the box, if it's not, just go and install it (look for "install LAMP on Ubuntu" or something - LAMP stands for Linux+Apache+MySQL+PHP).

Your forum package will certainly have an installation guide (such as, "place these files on your server and set X folder as the document root"), and honestly I barely remember these things, it's just a matter of googling as you go along (like "how do I change the document root on Apache").

Whoa, a long post. Thanks to the two of you who read it this far. Any questions just ask.
Corey
10/28/13 09:27PM
**Lets out a low whistle**

Daaaaaaaaaaaaayum
Going to need to actually pay attention and read this later.

Props to you for posting it though. Prol'ly something everyone needs to know at some point
Stem_Cell
10/28/13 09:37PM
What's funny is that in my head it was going to be a short and simple post, but there's just so much ground to cover!

So if someone has specific questions or his server gets clogged with happy_hairs or something, I'm ok to answer individual people's questions (to the extent of my knowledge - I'm still a novice)
Stem_Cell
10/28/13 09:44PM
By the way, I think the command to install a full LAMP stack (for running PHP apps) on Ubuntu is:
apt-get install lamp-server^

as root. The caret means it's a "task", so it's not a package but instead you're telling the package manager to find the required packages and set them up for you.
Zyii
10/28/13 10:12PM
Checking through all of this now and.... sweet jebus;;

Its a lot to take in @_@;;
Zyii
10/28/13 10:47PM
Okay so I purchased the domain, not sure which of the ones in RamNode to pick though. I'm assuming the OpenVZ SSD-Cached VPS one, right...?
Stem_Cell
10/28/13 11:22PM
Zyii said:
Okay so I purchased the domain

That's great!

Zyii said:
not sure which of the ones in RamNode to pick though. I'm assuming the OpenVZ SSD-Cached VPS one, right...?

Yeah, I picked one hosted in Atlanta but I think they're all the same price. It's normal that it'll say $7.50/month or something until checkout, if you add that coupom code the price will be less at checkout.
Stem_Cell
10/28/13 11:30PM
By the way, there's a cool site I use to monitor website uptime called <<uptimerobot.com/|Uptime Robot>>, it's free and monitors up to 50 websites each five minutes and tells you if they're offline. My hosting with RamNode is pretty lightweight stuff, so I don't mess much with server configurations, and I've been having 100% uninterrupted uptime for the last couple or months or so. Over the year it's slightly above 99% uptime with a few sheduled maintenances once in a while (and of course, once again it's your server, so if you screw it up you'd be offline even if the machine is on).
Zyii
10/28/13 11:49PM
Had to step out for a bit to cook myself some food, but anyway:

I'm assuming that for the hostname field it would be the domain name i bought, and for the OS i have no idea what to pick since I've only been on Windows my entire life save for the classes I used a Mac OS on.

Also as a quick, semi related question, would it be possible to host two domain names under one server?
daltar
10/29/13 02:25AM
Wow, awesome post Stem! That's a lot of great information to reference on how to get a site going. Also Zyii for going forward to this! I'll be looking forward to the site ^^

Stem_Cell
10/29/13 11:31AM
Zyii said:
I'm assuming that for the hostname field it would be the domain name i bought

Yes, and at whichever place you've bought the domain from, you will have to later tell them to point it to your hosting server's IP (RamNode gives you one static IPv4 and several IPv6, just use the IPv4 that's 4 numbers separated by dots like 123.123.123.123).

Zyii said:
for the OS i have no idea what to pick since I've only been on Windows my entire life save for the classes I used a Mac OS on.

Well, as as I said in the post itself, my choice would be the latest Ubuntu. You can go with 32-bit because really, with less than 4 GB of RAM there's no much point in using a 64-bit OS anyway.

Ubuntu has a huge community and good places to ask questions on, like on <<askubuntu.com/|AskUbuntu>>.

Zyii said:
Also as a quick, semi related question, would it be possible to host two domain names under one server?

Yes. Not only subdomains (forum.example.com, irc.example.com) but also whole domains like rphub.net and zyiis-portfolio.com.

This is possible because while in the early ages of internet (HTTP 1.0) an IP address was supposed to represent one website, later (HTTP 1.1) they made it so that the browser would send a question like this:
Browser said:
Hey port 80 of the server 178.21.23.135, please serve me with the website hypnohub.net, I want whatever is at /forum/show/2243

Server said:
What you asked was OK. There is text/html there, here it is. Also, have a cookie.

Browser said:
KTHXBAI


This also means that the web server has to be configured to serve a different website depending on what domain the browser asks for. In Apache this is done by <<httpd.apache.org/docs/2.2/vhosts/examples.html|editing a file called httpd-vhosts.conf>>.

daltar said:
Wow, awesome post Stem! That's a lot of great information to reference on how to get a site going.

Thanks, I hope it helps the community. It's good to know these sort of things because today having a server for you is not so expensive as it once was, and who knows what our people can benefit from next :)
Zyii
10/30/13 02:06AM
Okay, so I managed to get the server to point to the domain, but not the domains to the server, they apparently want both a primary and secondary DNS address...

I'm assuming the primary is the IPv4 address you mentioned, but I don't know what to set as the secondary. That is, if I'm even in the proper place for this, I don't know what I'm doing at all with this sadly;;
Stem_Cell
10/30/13 04:54AM
Zyii said:
Okay, so I managed to get the server to point to the domain, but not the domains to the server, they apparently want both a primary and secondary DNS address...

I'm assuming the primary is the IPv4 address you mentioned, but I don't know what to set as the secondary. That is, if I'm even in the proper place for this, I don't know what I'm doing at all with this sadly;;


Oh yes, this is one of those things that are more confusing than they should when you get started :P

The way the internet works, some servers act as "name servers", they are the ones who convert hypnohub.net into 178.21.23.135. So these aren't actually your server, just servers that point to your server on-demand.

So, since that is a very important internet infrastructure that should never be offline, it was engineered so that you can have more than one name server, so that if one fails, the other still (hopefully) works. This is why you can specify a "primary" and a "secondary" DNS (Domain Name System) server. <<www.anvisoft.com/static/team/2012/0613/13395778605723.png|Your computer uses something similar>>.

Fortunately, you don't have to rent, set up and manage your own name servers (though you actually can, and some people have so much free time that they do just that). It's such a common thing to need, that it's common for the hosting company to offer it for free. RamNode does, if you you scroll down <<clientarea.ramnode.com/cart.php?gid=12|this page>> to cPanel DNS hosting, you'll be able to "order it" (it's free).

I use a third-party DNS server, but I'll take a screenshot to show you what kind of form you should look for: i.imgur.com/ZOwypvW.png

They will give you nameservers that you should inform of (as primary and secondary) to your domain registrar. These usually look like this:

* ns1.example.com
* ns2.example.com

And so on, sometimes there's a lot of them (like ns6.example.com, etc). Maybe RamNode uses ns1.ramnode.com, etc (highly likely), but in any case it should be somewhere in its DNS cPanel interface (that you can "order" for free at that I mentioned).

After you perform all these steps, you should be able to go to the-domain-you-registered.net and see some placeholder page like saying "it works!". I say "should", because the hamsters that power the internet might be tired and you'll have to wait for a few moments until they get up to spin the hamster wheels so that the changes take effect.

Gosh, all this must be being pretty massive for you to take all at once. I feel for you, but don't worry that you'll feel great when all is done. Kudos for the effort you're making.
Zyii
10/30/13 05:54AM
I'm pretty terrible at this, it just shows how much I don't actually know/understand and its getting me flustered;;

I don't know if its just they dont mark it clearly enough for me but I can't find at all where to point. I can tell where I can go to edit the server to point to the domain, but even if I tell it, "HEY LOOK HERE FOR THE THING" I can't actually tell it to give me the DNS addresses I need so the domain can follow through.

I hope that makes sense, because I'm confused as to what I need to do right now. I can give you screenshots if it helps you unless you know how the cPanel looks like but yeah; Help please/////


EDIT: No wait, they sent me an email with the things I was looking for. //facepalms// Now I play the waiting game apparently.
Stem_Cell
10/30/13 05:47PM
Zyii said:
EDIT: No wait, they sent me an email with the things I was looking for. //facepalms//

Lol, don't worry, it's usually like that when you take on something for the first time. You're being a lot more brave than most people already, feel proud! :D

Zyii said:
I can give you screenshots if it helps you unless you know how the cPanel looks like but yeah; Help please/////

I actually don't know if that one looks like what I think it should, because some people use the word cPanel for different-looking software, even.

The cPanel that most people usually talk about looks like this for the DNS editor:
x3demob.cpx3demo.com:2082...d/x3/zoneedit/simple.html

And then just because there are a couple of tech gibberish words on that page ("A Record" and "CNAME Record"), it's pretty simple actually:

* "CNAME" stands for "Canonical Name". It's a kind of record that says "maps.google.com should have the same IP as google.com".
* "A" stands for "Address". It's a kind of record that says "google.com's IP is 74.125.234.206".

One would want to add the-name-you-registered.net as an A Record that points to the IP of your hosting (the free IPv4 given for your VPS at RamNode, like 123.123.123.123).

(Also, just to make it clear, the IPv6 are those that look massive, like 2001:0db8:85a3:0042:1000:8a2e:0370:7334, and you can actually use them too (with another type of record), but there's no need to).

So to recap, you have to give your registrar's the name servers (maybe ns1.ramnode.com, ns2.ramnode.com, etc), and on ramnode's cPanel (whatever it looks like), point your domain to your IP.

We're getting close :)
1 234>>>


Reply | Forum Index