sgrenger
By:
sgrenger

Need some guidance

December 2, 2013 4.3k views
Hello guys!! First of all, i want thank you all for the support you have given me!! I'm totally new with all this vps stuff, so i'm trying my best to learn as fast as i can! I'm glad there are so many tutorials in here!! The problem is that i've been following many of those tutorials, but i'm getting lost a lot, because i often need to merge 2 or more tutorials to do what i want, and then one of them says one thing and the other says another (which is good, cause they serve different purposes). So, i wish i could have some guidance, like: 1- follow this link, then 2- this link, then 3- and so on, based on what i need. I know that i'm asking too much, but i'm willing to restart my droplet because i'm afraid i've done something wrong, mainly in the safety area.. and i know that there are some things i can´t do after i've done other things.. Here is what i've done already: installed ubuntu 10.04 64x (don´t know about ubuntu or CentOS, but i followed a guide that said to install ubuntu, and i even made some changes in ssh and the droplet port, changing from 22 to 25000, based on the guide) - then i installed Zpanel, and only got to see its interface by thyping in the web browser the droplet's IP (i did'nt change the droplets hosts file nor my computer's hosts file), and then i got confused about firewalls, ports and stuff like that, temporary DNS, etc... So, i what i need now is the following: I need to migrate my wordpress blog from a shared hosting to DigitalOcean, but i want it to be very secure (i still don't know enough about security), because my site is big and i gain money from it, so there were cases of people trying to hack it. The site needs to be able to handle a lot of simultaneous traffic as well, and fast, if possible.. Also i need to use a control panel, like Zpanel (because cPanel is paid service). I've been told that Zpanel installs LAMP and phpMyAdmin by itself.. I've heard Varnish is very good for caching and allowing a lot of traffic too, but i dont know when is the correct time to install it.. Should i install it? After Zpanel? Before Zpanel? After Wordpress? Also i've read something about php APC, fast cgi, but don´t know about them.. Then i need to restore my database and content of the wordpress site (can i do it with zpanel interface?), and after that i need to test it before propagating the DNS.. And then i want to know there is anything else to do before i propagate my DNS and get my site to work as before, but now on DigitalOcean =)) I know its too much to ask, but thank you guys anyway!!
10 Answers
"Also i need to use a control panel, like Zpanel ..."

Why? IMHO, you should not install zPanel at all. In doing so, you are:

1.) adding another layer of complexity;
2.) adding another possible point of failure;
3.) limiting your ability to have granular control over your cloud server (that is, if you rely on zPanel exclusively).

Case-in-point

All of the "premium" WordPress hosting companies employ Nginx, instead of Apache (including the inventors of WordPress: WordPress.com!). Thus, it defies logic that anyone that values performance would deploy their WordPress installation on the LAMP stack. I'm no expert on zPanel, but, if memory serves me, zPanel does not support Nginx.

You're better off with:

1.) How To Use Filezilla to Transfer and Manage Files Securely on your VPS;

2.) How To Create SSH Keys with PuTTY to Connect to a VPS;

3.) How To Install Wordpress, Nginx, PHP, and Varnish on Ubuntu 12.04; and

4.) Either the Duplicator plugin or How to Migrate WordPress from Shared Hosting to a Cloud Server with Zero Downtime.
by Etel Sverdlov
Varnish is an HTTP accelerator and a useful tool for speeding up a server, especially during a times when there is high traffic to a site. It works by redirecting visitors to static pages whenever possible and only drawing on the server itself if there is a need for an active process. This tutorial covers installing wordpress on a LEMP stack (with nginx instead of apache), and then installing varnish.
Thank you so much Pablo!

The link about How to Migrate Wordpress talks about migrating into an Apache server, will i be alright following it using Nginx?

After all thopse steps, will you recomend installing SSL certificate?
Oh, i just remembered one thing! Someone said once that there's a software to monitor server stats called "atop". Do i install it before or after wordpress??
"... will i be alright following it using Nginx?"

Yes, b/c your site's content is not stored in either Apache or Nginx. So long as your shared hosting plan utilized MySQL and you're migrating to MySQL on DigitalOcean, you'll be okay.

"... will you recomend installing SSL certificate?"

Not a bad idea. Check out StartSSL Free.

In re: to security, make sure to deploy a firewall. See How to Setup a Firewall with UFW on an Ubuntu and Debian Cloud Server.

"Do i install it before or after wordpress??"

It doesn't matter.
by Shaun Lewis
Learn how to setup a firewall with UFW on an Ubuntu / Debian cloud server.
Nice Pablo!
I'm starting a new server nwo and the first step i'll do is to deploy that firewall (in the link it's written that sometimes that firewall comes by default on Ubuntu, so ill just need to check if it's activated or not, if it shows nothing it means i need to install, right).

After that, i'm in doubt if it's a good idea for me to install Fail2ban and DenyHosts, as said at the end of the post on How to install Ubuntu. I'm thinking that they may be good, because all security is welcome, or am i wrong in this??

After that i will set the FTP stuff using that link you posted and then set SSH keys to connect with putty.

And finally i'll be ready to install all of the softwares, following your other links.

Please tell me if i'm wrong in something! Thanks so much Pablo!!
ill just need to check if it's activated or not, if it shows nothing it means i need to install, righ

Correct.

After that, i'm in doubt if it's a good idea for me to install Fail2ban and DenyHosts, as said at the end of the post on How to install Ubuntu. I'm thinking that they may be good, because all security is welcome, or am i wrong in this??

Extra security measures is never a bad idea (unless they are redundant or drastically slow down your server). I recommend installing Fail2ban as it supports more programs/services than DenyHosts.

After that i will set the FTP stuff using that link you posted and then set SSH keys to connect with putty.

I advise against installing an FTP server. Use SFTP instead: https://www.digitalocean.com/community/articles/how-to-use-filezilla-to-transfer-and-manage-files-securely-on-your-vps
by Pablo Carranza
This article will teach you how to use Filezilla to transfer and manage files securely on your VPS.
Thank you Kamal! I'll go to SFTP!!

To install phpMyAdmin, Is it better to install it before Wordpress, or after Wordpress (with the wordpress tables already in the server)??
To install phpMyAdmin, Is it better to install it before Wordpress, or after Wordpress (with the wordpress tables already in the server)??

Doesn't really matter. Works the same either way.
Hello guys!! Im back again!

Thank you very much for your isntructions, i'm creating anew droplet now following step by step all of the instructions of this thread!!

But now i've got more questions, hehe:

1. Should i add a Swap on ubuntu?? I mean, for me that will use Wordpress blog with high traffic.

2. Memcache, should i use it too?? People here say that it can speed up my site, but i will already use varnish, nginx, W3Total cache plugin, and maybe CloudFlare. Should i add Memcache as well?

3. What abou FastCGI on php?? Would you guys recommend it?

4. APC on PHP, should i install it even with all those cache stuff??

5. Is it recommended for me to make a CDN after all? Or stick with CloudFlare?

6. What is the best tool for monitoring the server status, like ram, cpu usage, etc? Atop? Munin? Cacti?

Thanks so much guys!! I know its a lot of qestions, but i'm intending to make this thread al my own walkthrough for my perfect droplet haha!

Thanks guys!!
1. Should i add a Swap on ubuntu?? I mean, for me that will use Wordpress blog with high traffic.

Yes, but make sure you set the swappiness level to 0:
echo vm.swappiness=0 | sudo tee -a /etc/sysctl.conf

sysctl -p


2. Memcache, should i use it too?? People here say that it can speed up my site, but i will already use varnish, nginx, W3Total cache plugin, and maybe CloudFlare. Should i add Memcache as well?

It's recommended that you use it since it's an in-memory cache which will speed things up. But you can't just "use" it, your app (Wordpress in this case) needs to support and use memcached, I believe there are plenty of plugins that do this.

3. What abou FastCGI on php?? Would you guys recommend it?

If you are going to use nginx, you will have to use fastcgi. FastCGI is faster even if you use Apache so I recommend going with it.

4. APC on PHP, should i install it even with all those cache stuff??

Yes, I recommend installing an op-cache extension such as APC.

5. Is it recommended for me to make a CDN after all? Or stick with CloudFlare?

Depends. Cloudflare is usually enough.
Have another answer? Share your knowledge.