3

I'm currently looking into migrating a few sites from my shared cpanel hosting to a VPS. Got to the point where I want to do more and have been learning about some system admin stuff through my placement/work.

Firstly, what are the essential things I should know? I understand how to set up an apache config, can probably work out how to set up email accounts and the like, however I'm sure there is much more that I haven't been shown, as I'm a programmer and not a sys admin.

I currently host a number of wordpress sites, a few static sites and a zen cart (shudders), and will be porting all of them including email accounts over to a new VPS.

If it helps, I'm currently with Hostgator shared hosting, and planning to move to Thrus VPS (Thrust VPS Site) on their basic VPS OpenVZ plan. They do have a cpanel option, however it's A LOT more expensive. Could I for example use cpanel to import everything, then turn it off and do everything terminal side? I know little about how cpanel actually does its job.

Further, their three *nix hosting packages are either OpenVZ, Xen PV or Xen HVM, and to be totally honest, even though I've researched into each of these, I'm not completely sure which one I would want and why, although I suspect OpenVZ.

2
  • 2
    You should think about going back through your past questions and accepting answers where appropriate.
    – EEAA
    Mar 20, 2011 at 18:41
  • fair enough. Certainly you should only accept if appropriate. We get a lot of new users coming through here that don't realize accepting is an integral part of community participation.
    – EEAA
    Mar 20, 2011 at 21:00

2 Answers 2

1

It's impossible to predict everything you'll need to know of course, but here's a quick checklist, assuming you have not had much experience with modern linux distros.


  • Choose what distro you want your server to run. Debian derivative, redhat derivative or something else?

  • Get SSH figured out so you can get into your server.

  • Get your distro's package management tools figured out so you can install stuff.

  • Install the stuff you need through your package manager... for example apache, php, mysql.

  • Configure the stuff you installed. Realize you need more modules for apache and php. Install them.

  • Learn how to (re)start system services. Restart apache now that you added a bunch of apache and php modules you needed and reconfigured it.

  • Learn how to set up virtual hosts (vhosts) on apache.


Amazon's AWS service is a good way to set up virtual machines quickly and test stuff out without too much trouble, and it scales into one of the nicest hosting solutions I've ever seen. You might consider it before looking at some of the other hosting options.

These guys are good too: http://www.gplhost.com/ ... particularly if you're looking for something less corporate or want to be sure real people are behind the service. It's a small outfit with only a handful of employees but they somehow manage to have offices worldwide and answer the phone at 3:00 AM when we call them with stupid questions.

3
  • Thanks for the info. I've decided on the OS, Ubuntu LTS. Can probably set up the SSH ok. I've used a package manager a few times, so I'll have to work out what I need I guess. I know how to restart apache =] Know how to set up vhost files for apache too! woo! I expect the main problem will be knowing what modules I will need and setting up and configuring email. Mar 20, 2011 at 18:30
  • @Relequestual - unless you're a glutton for punishment, just outsource your email to Google or the like. They'll host email on their infrastructure, using your domain(s), for up to 50 users for free, and will be able to do it with far more uptime, features, and less heartache than you'll ever be able to if you go it alone.
    – EEAA
    Mar 20, 2011 at 18:40
  • @ErikA , Thankyou. I already have one domain set up with google apps, would have to migrate the others, which isn't a problem really I guess. Probably, as you say, a LOT easier than my own system. I will be trying to avoid said punishment as much as possible! =p Mar 20, 2011 at 19:02
1

cpainl creates a compressed archive for individual accounts. To restore/import a domain/account to a non-cpanel system, decompress (uncompress?) the archive and take a look at the file structure therein:

total 96K
drwx------.  2 ilmostro    6 Aug 21 03:02 bandwidth
drwx------.  2 ilmostro    6 Aug 21 03:02 bandwidth_db
drwx------.  2 ilmostro    6 Aug 21 03:02 counters
drwx------.  2 ilmostro   19 Aug 21 03:02 cp
drwx------.  2 ilmostro    6 Aug 21 03:02 cron
drwx------.  2 ilmostro   26 Aug 21 03:02 dnszones
drwx------.  4 ilmostro   33 Aug 21 03:02 domainkeys
drwx--x--x. 19 ilmostro 4.0K Aug 21 03:02 homedir
drwx------.  2 ilmostro    6 Aug 21 03:02 httpfiles
drwx------.  2 ilmostro   24 Aug 21 03:02 ips
drwx------.  2 ilmostro    6 Aug 21 03:02 locale
drwx------.  2 ilmostro   99 Aug 21 03:02 logs
drwx------.  2 ilmostro   93 Aug 21 03:02 meta
drwx------.  2 ilmostro    6 Aug 21 03:02 mm
drwx------.  4 ilmostro   27 Aug 21 03:02 mma
drwx------.  2 ilmostro    6 Aug 21 03:02 mms
drwx------.  2 ilmostro 4.0K Aug 21 03:02 mysql
drwx------.  2 ilmostro   67 Aug 21 03:02 mysql-timestamps
drwx------.  2 ilmostro    6 Aug 21 03:02 psql
drwx------.  2 ilmostro   22 Aug 21 03:02 resellerconfig
drwx------.  2 ilmostro    6 Aug 21 03:02 resellerfeatures
drwx------.  2 ilmostro    6 Aug 21 03:02 resellerpackages
drwx------.  2 ilmostro    6 Aug 21 03:02 ssl
drwx------.  2 ilmostro 4.0K Aug 21 03:02 sslcerts
drwx------.  2 ilmostro 4.0K Aug 21 03:02 sslkeys
drwx------.  2 ilmostro    6 Aug 21 03:02 suspended
drwx------.  2 ilmostro    6 Aug 21 03:02 suspendinfo
drwxr-xr-x.  2 ilmostro    6 Aug 21 03:02 userconfig
drwx------.  2 ilmostro   96 Aug 21 03:02 userdata
drwx------.  2 ilmostro   47 Aug 21 03:02 va
drwx------.  2 ilmostro   47 Aug 21 03:02 vad
drwx------.  2 ilmostro   47 Aug 21 03:02 vf
-rw-------.  1 ilmostro    0 Aug 21 03:02 addons
-rw-------.  1 ilmostro  41K Aug 21 03:02 bandwidth_db.json
-rw-------.  1 ilmostro    0 Aug 21 03:02 digestshadow
-rw-r--r--.  1 ilmostro    0 Aug 21 03:02 has_sslstorage
-rw-------.  1 ilmostro   13 Aug 21 03:02 homedir_paths
-rw-------.  1 ilmostro 1.5K Aug 30 06:09 mysql.sql
-rw-------.  1 ilmostro    0 Aug 21 03:02 nobodyfiles
-rw-------.  1 ilmostro    0 Aug 21 03:02 pds
-rw-r-----.  1 ilmostro  350 Apr 20 03:28 proftpdpasswd
-rw-------.  1 ilmostro    1 Aug 21 03:02 quota
-rw-------.  1 ilmostro   18 Aug 21 03:02 sds
-rw-------.  1 ilmostro   48 Aug 21 03:02 sds2
-rw-------.  1 ilmostro  106 Aug 21 03:02 shadow
-rw-------.  1 ilmostro   31 Aug 21 03:02 shell
-rw-------.  1 ilmostro    0 Aug 21 03:02 ssldomain
-rw-r--r--.  1 ilmostro   39 Aug 21 03:02 version

For the most part, a lot of the directories and/or files can be ignored, unless you want to import everything; i.e. cron, mail, bandwidth usage, etc.
Arguably, the main items, in most scenarios, pertain to the database, dns, and apache. Therefore, focus should be on the following files/folders:

drwx------.  2   26 Aug 21 03:02 dnszones
drwx------.  4   33 Aug 21 03:02 domainkeys
drwx--x--x. 19 4.0K Aug 21 03:02 homedir
drwx------.  2 4.0K Aug 21 03:02 mysql
drwx------.  2 4.0K Aug 21 03:02 sslcerts
drwx------.  2 4.0K Aug 21 03:02 sslkeys
drwx------.  2   96 Aug 21 03:02 userdata
-rw-------.  1 1.5K Aug 30 06:09 mysql.sql
-rw-------.  1   18 Aug 21 03:02 sds
-rw-------.  1   48 Aug 21 03:02 sds2

The userdata directory made it in there because it has some useful reference items for the configuration; similar reasons for the sds and sds2 files.


Make any necessary changes to the files, paying attention to the old IPs in particular!

Database

Then create the specific database. Repeat for additional databases, depending on the domains, files, databases. dbname.create file also creates the necessary users and give them the necessary privileges on the databases.

# mysql < mysql/yourdomain_database.create

Import the database like so:

# mysql yourdomain_database < mysql/yourdomain_database.sql

DNS

# cp -v dnszones/*.db /var/named/

Copying over the DNS zone files to your dns server, if applicable. Make sure to adjust the necessary DNS server configuration to include the zone files; e.g./etc/named.conf.

apache

Then, focus on the remaining stuff related to apache, which will be located in homedir/public_html/ (though, it may be directly in /homedir/ in recent cpanel versions). The following WordPress installation, with a folder to a subdomain, can be used as an example:

homedir/public_html/
├── cgi-bin
├── configurations.json
├── css
├── font-awesome
├── fonts
├── img
├── index.php
├── js
├── LICENSE
├── license.txt
├── subdomain.yourdomainname.com
├── readme.html
├── sitemap.xml
├── strac-yourdomainname.com-phpindex
├── test.php
├── wp-activate.php
├── wp-admin
├── wp-blog-header.php
├── wp-comments-post.php
├── wp-config.php
├── wp-content
├── wp-cron.php
├── wp-includes
├── wp-links-opml.php
├── wp-load.php
├── wp-login.php
├── wp-mail.php
├── wp-settings.php
├── wp-signup.php
├── wp-trackback.php
└── xmlrpc.php

Copy the content to the DocumentRoot and update your apache config files with any VirtualHost options:

cp -r homedir/public_html/* /var/www/html/

vim /etc/httpd/httpd.conf

You might have to make the necessary changes to the PHP, apache, and/or mysql versions and configuration as well. Try to ensure the versions and options are as close to that of the cpainl server as possible.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .