Virtualmin for cPanel users
Virtualmin for cPanel Users
cPanel is an old, but still very popular, webserver administration tool. Since many new Virtualmin users have only experienced system administration through cPanel, they may find some terms and concepts in Virtualmin new or confusing. This short guide will attempt to point out a few of the gotchas that we've found most commonly trip up former cPanel users trying out Virtualmin for the first time.
Domains vs. Virtual Servers
cPanel refers to accounts as "Domains", while Virtualmin uses the term "Virtual Servers". cPanel also provides numerous types of domains, like "sub-domains", "parked domains", and "add-on domains". Each of these types of accounts can be replicated in Virtualmin, of course, but we think of them in different terms and the way they are created is moderately different. Virtualmin creates them with fewer steps, in most cases, and with more flexibility in all cases, but if you've only experienced cPanel it may be intimidating at first.
Creating a "Sub-domain"
cPanel has a type of domain account called a "sub-domain", which creates a new virtual host that only provides web service and puts the content into a subdirectory of the document root of the parent domain.
In Virtualmin, to create a "sub-server" that uses a sub-domain name, select the virtual server account that you would like to own the domain (usually the one that has the parent domain name, but it doesn't have to be) in the Virtualmin left-hand menu, and click "Create Virtual Server". On the creation form, click the "Sub-server" link in the "New virtual server type:" menu at the top of the page.
Then fill in the form, with the new name and description, and click "Create Server". You can also select a different Server Template, include initial website content either using our templates based site builder, or just by typing in some initial text in the text field (you can use the website creator at any time after creation of the domain, so you don't have to do it right now).
Sub-server data is stored in the domains directory of the parent server home directory. So, if creating a new sub-server named example.webdomain.com the website document root would be /home/webdomain/domains/example/public_html.
Sub-servers in Virtualmin are more advanced than cPanel sub-domains, in numerous ways. They can have their own PHP configuration and execution mode (mod_php, suexec+mod_fcgid, or suexec+CGI), their own logs directory and logging options, and even their own mailboxes (if desired). But, they can also be used in very simple ways; there's no need to take advantage of the greater flexibility if you don't need it.
Creating a "Parked Domain"
Parked domains in cPanel are domains that point to, or are aliases of existing domains. Virtualmin calls these by their technically accurate term, alias. This is the term used by Apache and its documentation, as well as most other web servers.
To create an alias server in Virtualmin, select the virtual server you'd like to alias, or point to, in the dropdown list in the left-hand Virtualmin menu and click "Create Virtual Server". On the resulting form, click the "Alias of..." link in the New virtual server type: at the top of the page.
Fill in the form with domain name to alias to the selected virtual server, and a description, and click Create Server.
Virtualmin alias servers are more advanced than cPanel "parked domains" because Virtualmin alias servers can accept mail for the domain (automatically mapping users to those of existing users within the parent).
Migrating Existing cPanel Domains to Virtualmin
Virtualmin can import accounts from a cPanel backup file, including all mailboxes, databases, and web data. This can make the migration process much faster and easier, though there may still be some aspects of the account that cannot be directly translated to Virtualmin policies and practices. For example, Virtualmin features far more advanced mechanisms for executing PHP in different ways in the same Apache, which cannot be directly mapped from the old-style cPanel suPHP or mod_php configurations. Generally, migrations will result in working websites, but some Virtualmin features may need to be enabled (with care and testing) in order to take full advantage of the advanced capabilities of Virtualmin.
Making the cPanel Backup
To migrate all services from a cPanel server to a Virtualmin server, you'll need a full backup. To generate a full backup in cPanel, click on the Backup icon, and then click the Generate/Download a Full Backup link. Fill in the form, and click Generate Backup. Wait until you receive confirmation that the backup has completed, and then copy the file to your Virtualmin server.
Copying the cPanel Backup to Your Virtualmin Server
If your backup is small, you can use the cPanel download full backup page to download it to your PC right in your browser, and you can then use the upload form in Vitualmin.
If your backup is larger than a few megabytes, you'll want to copy the file using a reliable transfer mechanism, like SCP. All Linux systems have scp built in, and so can easily be used to copy the file to your new Virtualmin server.
An example of scp usage:
scp backup.tar.gz firstname.lastname@example.org:/root
Which will then prompt for your root password on the destination server.
Using the Migration Form
Once you have the backup available on the Virtualmin server (or on your local PC if it is small enough), you can then browse to the Migrate Virtual Server form by clicking on the Add Virtual Servers menu to expand it, and then clicking the Migrate Virtual Server link.
Fill in the form, selecting either to upload your backup file, or select the path to the file on your server.
Select a Backup file type of cPanel
Fill in the Domain name to migrate. This should match the domain you've backed up on the cPanel server.
Fill in Username for domain. This can be any valid username, but for ease of use, you may wish to use the same name used under cPanel. Virtualmin has fewer restrictions on usernames than cPanel (it allows long usernames for example, so I could name our user virtualmin rather than virtualm).
Choose a Password for administrator.
The remaining options can be left to their defaults, but it may be useful to you to change one or more of them, depending on features you'd like to use. If you will be using SSL or anonymous FTP virtual hosting, you will need to assign a new IP address just for this domain--SSL and FTP virtual hosting does not support name-based virtual servers. Realistically, anonymous FTP is almost never needed, but SSL is often required.
If you will be creating many servers via this mechanism, and have specific requirements for quotas, enabled features, etc. you may find that creating a new Server Template just for imported domains is useful and speeds up the task of getting cPanel users up and running under Virtualmin.
Both cPanel and Virtualmin allow creation of MySQL databases, but Virtualmin simplifies the common use case, while perhaps making less common cases less obvious. In Virtualmin, if MySQL is enabled for a virtual server, a single user and database is automatically created, both with the same name as the administration user of the virtual server ("virtualmin", for example, for a domain named "virtualmin.com"). This database will be the default for Install Scripts that require a database. If the script in question is incapable of using a prefix or suffix for database table names, this may restrict which applications can be installed into the default database.
If the virtual server owner has been granted database creation privileges, the Install Scripts form will include an option to create a new database for scripts. This is generally the recommended way to deal with running more than one script within a virtual server, particularly with applications that don't support table prefixes or suffixes to insure uniqueness.