We have threads!

Join a laid-back, close-knit community of mixed interests Get a free account!

  1. Starting a Web Forum

    #633822013-09-07 05:18:08 *Trev said:

    So I've gotten a lot of technical questions lately about CL, what it runs on, how one would (hypothetically) build something similar to it. So between now and when the auction expires, I've decided to create an educational thread on the technical aspects of creating a web forum. I'll include examples, supplemental materials, and at the end maybe even some sample code to help any aspiring web forum developers get started.

    A lot of these posts could be whole classes in software development degree curricula but I'm going to hit the highlights and give the best beginner tips I remember, and then link to source information, manuals, and tutorials that I used to learn these systems.

  2. #633832013-09-07 05:21:04 *Trev said:

    Now, the first thing that you'll want to do is purchase a domain name. There are several registrars with different prices, so make sure to price compare. Also note that some registrar prices only apply with purchase of hosting, so be sure to read the fine print. You don't want to be locked in to a webhost that doesn't support all of the capabilities you're going to need for this monster you're creating.


    No, the cute girl in the ad doesn't work there. I asked.

    Anyway. Also consider your audience, and domain recognition. The highest recognition would be for .com domains, with .net and .org shortly behind. .coms run around $30/yr for non-promotional rates, and .net and .org go for about $15. Make it easy to remember, since people forget.

    If you go with free hosting and end up with a long name with lots of slashes in it for your root directory, you're still gonna want a domain to redirect to your address. People forget these things so easily.

    If you want a domain hack, like del.icio.us or antarc.tk, you'll have to pay for the top-level domain, which has rules that vary by the country of origin and administrator. .tv and .fm are close to $75 a year, whereas .tk is free (but may charge you if your name is a creative domain hack they haven't thought of yet.) Prices and regulations may vary by country. If you have .cat in your name, for instance, your page -must- have at least some content in Catalan.

    So you bought your domain name. Write it down, and log in to whatever control panel your domain name registrar provides. Keep this tab open.

    Next, go find a hosting provider who supports the technologies you're going to be using. For the purposes of this tutorial, I will say to look for support for the following:

    • Secure FTP
    • SSH / Shell access
    • PHP (a recent version) or whatever scripting languages you use.
    • MySQL (or whatever database provider you use)

    In a best case scenario, your provider gives you your very own Linux virtual machine space with shell access, wherein you just -install- all of the crap that your server needs. This is what I assume you guys are going to find, because you're smart and you want to really control every step of your server administration.

    If, at this point, you've asked, "what's that?" about any of the things I've posted here, there are no stupid questions as long as they're on topic. Go ahead and ask them in the thread below.

    Now, if your hosting and your domain provider came from the same people, you can skip this step. If not, you'll want to redirect your domain's DNS records to point to your hosting.

    Go back to the domain control panel tab, and find the nameservers for your domain. Replace those strings with the nameservers from your host. Set your A, AAA, or CNAME record (as it applies) to the IP addresses for your hosting server. As the DNS record propagates, within the next 24 hours, computers worldwide will know that your domain points to your server.

    DO ALSO NOTE that just because you buy a domain name, if it has trademarked or copyrighted names in the name, and it's a United States TLD (.com, .net. org, .us., .mobi, .aero, .biz) if you use the trademarked name or copyrighted items on your site, it doesn't even take a lawsuit to take you down; a DMCA request will do it.

    Congratulations! You have a server on the Internet and people can find it. Now what? (Please post questions at the end of the thread.)

  3. #633842013-09-07 05:21:15 *Trev said:

    All right. If your site is running all of the necessary processes, and you aren't on a Linux VM, skip this section. You may not be able to run all of the necessary parts of a webforum the same way, so you might want to go get phpBB or tinyboard if that's what you're into, or spend a lot of time whining at your VPS provider to install the rest of your software stack. Good luck.

    Everyone else. So you've got a Linux virtual machine out in outer space somewhere, on an IP address (and your shiny new hostname!) running SSH and nothing else. Now you've got to put stuff on it and do work!

    Okay. Secure Shell is a way to access the command line of a Linux machine remotely from another computer. If you're on Linux, you have SSH installed (actually, if you're on Linux, most of the rest of this post will probably be uninteresting to you, so just skip down) and if you're on Windows, you'll want to get PuTTY or another terminal emulator for the remote connection.

    Now, connect to your VPS box. On Linux:

    ssh mylogin@example.com 22

    And in PuTTY, use the GUI to input the hostname and port number (probably 22). It will ask you for your username and password.

    If authentication is successful, you will be looking at something like this:

    username@servername:~$ _

    This is a Linux prompt. If you don't know how to navigate one of these, it's time for you to learn a thing or two. LinuxCommand.org will teach you the basics, and how to pipe output from one command into another. GeekStuff has a list of the 50 most common commands, and what they do, and ss64 has a comprehensive list of all core utility commands. The most basic ones are:

    • ls - list contents of current directory
    • pwd - list current directory path
    • cp - copy file
    • mv - move or rename a file
    • rm - delete a file
    • cd - change directory. cd .. to go up a directory.
    • ./appname - to run appname found in the current directory
    • sudo - execute the following command with superuser privileges

    And you'll need to learn how to move your files around and run programs before you administer your server.

    Now, file transfer over SSH is possible with the SFTP commands, but I'm betting a lot of you are already overwhelmed with having to learn all of the Linux command arcana. Let me introduce you to my good friend FileZilla. FileZilla allows you to make Secure File Transfer Protocol connections to the same port you connected via SSH. The interface is drag-and-drop, and you can pretty easily migrate all of your scripts, pages, images, and various other baubles to a folder you have permissions for on your site.

  4. #633852013-09-07 05:21:32 *Trev said:

    I'm going to split this post into two parts, and finish it in a few days

    Scripting Languages

    Now every architect needs to know his tools. Underneath whichever webserver you go with (apache, nginx, cherokee, or whatever tickles your pickle) it needs to support your scripting language of choice. Let's look at a few popular server-side scripting languages.

    • PHP

    PHP is the easiest for beginners because it allows you to write a file that is mostly HTML and inline lines of PHP with <? and ?> to insert variable fields, links, or anything from the database you would like. PHP was used for a really large portion of CL. A downside to PHP is that its debugging is somewhat tedious, it has a few bugs in modules, and it allows for/encourages sloppy coding. Dr. David J. Malan's Harvard CS-75 course provides a good intro to many web technologies, and uses PHP. I recommend that regardless of what stage you are at or which language you decide to use, that you watch these excellent videos.

    • Python

    Python has the best, most helpful userbase of any scripting language. It's got very clear and clean formatting, and the structure makes it obvious that there's one right way to do things. The downside is that its rigidity can make some takes a little more tedious. It forces you to indent your code since it doesn't use brackets. Zed Shaw's Learn Python the Hard Way is the canonical resource on Python.

    • Ruby

    The upside to Ruby is that it's really easy to read and write, and it makes a lot of sense for concurrent or real-time server-side code. That's why the backend of CLChat is written in it. The downside is that quite a few different errors make it crash with no proper exception handling, and if you do your whole site in Ruby, the Ruby on Rails developer community will make you puke from their smug self-importance. TryRuby's Interactive Ruby will teach you the basics of the language, and the site has further tutorials, including links to Rails.

    • Perl

    No. Just don't.

  5. #633862013-09-07 05:22:00 *Trev said:

    The backend of your website will be in one of the above scripting languages. It's necessary but it's boring. As long as you've chosen one, that's all that matters at this point. But learning Python, Ruby, PHP, or whatever else isn't enough to build a website by itself.

    Web documents are presented in Hypertext Markup Language, and styled with Cascading Style Sheets. HTML provides the document structure for a page, and CSS tells the browser how and where to draw the elements. A good HTML/CSS stack has as little of the styling as possible in the HTML so that re-skinning the page is as easy as switching the stylesheet.

             <!-- This is a comment. -->
             <!-- Below is an example of a stylesheet link. -->
             <!-- Javascript will also be linked to the page here. --> 
             <link rel="stylesheet" type="text/css" href="theme.css">
             <title>Page Title</title>
        Body text of the page goes here.<br />
        <!-- Below is an example of inline PHP -->
        <?php echo $some_php_variable; ?><br />
        <!-- Below is a link -->
        <a href="/some/link/path">Link Text</a><br />
        <!-- Below is an image -->
        <img src="image/path/here.jpg">Alternate text</img>

    This is the basic structure of an HTML document. As you can see, the bracketed tags are used to separate parts of the document.

    A CSS attribute looks something like this, with rules inside:

    a {
        font-size: 12pt;
        text-color: blue;
        font-weight: 777;

    And a .css page is made up of lists of these rules.

    CSS uses spacing rules to determine how much space exists inside and outside of a container, and how they are aligned. An example of this is the image below.


    The definitive tutorial for HTML and CSS is w3schools although some of the information is not the most up-to-date for modern browsers. The HTML and CSS courses and references are in the navigation bar at the top of the page. Again, I cannot stress enough that trial and exploration are the fastest way to learn HTML and CSS.

    Also, most browsers have a View Source function. Chrome and Firefox also have a debugger which is accessed by pressing F12. The debugger has an item selector which can be used to click on a box and unravel both the HTML code and CSS rules for that item. It's a great way to learn from someone else's code.

  6. #634522013-09-08 18:58:19Trev said:

    If you have questions on anything I've posted so far, please post them in the thread instead of PMing them to me. Most likely someone else has the same question.

  7. #641972013-10-02 08:31:44 *Rune said:

    Well, I just registered my first domain through name.com and really, this sales pitch is what really got me.

    But man, there's so many registrars out there offering different prices with different bells and whistles that makes it pretty confusing on what is it you really need and what is non-essential. Of course, in the end, what you really need is a domain name and a good customer service and that's why I decided to go with the registrar that swears by the latter.

    Also @Trev, I have a question: Is an SSL certificate needed for this kind of internet forum? I mean, we're not processing credit cards or anything but would there be any reason to have one on an Internet forum like this?