|
Nybble posted:I would recommend this highly. DigitalOcean is phenomenal. I do enjoy a full stack server for $5, 2 cores for $20.
|
# ? Dec 12, 2013 19:52 |
|
|
# ? May 15, 2024 10:02 |
|
I would just put your app on Digital Ocean.
|
# ? Dec 13, 2013 18:14 |
|
I've recently gotten into Rails, and I wanna put an app up on JustHost. I tried for a while, but completely fell flat. Does anyone have a step by step guide on how to set up a Rails app on that service? Or another hosting service? I tried a bunch of things, but had an incredibly off putting time. I'm assuming I'm the one who royally hosed up, but really weird things were going on. Like, I accessed the command line for the hosting, and I couldn't do things as a super user. I couldn't apt-get anything, just a bunch of weirdness. In short, I'm excited to build a site for a friend using Rails, and while I can use Rails just fine locally on my computer, I'm completely at a loss on how to do it on my friend's hosting. Can anyone point me in the right direction?
|
# ? Dec 14, 2013 08:14 |
|
Getting rails set up on shared hosting can be a real pain. Your best bet is almost always to get hosting from a service where you get root access to a dedicated or virtual server. Digital Ocean is popular with this thread and I think they even have an image that has rails pre-set up for you.
|
# ? Dec 14, 2013 08:34 |
|
prom candy posted:Getting rails set up on shared hosting can be a real pain. Your best bet is almost always to get hosting from a service where you get root access to a dedicated or virtual server. Digital Ocean is popular with this thread and I think they even have an image that has rails pre-set up for you. Ah, so my experience isn't abnormal? Well, I feel better about myself. Okay, I'll look into it, thanks. vv Yeah, I knew the hosting was awful. I'm doing this thing both as a fun project for me and as a small favor for my friend, so I didn't want to shake up her hosting situation. I'll try to see if I can convince my friend to switch to one of those. Mystery Machine fucked around with this message at 09:00 on Dec 14, 2013 |
# ? Dec 14, 2013 08:45 |
|
Mystery Machine posted:I've recently gotten into Rails, and I wanna put an app up on JustHost. I tried for a while, but completely fell flat. Does anyone have a step by step guide on how to set up a Rails app on that service? Or another hosting service? I tried a bunch of things, but had an incredibly off putting time. I'm assuming I'm the one who royally hosed up, but really weird things were going on. Like, I accessed the command line for the hosting, and I couldn't do things as a super user. I couldn't apt-get anything, just a bunch of weirdness. Don't do it on your friend's hosting. His hosting is awful. It's seriously not even worth the pain of trying. I would suggest going here first because free server, super easy: https://www.heroku.com/ That will work for you, but if you insist on being different, I'd suggest going here: https://www.openshift.com/ If you really want to futz with servers, then yes, launch a $5 server on https://www.digitalocean.com But really, for your level, Heroku will get you up and running fastest.
|
# ? Dec 14, 2013 08:47 |
|
The problem with Heroku is that the minimum monthly cost to get rid of the really long application spin-up time is like $36. The free tier is fine for testing stuff out but if your app is low traffic a person's initial request can take like 10s which the app spins up.
|
# ? Dec 14, 2013 21:45 |
|
prom candy posted:The problem with Heroku is that the minimum monthly cost to get rid of the really long application spin-up time is like $36. The free tier is fine for testing stuff out but if your app is low traffic a person's initial request can take like 10s which the app spins up. You can get around that by adding the free tier of New Relic. It can be configured to use a heartbeat URL to determine if the server is still up. Since it pings the server more frequently than the dyno sleep time, it'll never sleep.
|
# ? Dec 14, 2013 22:11 |
|
The Journey Fraternity posted:You can get around that by adding the free tier of New Relic. It can be configured to use a heartbeat URL to determine if the server is still up. Since it pings the server more frequently than the dyno sleep time, it'll never sleep. This is pretty brilliant.
|
# ? Dec 15, 2013 04:35 |
|
Does your app have to be up all the time? This is a little complicated, but you can leverage EBS + EC2 spot instances + Autoscaling group + Elastic IP to basically use AWS at about 1/10th the on-demand price. You could probably run on an m1.medium (3.7GB ram, 2 ECUs) for like $15-$20 per month. Also check out lowendbox.com - you can get a decent VPC for $5-$10. Though there's no guarantee your provider won't get raided by the IRS (like the one I was using apparently did).
|
# ? Dec 15, 2013 04:41 |
|
The Journey Fraternity posted:You can get around that by adding the free tier of New Relic. It can be configured to use a heartbeat URL to determine if the server is still up. Since it pings the server more frequently than the dyno sleep time, it'll never sleep. In addition you can use HireFire to scale your dynos automatically for increased traffic (assuming you even need this). It allows you to set limits as well so your maximum cost is always predictable.
|
# ? Dec 15, 2013 05:58 |
|
The Journey Fraternity posted:You can get around that by adding the free tier of New Relic. It can be configured to use a heartbeat URL to determine if the server is still up. Since it pings the server more frequently than the dyno sleep time, it'll never sleep. That's not really sustainable though, I think Heroku's free tier only works if people aren't artificially keeping their apps alive.
|
# ? Dec 15, 2013 07:35 |
|
prom candy posted:That's not really sustainable though, I think Heroku's free tier only works if people aren't artificially keeping their apps alive. And all of this is why, outside of a hobby app (where it's ok that it takes 10s to launch), you should look into alternatives like digital ocean and openshift (not sure about openshift's capabilities, had just started looking at it). In other news, I've been playing with the new capistrano, version 3, today. They changed a lot of the way it works, but now that I'm getting the hang of how it WANTS to do things, I'm finding that it's really, really powerful. Like it very much.
|
# ? Dec 15, 2013 07:52 |
|
prom candy posted:That's not really sustainable though, I think Heroku's free tier only works if people aren't artificially keeping their apps alive. They offer you a hair over 31 full days worth (750) of dyno hours for free. If they didn't want you using it they wouldn't offer it.
|
# ? Dec 15, 2013 09:19 |
|
The Journey Fraternity posted:They offer you a hair over 31 full days worth (750) of dyno hours for free. If they didn't want you using it they wouldn't offer it. That's not how businesses able to offer a free tier work. You will see the free tier quickly be replaced or the hours reduced if every free account starts using every single dyno hour of a month.
|
# ? Dec 15, 2013 16:10 |
|
Obsurveyor posted:That's not how businesses able to offer a free tier work. You will see the free tier quickly be replaced or the hours reduced if every free account starts using every single dyno hour of a month. Dunno, Heroku is about as mature as a company that sprang up from rails gets. If they were going to remove their free tier, you'd think they'd have done it by now. They make conversions because the single dyno is rarely ever enough for a mature app (and as mentioned before, they put inactive dynos to sleep). If someone uses their full free tier monthly then so be it.
|
# ? Dec 15, 2013 17:21 |
|
Obsurveyor posted:That's not how businesses able to offer a free tier work. You will see the free tier quickly be replaced or the hours reduced if every free account starts using every single dyno hour of a month. Every single application that uses multiple dynos gets one of those for free all month. I've done this for multiple work projects that I want to stand up easily but do not require more than one process, like Hubot. I have yet to hear a peep. Salesforce has more than enough throwaway cash to earn that small bit of goodwill for one of the few products of theirs that people like. *edit* And this is the Ruby thread, not a Heroku one, so I'm going to stop this derail. The Journey Fraternity fucked around with this message at 18:32 on Dec 15, 2013 |
# ? Dec 15, 2013 18:28 |
|
The Journey Fraternity posted:*edit* And this is the Ruby thread, not a Heroku one, so I'm going to stop this derail. This is a Rails thread. Surely Heroku is synonymous enough with Rails that discussion of it is worthy of a place in this thread?
|
# ? Dec 15, 2013 23:51 |
|
a_big_dog posted:This is a Rails thread. Surely Heroku is synonymous enough with Rails that discussion of it is worthy of a place in this thread? I'd think any talk about getting a rails app working on the Internet is appropriate for this thread.
|
# ? Dec 15, 2013 23:54 |
|
kayakyakr posted:(and as mentioned before, they put inactive dynos to sleep) Yeah and what we're discussing is tricking Heroku into thinking your dyno is active in order to not get it put to sleep. If everyone was to keep their free-tier dynos active at all times they wouldn't be able to offer the free-tier.
|
# ? Dec 16, 2013 05:00 |
|
prom candy posted:Yeah and what we're discussing is tricking Heroku into thinking your dyno is active in order to not get it put to sleep. If everyone was to keep their free-tier dynos active at all times they wouldn't be able to offer the free-tier.
|
# ? Dec 16, 2013 05:09 |
|
prom candy posted:Yeah and what we're discussing is tricking Heroku into thinking your dyno is active in order to not get it put to sleep. If everyone was to keep their free-tier dynos active at all times they wouldn't be able to offer the free-tier. But everyone doesn't and so it's not an issue, no? It's a neat workaround for sites that get little enough traffic that they go into standby mode but are critical enough that a delay on the first load when someone does use it would be a significant issue. There aren't many sites like that, really. Maybe an early, small startup that might get 10-15 organic visits/day and needs a high conversion? But still, that's not what you'd use Heroku for anyway. Is it a big deal?
|
# ? Dec 16, 2013 06:24 |
|
I don't see the New Relic trick being a trick at all. Heroku could just as easily restrict their free offering to half a dyno month or a quarter dyno month without affecting people's experimental apps, while requiring tiny production apps to pay. The way I see it, they have New Relic as a small additional thing you need to figure out and do so that every account's forgotten blog app experiment with 2 git commits doesn't stay active for all eternity. I don't think anyone outside Heroku has a clue if using New Relic to keep a free dyno alive will affect their bottom line too much. If it's a problem, they're a business and they'll let us know.
|
# ? Dec 16, 2013 08:36 |
|
prom candy posted:Getting rails set up on shared hosting can be a real pain. Your best bet is almost always to get hosting from a service where you get root access to a dedicated or virtual server. Digital Ocean is popular with this thread and I think they even have an image that has rails pre-set up for you. Time to search for this! The only thing scaring me from DO is getting everything setup.
|
# ? Dec 16, 2013 17:56 |
|
If you guys have trouble setting servers up, just get your hands dirty and start doing it anyway. It's a valuable skill and you won't be deploying every project for the rest of your life to Heroku.
|
# ? Dec 16, 2013 20:59 |
|
Is there a good way to practice before buying in? Just set up an old box and install debian? Or just do something like this? https://www.digitalocean.com/community/articles/how-to-use-the-digitalocean-dokku-application
|
# ? Dec 16, 2013 21:01 |
|
raej posted:Is there a good way to practice before buying in? Just set up an old box and install debian? It's five dollars, but if you want to try first, the pre-built image is a Ubuntu 12.10 image with rails, unicorn and nginx, just spin up a vm with virtualbox.
|
# ? Dec 16, 2013 21:03 |
|
raej posted:Is there a good way to practice before buying in? Just set up an old box and install debian? Or you can use Amazon's free tier to get a year's worth of an EC2 micro server. Use an ubuntu image and roll with it. When I build my servers, I have a few steps along the way: 1: Set up the user Digital Ocean's bare Ubuntu distros (I like to use 12.04x64 for "production" servers, which I'll upgrade to 14.04 next year, will play with other versions) come set up with just a root user out of the box. I like the way that the EC2 server looks when set up, so I emulate that. Logged in as root: code:
2: Prep for server Exit, log in as ubuntu, and run: code:
Bash code:
I use capistrano for doing my deploys. Out of the box it does a whole lot of work for you. This is my list of gems for capistrano: Ruby code:
These are the important changes I make to my deploy.rb script that took me a while to figure out (the remote file thing that is): code:
code:
4: Unicorn You have to configure unicorn, I suggest like so: code:
Locally run "cap production deploy --trace" handle any issues that come up. I had a few. 6: Nginx Back on the server, add something like this to /etc/nginx/sites-available/application: code:
Also on the server do: code:
Seriously, sit back and open a beer, you just became capable of doing devops using Digital Ocean. Hit your website and rejoice. kayakyakr fucked around with this message at 21:59 on Dec 16, 2013 |
# ? Dec 16, 2013 21:47 |
|
The New Relic/Heroku "trick" is fairly widely known and has been for a good long while. If it truly was a problem they would have done something about it by now. That said, Digital Ocean is a great alternative if you don't mind getting your hands slightly dirty setting things up. Once you have capistrano rolling it's just as turnkey. Edit: And that's a good write up above this post
|
# ? Dec 16, 2013 21:59 |
|
After you manually set up servers a couple of times like that though, start using some kind of configuration management tool, like Puppet or Chef. Makes setting up new boxes from scratch truly a one click affair.
|
# ? Dec 16, 2013 22:03 |
|
Smol posted:After you manually set up servers a couple of times like that though, start using some kind of configuration management tool, like Puppet or Chef. Makes setting up new boxes from scratch truly a one click affair. Yeah, if you find yourself doing that a lot, I would look into puppet or chef or maybe just write yourself a custom capistrano task that does it all for you. But really, the part that Puppet/Chef handles takes me about 3 minutes to do after the server's been spun up, and outside of horizontal scaling how often do you have to perform an initial server configuration? Most of the first half of that post was done by memory (other than copy/pasting postgres's apt repo) and the rest was copy/pasted from my most recent project. It'd take years to have the time for a puppet/chef setup equal the time used typing into terminals.
|
# ? Dec 16, 2013 22:19 |
|
yeah, yeah, double posting, but what would you guys think about starting a new thread? The OP is from over 6 years ago, everything in it is horribly out of date, the poster hasn't posted here since 2008, and with a 122 page thread, the same questions have tended toward being asked many times already. I'm thinking: OP would have resources, links to tutorials, and suggestions for setting up an environment. Probably mention hosting. A 2nd post would be a copy of my Digital Ocean deploy tutorial above. Thoughts? Anything that'd need to be in the first set of posts that you'd like to see such as suggested gems or whatnot?
|
# ? Dec 16, 2013 23:14 |
|
Yeah, I did the same thing with the web dev thread and it's a pretty solid OP now. I used google docs and let the frequent posters edit or create new content, which worked well as a collaborative approach.
|
# ? Dec 16, 2013 23:34 |
|
kayakyakr posted:yeah, yeah, double posting, but what would you guys think about starting a new thread? The OP is from over 6 years ago, everything in it is horribly out of date, the poster hasn't posted here since 2008, and with a 122 page thread, the same questions have tended toward being asked many times already. Go for it. I could probably write up a quick guide/tips n tricks about Active Admin if there's any interest.
|
# ? Dec 16, 2013 23:36 |
|
Oh My Science posted:Yeah, I did the same thing with the web dev thread and it's a pretty solid OP now. I used google docs and let the frequent posters edit or create new content, which worked well as a collaborative approach. Do you just have a copy of the OP off in some google drive doc and you copy/paste update it every once in a while? I think that guides and the like can be linked to from the OP. So you'd create a guide, and then the link to it and description would go in the OP. I'll get that started. Google Doc. Gonna use this as the basis. For now I'm going to go ahead and allow open access to editing, but maybe in the future lock it down to people that request editing access?
|
# ? Dec 16, 2013 23:50 |
|
kayakyakr posted:Do you just have a copy of the OP off in some google drive doc and you copy/paste update it every once in a while? Yeah I do, although I think the sharing permissions have been nixed just in case. The real pain was writing the bbcode to make it look decent and finding out that anchor links are not supported by SA. I had it completely open to editing for about a month. Assuming no one in the thread is a jackass it should be fine. Edit: Dare I suggest we make the thread about ruby frameworks and not just rails? Oh My Science fucked around with this message at 00:01 on Dec 17, 2013 |
# ? Dec 16, 2013 23:55 |
|
Oh My Science posted:Dare I suggest we make the thread about ruby frameworks and not just rails? Oh my. That would be out there. I think that would be good, though. Ruby + frameworks. e: editing open now.
|
# ? Dec 17, 2013 00:05 |
|
FYI don't go too crazy the with the internal guides and instead point to external documentation or blogs. I would say 90% of the commonly used frameworks and deployment tools have decent documentation now anyway.
|
# ? Dec 17, 2013 00:40 |
|
Smol posted:After you manually set up servers a couple of times like that though, start using some kind of configuration management tool, like Puppet or Chef. Makes setting up new boxes from scratch truly a one click affair. I prefer sprinkle. Puppet and Chef are horrible nightmares to setup imho because they're designed for huge enterprise deployment, requiring a server just for managing recipes and such.
|
# ? Dec 17, 2013 00:57 |
|
|
# ? May 15, 2024 10:02 |
|
Oh My Science posted:FYI don't go too crazy the with the internal guides and instead point to external documentation or blogs. I would say 90% of the commonly used frameworks and deployment tools have decent documentation now anyway. Right. But things like the above deployment guide would be good, I would think, because it could stand on its own as a blog post. If I had the time/inspiration to maintain a blog, that post would have been there and linked to here. But I'd rather spend my time with you guys, so it's an exclusive. Screw the Internet at large.
|
# ? Dec 17, 2013 01:11 |