EGOPOLY

Topics include: programming, Apple, Unix, gadgets, large-scale web sites and other nerdy stuff.

How to Set Up a Linode Web Server

2015-03-25 10:20

(The way I like it, at least.)

  1. Deploy minimal linode server size.

  2. Create image with Ubuntu LTS. Boot it.

  3. rsync .ssh keys to root account. Then on the linode:

    chown -R root .ssh
    chgrp -R root .ssh
    
  4. Update apt for some reason:

    apt-get update
    
  5. install the packages you need:

    apt-get install apache2 emacs24 php5 mailutils
    
  6. update SPF DNS record so you can send mail from the server

  7. set up firewall as described on securing your server.

  8. enable sites and mods for apache:

    cd /etc/apache2/sites-enabled
    ln -s ../sites-available/default-ssl.conf .
    cd /etc/apache2/mods-enabled/
    ln -s ../mods-available/ssl.* ../mods-available/socache_shmcb.load ../mods-available/rewrite.load ../mods-available/include.load .
    ln -s ../mods-available/cgi.load .
    apachectl restart
    
  9. add some options to 000-default.conf:

    AddHandler cgi-script .cgi
    
  10. global options

    <Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
    
  11. Jesus Christ

    apt-get install make
    
  12. CPAN

    apt-get install build-essential
    cpan
    make install 
    install Bundle::CPAN
    cpan install LWP:UserAgent
    

Setting up basic perl CPAN is more of a pain in the butt than I would have liked. But overall I found it so much easier to get a Linode up and running and useful than an EC2 instance. Sure, you can do anything with AWS, scaling up to infinity sized web site. But for that single-server need, Linode is 15 minutes. Click, click, type, done.