• Just got my first VPS, want to lock it down and get a rails stack set up. Paying for help!
    12 replies, posted
Alright so here's the deal. I don't know shit about linux/unix system administration, but I want to learn. I've just purchased a VPS from fanatical. I'm SSHed in as root right now but I don't know where to go from here. I'm assuming the first thing I should do is set up an admin user so I'm not using root, but after that I have no clue what the next steps are, and I feel like there's probably some shit I need to do before I just start installing software. I would really like someone knowledgeable to walk me through this process and tell me what I need to do to make sure everything is nice and secure. The end goal for this server is to have the following: [list] [*]Security. This is going to be a production server so this is one of my top priorities. [*]Ability to deploy Rails 3 and/or Sinatra web sites. (preferably using nginx and passenger, I can find tutorials on this so this is the part that you really don't need to be that knowledgeable about, although it's a bonus if you can give me a hand with this too, especially if you have experience setting up capistrano) [*]FTP [*]A mail server (I would like to be able to send emails from rails/sinatra and to be able to recieve/process them with rails/sinatra too) [*]A git repository/server/whatever you want to call it. I want to be able to use the VPS as a central place to push my projects to. [/list] Also, if you think anything is missing from that list let me know. If you are able to help me out I'm willing to paypal you some cash or gift a steam game or something.
what OS are you using? if your using CentOS the first thing to do is [code]yum update[/code] or if you're using debian / ubuntu [code]apt-get update apt-get upgrade[/code] for security logging in as root is fine and as long as you don't do anything stupid (like run rm -rf /) it shouldn't be an issue, just set a good password. ftp is simple, just [code]apt-get/yum install vsftpd[/code] then remove root from /etc/ftpusers not sure with the mail server, rails should by default be able to send emails but I'm not sure how to make it receive them this here [url]http://blog.agdunn.net/?p=277[/url] seems to be a good tutorial for setting up git under debian and this seems good for CentOS [url]http://www.webtop.com.au/blog/installing-a-git-repository-and-gitosis-2009071343[/url] [editline]24th November 2010[/editline] hopefully I haven't given any misinformation; you can add me on steam if you want someone on the other end of a chatbox to tell you what to do, I will try my best.
I'm running Ubuntu at the moment. Found some decent tutorials on slicehost. So far I've got an admin user set up, have fixed up my iptables, locked down my SSH, and am doing the apt update/upgrade right now. I'll add you in case I hit any snags following these. I appreciate the help! :)
Use CentOS :saddowns:
CentOS can be a bitch to get new packages running though, when being that damn stable you lose the ability to be cutting edge.
If you're planning on using Capistrano, you might want to look at Webistrano too, nice web interface for it: [img]http://imgur.com/MJCvM.png[/img] If it's a production server, personally, I wouldn't actually put FTP on there. Deploy via Subversion/git or whatever your SCM of choice is. Also top tips include disabling root logins over SSH (setup another user and add it to sudoers).
[QUOTE=Hexxeh;26258095]If it's a production server, personally, I wouldn't actually put FTP on there. Deploy via Subversion/git or whatever your SCM of choice is.[/QUOTE] That's a good point actually, I didn't think about that. [QUOTE=Hexxeh;26258095]Also top tips include disabling root logins over SSH (setup another user and add it to sudoers).[/QUOTE] Yep, already did :)
[QUOTE=Hexxeh;26258095] If it's a production server, personally, I wouldn't actually put FTP on there. Deploy via Subversion/git or whatever your SCM of choice is. [/QUOTE] Rsync works nicely as well. [editline]24th November 2010[/editline] [quote] A mail server (I would like to be able to send emails from rails/sinatra and to be able to recieve/process them with rails/sinatra too) [/quote] I don't know how to receive mail, but to send you can set up a sendmail service. [editline]24th November 2010[/editline] [QUOTE]A git repository/server/whatever you want to call it. I want to be able to use the VPS as a central place to push my projects to.[/QUOTE] On your server, create a folder where you want the git repo to go. cd into the folder and run "git init". Just for sake of clarity, lets say that folder you made is /home/user/website Now on your desktop you can do [code] git push yourserver.com:/home/user/website master [/code] You can avoid typing yourserver.com:/home/user/website all the time by running this: [code] git remote add origin yourserver.com:/home/user/website [/code] So now your push command will be: [code] git push origin master [/code]
We have a quick start guide which doesn't do much more than basic OS setting up - [url]http://wiki.fanaticalvps.com/tutorial:first_steps[/url] Proftp is very easy to setup. I'd also definitely advise you install some sort of firewall, I'm a huge CSF ([url]http://www.configserver.com/cp/csf.html[/url]) fan myself. Slicehost have a great set of tutorials, and a lot of decent mail server tutorials which I've found to be rare: [url]http://articles.slicehost.com/2010/3/1/barebones-postfix-install-overview[/url] Oh also, thanks for purchasing from us!
I have no idea how mail works with Rails/Sinatra, but if you can just specify server addresses and it sends email through that, check what I posted here: [url]http://www.facepunch.com/threads/1029851-How-Linux-Smart-are-you-Share-your-Knowledge.?p=26246388&viewfull=1#post26246388[/url] It's a bit heavy (because it has webmail etc.) but it works and it's stupid easy. I set it up on CentOS but it's probably as easy on Ubuntu. If you need help, don't hesitate to PM. I'll forget this post in the next 2 minutes.
Alright so this stuff was a lot easier than I thought it was going to be and I've pretty much got it all set up now haha. Thanks for the assistance everyone :)
[QUOTE=H4Z3Y;26258084]CentOS can be a bitch to get new packages running though, when being that damn stable you lose the ability to be cutting edge.[/QUOTE] [url=http://centos.alt.ru/repository/centos/5/]Not really[/url]. [editline]26th November 2010[/editline] You can get that as a yum repo, obviously.
First thing I ever do on fresh install of CentOS is install RPMforge.
Sorry, you need to Log In to post a reply to this thread.