8 ms·
How To Set Up Your Linode For Maximum Awesomeness
- zdw 14y agoecho /etc/hostname really?
- deleted 14y ago[deleted]
- 3pt14159 14y agoPeople make mistakes like this all the time. Obviously he meant to type cat /etc/hostname
- astrodust 14y agoIt should be to run the `hostname` command, nothing more.
- feross 14y agoOops - fixed.
- spindritf 14y agoThere's a rule in HTTPS everywhere https://www.eff.org/https-everywhere https://www.eff.org/https-everywhere for your site. It redirects feross.org to https://www.feross.org https://www.feross.org which currently doesn't work.
- feross 14y agoThanks for letting me know. I added HTTPS to my site back when I used Wordpress so that I could login to the admin panel over public Wi-Fi. But now that I'm using Jekyll (https://github.com/mojombo/jekyll https://github.com/mojombo/jekyll) I didn't bother to set it up. Will see if I can get my site removed from their whitelist.
- feross 14y agoI got my site removed. https://gitweb.torproject.org/https-everywhere.git/commit/b7a47452e42e09ec18c503b0124d8480d2d92451 https://gitweb.torproject.org/https-everywhere.git/commit/b7... Thanks for letting me know!
- ciupicri 14y agossh-copy-id could be used to copy the SSH key
- zalew 14y ago"On Windows, you’ll want to use putty [...] criminals often try to guess the root password using automated attacks that try many thousands of passwords in a very short time. This is a common attack that nearly all servers will face." yet another tutorial I wonder who's the target audience. if somebody doesn't know the term brute-force or how to open a terminal app and connect with ssh, IMO they are not supposed to set up their own servery by themselves.
- thaumaturgy 14y agoEvery sysadmin in the world once set up a server for the first time; every sysadmin in the world once heard the term "brute force" for the first time.
- astrodust 14y agoSome of these sysadmins were lucky to set up their first server when telnet was still considered acceptable to leave open.
- feross 14y ago"they are not supposed to set up their own server..." What about people setting up a server for the first time? How else are they supposed to learn? I built my first site when I was 14 and moved to a VPS when I was 17. Until I moved to Linode, I never had a reason to open Terminal.
- zalew 14y ago> What about people setting up a server for the first time? How else are they supposed to learn? oh wow. well, I'm kind of old fashioned, but maybe they could start with learning basics of how the internet works, what is ssh, what the hell is linux, and by then somebody will know why you need to open that wierd terminal where there is only text and no cute rounded cornered buttons. I don't get why[1] some tutorials try to cover everything almost from 'first, turn on your computer' to 'deploy your scalable social dynamic api-driven mumbo jumbo architecture web app', and there have been a few around here. there is a place for basic education and there certainly is a place to help somebody kickstart in a particular tech when he's got the basics covered - what's the point of mixing the two? [1] actually I do. clickity click.
- thaumaturgy 14y agoSome random selections from my notes on building Linode web servers: - Set up reverse DNS in the Linode manager: select the Linode, click on "Remote Access", click on "Reverse DNS" (under "Public IPs") - Linodes don't offer very much disk space; use localepurge to keep the filesystem on a diet: # apt-get install localepurge - After installing and setting up MySQL, don't forget: # mysql_secure_installation - After installing Apache, change the following in httpd.conf: ServerToken -> Prod, ServerSignature -> Off, KeepAlive -> Off - After installing PHP, edit php.ini to make it shut up: expose_php -> Off There's a bunch of other fiddly stuff to do, and a seemingly endless combination of packages and strategies depending on what you're trying to accomplish. For instance, I currently run a stack with Postfix for MTA, awstats+jawstats for beautiful server-side site statistics, mod_deflate, mem_cache, fcgid/suexec to make it harder to break the server if a site is compromised, PureFTPd for really easy managed-by-MySQL FTP access, and a pile of other little minor tweaks and knobs turned. MOST IMPORTANTLY: Backups, backups, backups. If you don't already have your own in-house backup service for your server (and I bet you don't!), then please take advantage of Linode's backup services: http://www.linode.com/backups/ http://www.linode.com/backups/
- nigma 14y agoWhy would you turn off KeepAlive instead of setting it to a small value?
- thaumaturgy 14y agoHonestly, I haven't done serious high-traffic testing to see if there's a magic number for KeepAlive. However, I've had enough traffic to the server on a couple of occasions that Apache would've fallen over if KeepAlive were on at all, since you can't specify KeepAliveTimeout in increments of less than 1 second. There are also quite a few Apache-tuning articles on the web that feature "turn off KeepAlive!" in big bold letters, not to mention previous discussion on HN: http://news.ycombinator.com/item?id=2588783 http://news.ycombinator.com/item?id=2588783, http://news.ycombinator.com/item?id=1980278 http://news.ycombinator.com/item?id=1980278, http://news.ycombinator.com/item?id=1875848 http://news.ycombinator.com/item?id=1875848, http://www.kalzumeus.com/2010/06/19/running-apache-on-a-memory-constrained-vps/ http://www.kalzumeus.com/2010/06/19/running-apache-on-a-memo... ...
- zoba 14y agoI find my Linode really useful for x11 forwarding to use Firefox in public places, or to get around web filters. Might be worth a mention of how to do this.
- mratzloff 14y agoWrite a blog post.
- zoba 14y agoThough it is late, and I've been out at bars with friends, I made this for you: http://dzoba.com/?p=182 http://dzoba.com/?p=182
- JonnieCache 14y agoWhat is the advantage you see of tunnelling X like that over just tunnelling the network connections with ssh -D?
- montecarl 14y agoNot all of the web browser traffic goes through the tunnel when you set a proxy in the browser. DNS queries for example do not. Flash programs such as video players also connect directly to the remote website and do not use the proxy. If you don't know those two facts you might be leaking way more information than you want on the local network!
- tomku 14y agoFirefox defaults to not proxying DNS, but if you set "network.proxy.socks_remote_dns" to true in about:config, it will happily do so for SOCKS proxies. If you use FoxyProxy (which is pretty damn useful if you proxy over an SSH tunnel regularly), it has a checkbox that enables or disables it per-proxy.
- krzyk 14y ago
- adient 14y agoPro tip: instead of changing ssh default port, setting up fail2ban and messing with iptables rules manually, just use ufw. You're welcome.
- justinhj 14y agoIs that a Ubuntu only tool? I'd be hesitant to commit myself to anything that runs in a single distribution if I can help it. Fail2Ban would work if I decided to migrate to Centos later down the line. https://help.ubuntu.com/community/UFW https://help.ubuntu.com/community/UFW
- sturadnidge 14y agoIt's an Ubuntu only tool in the same way that aptitude and dpkg-reconfigure are Ubuntu only tools. The guide is not claiming to be generic, it's totally fair game to use specific tools imho - especially if they simplify things.
- cbs 14y ago>the same way that aptitude and dpkg-reconfigure are Ubuntu only tools. No. ufw can run on other distros, its just a frontend to iptables. A quick googling makes it look like its there in Arch repos, you have to compile yourself on CentOS. I don't know about all distros YMMV. Even if ufw was Ubuntu specific, it would not be Ubuntu-specific in the way that aptitude and dpkg-reconfigure are. Those tools are Ubuntu specific because they're specific to that package manager. And in actuality those tools aren't Ubuntu-only either. apt is the debian package manager and the tools should be present on any debian-based distro.
- Dylan16807 14y agoI'm pretty sure you completely misread that post. "X is Y the same way that (false statement)" -> X is not Y
- 14y ago
- yesimahuman 14y agoThanks for the advice on the out of memory reboot. I probably have Apache misconfigured, or my app is slowly leaking memory, but I've run into random downtime and an unresponsive server as apache runs out of memory. One of the most annoying things I'm running into with Linode and other VPS services is dealing with my drive running out of space. I've been moving all my database stuff to Heroku and I'm much happier (plus the automatic backups are a dream).
- omarchowdhury 14y agoThis is great SEO. The author's website ranks first for "Linode Hosting Review". He'll receive a commission for sales generated through his site, and being that his strategy is so targeted, it should convert well and deliver value to both him and Linode. And he does it without ever having to resort to spam, the very opposite in fact; he does it through high quality content. Good work feross!
- ohashi 14y agoGood for him for generating the content and getting the rankings. I don't think it's that competitive though. I launched my site last week and I am on page 2 for the same term.
- juan_juarez 14y agoHuh, I never realized that "maximum awesomness" was synonymous with "basic functionality".
- Jgrubb 14y agoVeterans of Hacker News - why am I not allowed to down vote?
- spacemanaki 14y agoThere's a karma threshold before you're allowed to downvote.
- Jgrubb 14y agoCould you tell me what that number is?
- saraid216 14y agoIt goes up over time. Right now it's around 500.
- jacques_chester 14y agoFor comments or posts?
- saraid216 14y agoComments. I believe the threshold for flagging submissions is 1000, but I'm not sure; I didn't notice when I hit it. You cannot downvote submissions.
- cowsaysoink 14y agoFlagging is considerably lower, this account can flag comments and submissions so I think ~20 karma is required to flag.
- ck2 14y agoIt is so easy and dangerous to mess up setting the firewall from scratch, why mess with it. Use the free, awesome CSF (configserver firewall) instead. http://www.configserver.com/cp/csf.html http://www.configserver.com/cp/csf.html
- shawnee_ 14y agoThe bulk of this article has been copied directly from: http://library.linode.com/getting-started http://library.linode.com/getting-started http://library.linode.com/securing-your-server http://library.linode.com/securing-your-server
- feross 14y ago"I originally compiled this guide as a .txt file of notes for myself, but decided to share it in case anyone finds it useful. If you're looking for something straight from the horse's mouth, Linode [offers guides](http://library.linode.com/ http://library.linode.com/) that cover how to set up a new server, but some of the info is out of date."
- nigma 14y agoOr even easier use one of many StackScripts[1]. But what I would really like to see is a decent introduction to Salt, Puppet or Chef. This way people that are going to deploy their first server could easily build and rebuild the instance and don't end up retyping shell commands from a blog article. Also a note on the default Apache setup. There are several "flavors" of the server. If you are going to host Python sites with mod_wsgi then the apache2-mpm-worker package is a lot beter choice than the traditional prefork model. [1] http://www.linode.com/stackscripts/ http://www.linode.com/stackscripts/
- xachen 14y agoMight I make one suggestion: Make sure your SSH port is below 1024 (but still not 22). Reason being if your Linode is ever compromised a bad user may be able to crash sshd and run their own rogue sshd as a non root user since your original port is configured >1024.
- angryasian 14y agothanks for this tip I never realized this. More in the link if interested http://unix.stackexchange.com/questions/16564/why-are-the-first-1024-ports-restricted-to-the-root-user-only http://unix.stackexchange.com/questions/16564/why-are-the-fi...
- feross 14y agoThis is an excellent suggestion. Thanks!
- taligent 14y agoRemind me again why anybody is still using Linode ? Poor uptime and a disgraceful attitude towards security. ANY service provider that hides the facts behind major security incidents from their customers should never be used. I guess their new customers will soon realise how crappy it feels to find out from Reddit that your VPS is potentially hacked.
- angryasian 14y agocitation or proof of claims ?
- ceejayoz 14y agohttp://arstechnica.com/business/2012/03/bitcoins-worth-228000-stolen-from-customers-of-hacked-webhost/ http://arstechnica.com/business/2012/03/bitcoins-worth-22800...
- yoshamano 14y agoWho would you suggest then instead of Linode? I was thinking of renting their smallest one to have something to fart around with.
- Stratoscope 14y agoIf you want something cheap to fool around with, there is: http://nosupportvpshosting.com/ http://nosupportvpshosting.com/ I just set up a VPS there to try out. No idea on reliability yet, but it does seem like a lot of (virtual) server for the money.
- MatthewPhillips 14y agoPrgrmr.com
- jcoder 14y agoIs this a joke? Looks like a malware site.
- mibbitier 14y agoMy only gripe with linode is that they are unable to handle DoS attacks. If you're subjected to an attack, your linode will be shut off (null routed) for 24 hours. After that time, they'll check to see if it's still being attacked. I really think they could do a lot better than that. Apart from that gripe, they're a great VPS host.
- lsc 14y agoWhat is your suggestion? sounds like they have a clear policy in place; most places it's a vague judgment call. But most places will kick any user that gets hit with a DoS attack that is large enough to disrupt service to other customers. I mean, I agree that 'finishing the job' and letting the attacker win by null-routing the target is... a suboptimal way to deal with the problem, but with pipe-filling attacks? if the attacker can send more bytes than your pipe can handle, there is really no other realistic way to handle the problem. (I mean, you can try to trace down the source and call up the ISPs the packets are coming from, but BCP38 is still not widely implemented, so good luck tracing a spoofed source more than one or two hops up, and meanwhile, as you are calling people up and trying to get through to someone skillful enough to figure out where a spoofed packet is coming from, you are down.) There are 'clean pipe' services, where someone with a very large pipe says they will programatically detect and block DoS traffic, then pass along the good traffic to your (much smaller) pipe, and yes, those services can work /if/ the service provider has a larger pipe than the attacker. Of course, buying such a service from a service provider with a sufficiently large pipe is, as you can imagine, quite expensive. Buying such a service from someone that has less available bandwidth than your attackers are able to throw at the problem, of course, is completely useless. So yeah, uh, assuming you can't afford to be on a 'clean pipe' that is backed by a huge network, you are much better off with an ISP that proactively shuts down DoS targets than one that doesn't. Unless, of course, you are a DoS target. I mean, the economics of pipe-filling denial of service attacks, right now, are heavily tilted in favour of the attacker. It is a problem that needs to be solved, but I don't know how to solve it.
- mibbitier 14y agoOther services, for example Amazon ec2, just deal with a DoS, and charge you for the traffic. Also, null-routing for 24 hours regardless of if the attack only lasted 2 minutes, is a little silly.
- fluxon 14y agoIf anybody needs it, http://webcache.googleusercontent.com/search?q=cache:feross.org/how-to-setup-your-linode/ http://webcache.googleusercontent.com/search?q=cache:feross....