Dịch vụ seo 9.9/10 bởi 919 người bình chọn.

Part 4 – Setting Up Your First Site


In this final section you will be setting up the server so you can actually use it to start hosting and building your websites.
  • Compiling Apache and PHP
  • Creating a package
  • Creating an account for daily use
  • Logging into cPanel for the first time
Start by logging into WHM again as the root user. (If you had logged out after Initial Setup)
You should see a screen similar to this:
Scroll around; take a look at the options. Most of the things we will be doing in the next few steps will involve the extremely long menu on the left side of the screen. You may want to click "Collapse All" at the top of this menu and then expand only what you need at the time.

Compiling Apache and PHP

Your server has Apache and PHP installed by default but the versions are what were available in the CentOS repositories. If you would like newer version or need a custom setup, WHM makes it easy to compile Apache and PHP so they work well together.
Start by clicking "Easy Apache" link under the 'Software' heading. You may receive a message that recommends upgrading to the newest version of cPanel software. If you receive this message you can click the "Upgrade to Latest Version" link under the 'cPanel' heading. Once you have updated the software you can come back to the "Apache Update"
NOTE: We recommend using the "Stable" versions of cPanel. We cannot support issues that arise by using the "Edge" or "Current" versions of cPanel as they may contain bugs or unreleased features.
WHM provides some default configurations you can use and then customize each to meet your needs. You can save your custom configuration at the end of the process for later use. Click the Radio Button of the profile you would like to use then click "Start Customizing based on Profile".
From this point to can select the Apache and PHP major/minor versions as well as features you prefer to have complied in. Various warning will pop up as you select and deselect options. WHM will resolve dependencies for you, so you do not need to worry about manually installing anything with the package manager. Because Apache and PHP are compiled from source, this step will take some time to complete, usually between 30-40 minutes depending on the options selected.

Creating a Package

Packages allow you to set limits such as disk space, e-mail accounts, add-on domains, shell type and more which you can assign to one account or multiple accounts. You can create as many packages as you would like, but for now we are going to create what we will call the "master" package which you will use for setting up your "Daily Use" account.
WHM has a handy search box in the top left corner that make is much easier to wade through the long menu. Using the Find feature in the top left of the screen type "Add Packages" (no quotes) and the long list should shrink down to one option which will read "Add Packages". The search box is NOT case-sensitive.
NOTE: Don't forget to erase your text from the search box once you are done or things will seem to have disappeared!
Because this is the "master" package we do not want it to have any limits.
  • Enter a package name, "master_package", for example.
  • Under resources fill all text fields with "unlimited".
  • Leave the Settings box untouched (with possible exception of "Language")
  • Click the "Add" button

Creating an Account for Daily Use

It is not good practice to login as root for daily activities. Most things done as root cannot be undone – at least not easily.
This daily use account is to be the main account/website. Start by clicking "Create a New Account" under the Account Functions heading on the left side of the screen.
Enter the applicable information into the fields.
  • Domain is to be the main domain of your site, enter it into this field without the "www". In most cases this will be the same domain you used when signing up for your account.
  • Select a username and password and enter an e-mail address for the account.
  • Under "Package" select the name of the package you created in the previous step.
  • Leave the Settings box untouched. (with possible exception of "Language")
  • In the Reseller Settings box, click the "Make the account a Reseller" checkbox.
  • When you make the account a Reseller, another option will appear "Owns their account (They can modify their own account)". Check this box as well.
  • In the "DNS Settings" box, leave the boxes unchecked but make sure the name servers listed are the ones you setup in Part 2.
Click "Create" and the account creation screen will appear. If any errors occur you will be asked to go back and fix them. If it is successful you will see a screen with lots of big green checkmarks down the side.
Now that we have created this account, we need to adjust the privileges and start using it!
Under the "Resellers" heading on the left side menu, click "Reseller Center". You should see the account you just created listed under the "Reseller Modifications" box next to 'Select a Reseller'. Click the Lock icon titled "Edit Privileges/Nameservers"
Because this is to be your main account for daily use, we do not want to provide many limitations for this user. You can select what you would like but A2 Hosting recommends you click the "Add All" box above each set of Privileges EXCEPT the last one entitled "Root Access" Leave the name servers fields blank and click the "Save all Settings" button at the bottom.
You now have setup your Daily Use account which has WHM access to most functions you need on a daily basis and also setup a cPanel account for your domain.
By default, the URL's to login to cPanel and WHM are as follows:
cPanel – http:///cpanel OR https://:2083
WHM – http:///whm OR https://:2087

Other Areas of Interest

Before you log out as the root user you should take the time to configure a few other things in WHM. All of the following are optional but recommended.
  • In "Tweak Settings" option under "Server Configuration" you can enable/disable many useful options, mostly notably under "Redirection" option.

    ** Always redirect users to the ssl/tls ports when visiting /cpanel, /webmail, etc.

    Turning that option on will force SSL encryption when you try to enter WHM, cPanel, or Webmail. Remember, for security purposes and to prevent accidental mistakes, only use the root account for things you cannot do with your daily use account and always use https:// when logging into WHM or cPanel.
  • Under "Service Configuration" there is a 'Manage Service SSL Certificates' option. Here you can reset all the SSL certificates to match the hostname of your server. You will have to do one at a time. Just a precaution, resetting them will force you to log back in once or twice using the new SSL certificate.
  • Also under "Service Configuration" there is a 'PHP Configuration Editor' option. You can modify the php.ini file from this location. Please edit with caution and make a backup of your php.ini file before editing in case of mistakes.
After you are done familiarizing yourself with the options the root user has, you can logout as the root user and log back in as your "Daily" user. Most things will look the same, just a few potentially dangerous options removed that usually do not need to be accessed anyway.
In the daily user account you can create other cPanel accounts, create/edit packages, add accounts, edit DNS zone files and most other functions you need to manage the server.

Logging into cPanel for the first time

As you have seen WHM allows you to control your entire server and create accounts. cPanel allows you to control all the aspects of one site including the web site files, e-mail accounts, MySQL databases. cPanel includes video tutorials that can guide you through all of the different features.
By now, your DNS changes should have propagated and you can use the domain name from the daily use account you just setup.
Type, http://yourdomain.tld/cpanel (where yourdomain.tld is replaced by your domain name) and enter the same username and password you created for your daily use account. You should see a login window like the following:
If that doesn't resolve properly (yet) you can use your IP address to connect:
Type http://primaryIPaddress/cpanel
Once in logged into cPanel you can begin exploring all of the options.
That's it! Hopefully you now have a WHM/cPanel server setup and ready to start hosing your site.
This document is only intended to get you up and running with WHM/cPanel on your VPS. It is by no means an exhaustive resource for all that you can do.
For full documentation please visit the following URL: