VPS Server Space/Disk Quota

The term “server space” refers to the amount of disk space that is available on your server’s hard disk drive. This space varies according to server type, hosting plan and possibly by additional services that are set up and available on your Liquid Web account.

Some of the largest hard disk drives on the market now can hold up to 100TB of data. To better visualize this, 100 terabytes of data is approximately equivalent to:

  • 42,000,000,000 trillion single-spaced typewritten pages
  • 8,000,000 phone books
  • 160,000 regular compact discs
  • 20,000 DVDs
  • 200 average-sized hard disks (500GB)
  • 80 human brains (the capacity of a human being’s functional memory is estimated to be 1.25 terabytes by futurist Raymond Kurzweil in The Singularity Is Near)

Your disk space can hold many types of data including file types like HTML, TXT, CSS, PHP, PDF, JPG, MP3, MP4, compressed (tar.gz) backups, SQL databases and more. These files are in specific folders which are defined by the applications configuration files or locations you determine.

How do I locate the folders containing a particular set of data?

The location of a file depends primarily on the type of file. On a Linux server, your typical cPanel account is set up under the /home/username folder, and your cPanel account username specifies the username folder. This folder is sometimes called the top-level or root folder of your cPanel account. This root folder is not publicly accessible on the web but, contains folders which are accessible via a web browser. The root folder holds other cPanel specific system folders that use a variety of functions.

As you can see, when uploading files to your account, you’ll likely want them to be in public_html to be accessible on the web. Uploading an image.jpg file to the public_html folder makes it available at domain.com/image.jpg. Additionally, if you create a folder inside of the public_html directory and add the same image there, it would be accessible at yourdomain.com/foldername/image.jpg.

To see the location of a file, you have several options;

  1. Log into your cPanel and open the File Manager under the Files section
    cPanel >> Home >> Files >> File Manager’ here you can view all of the files and folders in your account’s root directory.cPanel File Manager
  2. When a cPanel account is initially set up, it also creates the main FTP user. You can use the servers FTP functionality to access folders from a remote location to view the file listings. Several software titles like Filezilla, Cyberduck, and WinSCP are available for this type of connection.
  3. Lastly, you can connect to the server via SSH and get access to folders/files on the server.

How do I see how much space I’m using?

Disk Usage Graph

Let’s start by reviewing a few command line examples; mainly the “du” and “df” commands.

Note
The ‘du’ command sums up the total space of files that exist on the filesystem, while the ‘df’ command shows blocks available in the file system.

The ‘df’ command (abbreviation for disk free) simply lists the space used per partition:

df Command Output

The ‘du’ command (abbreviation for disk usage) reports the sizes of directories including all of their contents and the sizes of individual files:

du Command Output

Note
There are times when the ‘du’ and ‘df’ commands show different usage amounts. Previously removed files can cause this discrepancy from a running process holding open that file. Open processes cause the ‘df’ command to report that space as still being used. The solution to this is to restart the service to close any open process.

You can also use cPanel to determine the amount of space used and where its located. If you log in to cPanel, you would need to go to cPanel >> Home >> Files >> Disk Usage to get graphical of your disk usage.

cPanel Disk Usage

Lastly, to view your server’s disk usage in your Manage account server resource graph

  1. Log into your Manage portal.
  2. Navigate to the Servers section and then click on the Plus sign (+) next to the server of focus.
  3. Click on the Dashboard button and click the link next to the Disk Usage text as seen below

graphical statistics

This view provides a graphical representation of your disk space and the used amount.

How do I prevent disk space overages?

Disk space overages can result in lost emails, backups or even websites or the server going down! Just like your car, your server requires regular server maintenance. Attention to server maintenance reduces lost data. One way to prevent disk space overages is to use cPanel’s built-in tools.

cPanel possess the ability to send “Disk Quota Warning”  emails that denote when your server is using too much space. They contain specific locations to check, and the space used. The settings for these emails notifications are in WHM (Web Hosting Manager) under the Home »Server Configuration »Tweak Settings .

Email Notifications AreaOther areas of server maintenance to check on regularly include:

  • Pruning backups
  • Logs are rotating correctly (including Domlogs, Apache2, MySql, and Chkservd)
  • Regularly archiving email
  • Using the /home directory for large user accounts

What are the dangers of being too close to Disk Quota?

When a server gets close to or is at its max disk space capacity, strange errors and problems can manifest themselves in many ways including:

  • Services (like MySQL or Apache) can error out or stop
  • Websites can become very sluggish
  • The servers overall responsiveness can become slower
  • The server may exhibit a high load
  • You may see degraded disk performance
  • The server may display an increase in I/O wait
  • The server may demonstrate an increase in CPU usage
  • The file system can go into “read-only” mode
  • The server can run out of inodes
  • Files can become corrupted
  • Decreased swap space may occur causing issues

So what do I do if I’m running out of space?

As Benjamin Franklin stated, “By failing to prepare, you are preparing to fail.” In light of this knowledge, taking steps in advance to prevent these issues is always the best course of action. Directly monitoring your server disk space on a weekly or monthly basis prevents most space issues from turning into actual problems.

If you have already reached the point where immediate action needs to be taken to bring a server back in line with normal space expectations, you have several options. Using the “du” and “df” commands are your primary weapons in tracking down used server space.

The primary steps needed are:

    1. Log into your server
    2. Run a df -h command to locate which partitions are using the most spacedf Command Output
    3. Change directories into the affected folders using the most space.
    4. Run the following command:

du-sk Command Output(This is an advanced du command that sorts the contents of a directory by size. Use this to drill down into a folder to see used space.)

  1. Move files (to a backup drive or folder) or, remove the files that are no longer needed using the ‘rm’ command.
  2. Repeat steps 2 through 6 as needed until reaching desired space level.

Final Thoughts

Over time, any operating system can become overcrowded with addition and removal of programs or accounts. Actively monitoring your servers disk space is the most effective method to prevent server space issues. If you do run into issues, using the du, df command line tools or, using the graphical interface in your account allows you to view files as needed. As always, if you have further thoughts or questions about this topic, please contact our Linux Support department for more information.

 

Setting up packages in WHM to use in WHMCS

Using Packages in WHM

Any new reseller’s first move when integrating WHMCS is to ensure that the products they are provisioning have the correct resources and limitations for their cPanel packages.

This article will walk you through the steps of setting up packages in WHM so you can use WHMCS.

Creating a package in WHM

  1. Log in to your server’s WHM as the root user (be sure this is the connected server to WHMCS that you intend to sell shared hosting on)
  2. Navigate to Add a Package
  3. Select Package Name – This will be used to identify within WHMCS
  4. Create Resource Limitations
    • Disk Quota (MB)
    • Monthly Bandwidth (MB)
    • Max FTP Accounts
    • Max Email Accounts
    • Max Email Lists
    • Max Databases
    • Max Sub Domains
    • Max Parked Domains
    • Max Addon Domains
    • Maximum Hourly Email by Domain Relayed
    • Maximum percentage of failed or deferred messaged a domain may send per hour

  5. Settings

    This is where you can specify if you want the package to have a dedicated IP, offer shell access (SSH), cPanel access (CGI), or Digest Authentication.
    Typically you can leave the Settings as default, but if you need to make changes, this is where you can do it.

WHMCS

Once you create a package in WHM, you will need to create a product in WHMCS and tie the two together in order to resell cPanel accounts with automated provisioning.

1.  Log in to your WHMCS as an Admin User

2. Navigate to Setup -> Products/Services -> Products/Services

3. As a new installation, you will first need to click “Create a New Group”

  • Set your Product Group Name (for example, Shared Hosting)
  • Set the Product Group Headline (this is customer facing, so something specific to the group of products)
  • Set the Product Group Tagline
  • Select your available Payment Gateways
  • Select the Order Form Template, if you don’t want the System Default
  • You have the option of making a product group hidden, the functionality of hidden products/groups will be covered in another article.
  • Save Changes

4. Now select “Create a New Product”

  • Select the product type, for this example we will be selecting “Hosting Account” as it will be for the shared product you created the package for
  • Choose your newly created Product Group
  • Set the Product Name and hit continue (note: the product name does NOT have to match the package name, but it can make tracking easier in the long run)
  • Details Tab

    • Enter the Product Description – Here you can enter the description that the customer will see, for example, if it is a shared hosting package with 5GB of disk, 100GB of bandwidth, etc. you can list the features of this product)
    • Welcome Email – This will give you a drop down of pre-existing email templates, for more on customizing WHMCS email templates, please see that article.
    • Require Domain – This means the client must have a domain for the package (You can offer domain registration for new clients, but this box just ensures that they enter a fully qualified domain name to proceed).
    • Stock Control – Set this if you only want to sell X number of this product
    • Apply Tax – If taxes apply, select this box
    • Featured – This will show the product more prominently in certain order form templates.
    • Hidden – See the benefits of hidden groups/products.
    • Retired – Often used in editing old products).
    • Pricing Tab –
    • Payment Type – Is this a free product (trial), one time bill, or recurring billing.
    • Allow Multiple Quantities – This allows the customer to order more than 1 of this package.
    • Recurring Cycles Limit – 0 is unlimited which will be the case for most hosting, change this if you want to limit how many cycles they can keep the product.
    • Auto Terminate/Fixed Term – 0 is disabled, this can be used to auto terminate accounts after a certain date, I’d suggest avoiding this as it could potentially delete/destroy user data, better to have a fixed limit and contact the customer prior to termination as it could potentially save a client.
    • Termination Email – This would need to be configured only if you use the previous option.
    • The next three options are around billing date modifications
      • Prorata Billing: Select this if you want to have universal billing dates.
      • Prorata Date: This would be the day of the month that all billing would exist for this product.
      • Charge Next Month: This will be the “cutoff” date for when the following month will be included in the original invoice.
  • Module Settings – This assumes you have a server already created, if you do not see the documentation on connecting your first server.

    • Module Name: Select cPanel from the drop down
    • Server Group: If you have a specific group for this product, select it here.
    • WHM Package Name: Select the correct package name to match the product.

  • Custom Fields

    • These fields allow for you to collect additional information from your client, such as “How did you hear about us?” or “Are you interested in our newsletter?”
    • You can add any number of additional custom fields and you can make them public facing, or internal.
    • Some modules and addons will require a custom field to be set up and filled out to successfully run.
  • Configurable Options

    • This will remain blank unless you have something that will generate the configurable options. For example, the Liquid Web Plugin. (https://github.com/liquidweb/LiquidWeb-WHMCS-Plugin) can generate configurable options based around what is available via our API.
  • Upgrades

    • Package Upgrades: This box will show other products within WHMCS and you can select which you would like the customer to be able to upgrade to/from. For example, if you have a Bronze Shared Plan at 5GB of disk space and you would like to offer an upgrade path to the Silver Shared Plan at 10GB of disk space, you’d select it here.
    • Configurable Options: Selectable if you have configurable options generated and set up for the product list.
    • Upgrade Email: You can set an email in Email Templates if you would like them to receive something during the process.
  • Free Domain

    • Free Domain: You can select if you would like it to only be free for registration/transfer (one time), or if you would like it to remain free as long as they maintain the product.
    • Free Domain Payment Terms: You can select if you only want to offer free domain registrations for specific payment terms. For example, Annual payment terms for hosting are a fairly common requirement to receive the free domain in this case since the domain registration is annual.
  • Other

    • Custom Affiliate Payout:
      • Default – Uses the default set up in the system.
      • Percentage – Pays a percentage of their referral.
      • Fixed Amount – you set the amount they would earn for each product
      • No Commission – they can track referrals but no commission is paid, this is helpful for if you have a program with incentives for referrals aside from money.
    • Affiliate Pay Amount: Enter the amount you would like the affiliate to get paid for referring this product.
    • Subdomain Options: Allowing specific subdomains to be used if you want to specify.
    • Associated Downloads: You can set download files that are only available to clients who have this specific product.
    • Overages Billing: If you want to allow for a client to use more than the allocated amount and charge them for it you set it here. Just to clarify though, the package we set up in WHM previously will determine the true “hard limits” if you set up overage billing with soft limits, the client will still see the full “hard limit” in cPanel, there is no way to “hide” that.
  • Links

    • Direct Shopping Cart Link: This is a direct link you can provide customers (or code into your site) that will link directly to the “checkout” page with the product in the cart.
    • Direct Shopping Cart Link Specifying Template: If you’re running a specific promotion in which you want to utilize a specific shopping cart template, you can use that here
    • Direct Shopping Cart Link Including Domain: If you were to send a direct “quote link” and you want to pre-fill the domain for the client you’re sending it to, you can use this:
      • Replace the “sld=whmcs” with “sld=clientdomain”
      • Replace the “tld=.com” with “tld=clientstld”
      • If the client is using .com, you can leave this the same. If they are using .net you would enter “tld=.net”
    • Product Group Cart Link: This can link to the full group, if you had multiple products in the same group type.
  • Hit Save Changes and your product setup is now complete! You can begin selling that shared product right away.

You can repeat this process by setting up a different package in WHM and then in the “Module Settings” section, you would select that package instead. Just be sure that you adjust the pricing and any options that you need for each product.

If you need to purchase a WHMCS or have further questions, please contact our support team via chat! Happy to help.

Featured Freeware: htop

Featured Freeware highlights some of the Liquid Web staff’s favorite free software. This can range from useful command line tools, open-source packges useful in web-development, or even multi-platform applications. This week we are covering a treasured favorite, htop.

Note: This post assumes you have a working knowledge of top. You can read our article on using top, if you are not familiar with the tool.

htop, or Hisham’s top, is an interactive process viewer for Unix systems. With htop you are provided the same functionality as top, however it provides some needed improvements. Most are in areas where top shows some of it’s age; for example, in htop you can scroll the list of processes vertically and horizontally to see all the process info.

Another benefit is that htop seems to start significantly faster, generally when using top there is a bit of a delay while the program loads up some initial data. So now that you know the basics of how htop differs from top, lets get to using it. First you’ll need to ensure it’s installed on the server and if not we’ll try to get it installed.
Continue reading “Featured Freeware: htop”