Over the past few years I’ve been trying to get away from using FTP and deploying an entire directory to just update a web app. I’ve used services like Springloops and even tried a tool like Capistrano, but nothing really was 1) Simple and 2) Free until I wrote my own bash script. Here’s basically what you do.
- Create SSH keys between your local machine and your remote box.
- Create a bash script with the following code.
LOCAL=YOUR LOCAL DIRECTORY
rsync -rtv --progress --exclude-from 'exclude-list.txt' $LOCAL $REMOTE
ssh firstname.lastname@example.org 'chown -R user:nobody /home/useraccount/public_html'
ssh email@example.com 'chmod 750 /home/useraccount/public_html'
So set your LOCAL to your local directory path, REMOTE to your remote path with your user that you have your deployed files.
Note the rsync parameters, I’ve not chosen -a because that will also copy my local permissions, users and groups vs. the remote permissions users and groups.
Finally I’ve added an excludes list, which I’ll add things like “.git/” so that the git repository does not get sync’d and copied.
Now if you’re stuck into using FTP and just want to export what’s changed. I use this little script:
tar czf ~/Temp/new-files.tar.gz `git diff --name-only SHA1 SHA1 | grep -w '.php'`
This allows me to create a tar.gz of just what’s changed between two commits and in the case above, just grab .php files. You can remove everything past | grep if you want everything.
So for some time I had a reseller account at HostGator. The problem I had with this was eventually they put so many sites / re-seller accounts on the server that it (my site) was down often enough where I spent more time contacting support, than I did having to manage my domain. So I moved to a VPS.
Now I am on a VPS at PowerVPS. The problem now is that the root node is constantly getting overloaded and my site is once again VERY SLOW. I need to send them tickets about twice a week to have them fix the issue, so my VPS will come back to life and be responsive.
What to do? What are my options:
- Go back to reseller – No, still too slow and over subscription
- Another VPS – Perhaps, but there still might be server and over-subscription issues.
- Dedicated Server – Perhaps, but there will be more time setting up, I will need to get something with RAID and and it will be much more expensive.
- Hybrid – Interesting, The ideas is to keep a basic site for cpanel and management, then update the DNS for the WWW record to point to another server where I can ensure performance, ie a dedicated machine or a cloud server from Rackspace.
I think I am going to try Hybrid for now, see how it goes.
A few months back I moved everything from HostGator to PowerVPS. So far I am very happy with the results. It features great performance compared with other shared hosting solutions.
I have now moved everything to HostGator. Though they upgraded everything a few days after I joined up, so I had to move accounts again! Now I get 12GB of hosting space, a jailed SSH, PHP5, etc.
My first dedicated hosting experience was not cool. Here's some tips:
- Buy the cheapest option first to play around with it. I purchased what I thought I would need, raid1, 1gb ram, 160gb hard disk, 30gb FTP, Plesk (which I don't like), etc. Remember you can always upgrade if you find you are happy with them…
- Be Careful of Pre-Payment, when going in I thought I would be happy with the options, but low and behold I had to cancel, and to top it they slammed me with a 30day until cancel notice. So this means I had to shell out another 30 days of hosting I would never, ever use… Bogus!!!
- Stick with what you know… I should have stayed with WHM/Cpanel over PLESK.
- Don't recompile any software (configure/make/make install). The reason for me is PLESK, since it did not fully support PHP 5.1.6, when i did the recompile and install via Apache, PLESK started to blow chunks at some point in the future… Also, depending on who you go with they might install patches or updates that might not work with what you have modified…
- Be prepared to spend some time learning things… Pick up a cheap PC someplace then install the SAME distro you will be leasing and use this as your development / test box.
I have canceled my dedicated server and am right now back with ResellerZoom because they offer PHP5 under reseller accounts, and have fail over hosting (RAID1). So for now I will stay with them but I am still having a funky email bug with their servers… Who knows I might be changing everything back in a month or two…
Update (12pm) on my SAMBA issues, nothing… Update on my Plesk Firewall issues, nothing… My next server might just have to be Windows2003… Sigh…
Update (3pm) My reseller, continues to bounce my server, mail goes down, apache goes down… I can't access… So, I will most likely be changing again in a month. Man, why isn't there a good web host out there, they all seem to suck equally bad…
If anyone has a good host, please send me a note!
I have been trying to find a dedicated server now for about 2 weeks. They either have the right server or poor service. They have good service or the wrong server, or you need to pay out your butt for both, then you are still not confident in them and need to try it out for a bit.
I actually have thought about getting a T1 line to the house and purchasing my own server, in the end it would be more work on my part, but at least I could count on the server, but would most likely have problems with the networking…
Well, I finally had enough of the site bouncing. Moving from ReadySetConnect to HostGator.Com.
So far the performance ROCKS and the support is FAST! The best part is the unlimited domains for just $9.95/month.
I will be telling readySetConnect they get the boot as soon as my other domains transfer.
After all of the hosting experiences I have settled on ReadySetConnect.Com. Though I am not 100% satisfied its the best thing going.
I am moving my site from Java/JSP to PHP. This is fun, exciting, and I am re-learning PERL which I have not done regularly since 1995. I also just put up Emms site. EmmP3.Com she will start doing things with it soon.
Well, I am giving up on JSP/Java Hosting. Too much instability. I am also moving to a site where my ping times are better. <40ms vs ~100ms range. The site I found is ReadySetConnect.Com.
Plus I am month-month with 50 domains for 11.99 a month. I must thank Sarah Lane from TechTV's The Screen Savers for this advice.