Web Hosting – Site Management Questions
Site management support articles: if you have any questions about managing your website on 20i hosting, here's where to find answers.
How do I use the 20i Maintenance Mode tool?
When developing a site you may want to put up a maintenance page. You can use the 20i Maintenance Mode tool to do that. The maintenance page can be bypassed using a password, so only selected users can view the progress of the website's development. The tool is accessed directly from your My20i account.
To use the tool:
- Head to Manage Hosting > Options > Manage
- Select Maintenance Mode
Here you'll have two options: Configure (all domains) & Configure. If you want to set up Maintenance Mode for individual domains on the package, select Configure next to the domain in question. Choose Configure (all domains) to put all domains on the package behind a maintenance page.
Note: You can set your default maintenance page and maintenance login page templates via Default Website Pages.
To configure the maintenance page:
- Select Configure and check Enable Maintenance Mode
- You'll need to set a password to allow selected users to authenticate and bypass the maintenance page
- We'll set a default theme for your maintenance page, but you can configure your own by selecting Customise Page Templates
- Once done, select Save
Your selected domains will now be behind a maintenance page and visitors will be prompted for a password to view the site.
Note: If a wrong password is entered, you'll be redirected to the Maintenance Page template. To view the password field again you'll need to re-visit the URL. Once you've logged in, your session will be saved for one hour before automatically ending. At that point you'll need to reauthenticate with the password.
Is ionCube PHP Loader installed?
The ionCube Loader is a PHP extension often used by setups such as WHMCS - it decodes PHP scripts that have been encoded by the ionCube PHP Encoder. Without this, the scripts cannot be read and so the sites that use them cannot run, so it’s important to know what areas of our hosting have this included.
The availability of ionCube can differ between our different platforms and PHP versions.
Linux Web Hosting: ionCube Loader is available on our Linux platform for all currently supported PHP versions (but see note below).
WordPress Hosting: ionCube Loader is available on our WordPress platform for all available PHP versions that support it.
Note: ionCube Loader’s development skipped PHP 8.0 as outlined in their blog post here. As such, it is not available on this version, but is available on PHP 8.1 instead.
Windows Hosting: ionCube is not available on our Windows platform. If you are running PHP software and don't need any of the Windows specific-languages like ASP.NET we recommend using our Linux platform.
Managed Hosting: ionCube Loader is available on all supported PHP versions similar to our Linux hosting.
You can use the Platform Transfer feature inside My20i to automatically move between all of our hosting platforms.
How do I use the free 20i Website Malware Scanner?
One of the major problems with malware is its persistence. This is why 20i’s free Website Malware Scanner makes daily scans of all the sites within your hosting account. It uses a combination of commercial and in-house tools to provide reports detailing malicious content and its location within your site files.
When malware is located on a site, PHP mail is automatically disabled. We do this to preserve sender reputation across the platform and ensure that any sites that are compromised do not send large volumes of spam emails.
We run daily malware scans on all sites on our system – we will only scan files that the system has detected changes on. If no change has been detected, we won't run a new malware scan on these files.
As a Reseller, you can offer this service to your customers free of charge by simply adding it to your Package Types, so they can use this feature in StackCP.
1. Best practices when dealing with malware and infected files
- Check the Malware Report produced by the malware scanner to identify if there are any infected files
- Clean and remove the infected files from your webspace
- Identify any vulnerabilities within the site and secure them
Taking regular backups means that you'll always have a restore point if you do find your site has compromised files. You can do this in My20i or automate the process with Timeline Backups.
Checking the Malware Report
The Malware Scanner shows you a full list of sites that are currently infected within your account. If you’re a 20i Reseller, you can access this list by:
- Logging in to My20i
- Selecting Malware Report
- If any of your sites are currently infected, they will be listed here
The scanner shows details on the package where the infection has been found, the time of the last scan and the number of infected files. To show a more detailed report, select View Report. You will now see the full list of infected files on the site.
You can also access the Malware Scanner on a per-package basis:
- Log into My20i and head to your Manage Hosting area
- Select Options > Manage on the hosting package you wish to scan
- Under Security, select Malware Scan
From here, you can initiate a fresh scan for the site, view the scan history for the package and view a list of any flagged files that have been detected as potentially harmful.
Should the scan return clean without any issues, you’ll see the following:
If the scanner finds any potentially harmful files or signs of a malware infection, however, you’ll instead see the following:
Should any infected files be found on the package, we’ll also add a warning to the package itself to notify you of this.
Any files that are detected as malware will also show in the File Manager so that you can easily access and review the flagged files.
We also have a yellow ‘warning’ state which shows that the signatures found are unlikely to pose a high risk to the site. For example log files, SQL files and .zip backups files. Essentially, a yellow warning state is for information only and won’t impact the sending of mail.
You can ensure that you're notified of any newly-discovered malware by checking the Receive Daily Email Alerts? box. An email will be sent to your primary 20i email address when new malware is found. You can also add additional email accounts to receive malware alerts through your Account Preferences. You may wish to create a dedicated mailbox to receive malware alerts.
Cleaning and removing infected files
In most cases, the best way to resolve an issue with malicious content is to remove the compromised files and replace them with versions from a known clean download. That is, download the software again and replace just the files that have been infected from the initial install.
If the files are not needed, then you could also just delete the files completely.
Sometimes an infected file will just have the attackers script 'injected' in the first or last line of a specific file. Sometimes this can be very obvious, in which case you could look to simply remove the malicious script.
You should do this for all the files that have been found by the Malware Scanner.
Further actions you can take
Remove unnecessary or unused plugins and applications from the site. Doing this will not only reduce the number of potential vulnerabilities but also make general site 'housekeeping' simpler.
You should also make sure that any plugins you're using are always kept fully updated. Outdated software versions are much more likely to have security vulnerabilities - leading to compromised sites.
It may also be worthwhile to change passwords such as your database password and FTP password.
Rescanning the site
You can re-scan the site on demand. Once you believe you’ve removed the malware, head back to the Malware Scanner and select Scan again.
If all infected files are removed, then PHP mail will be re-enabled automatically and there will be no infected files displayed. The scanner will continue to take daily scans of all your websites to ensure you’re always aware of any sites that have been compromised.
Can you update the version of cURL on your webservers?
Occasionally, applications in your webspace may run checks to help ensure your website is secure. As part of these checks, the application reads the version number of various pieces of software on our servers. Sometimes, these version numbers are old and hence raise warnings. One of the most common examples for cURL is "You currently have version 7.19.7 of cURL installed. This version is known to have security issues. Please update to the latest cURL".
We understand how that could worry you! However, an update is not required and your site is still secure.
Our Linux Web Hosting/WordPress platforms run Redhat Enterprise Operating Systems, and Redhat use a process known as 'backporting' into slightly older, stable versions of software to ensure security and stability throughout the entire operating system. Put simply, while the version number may appear to be out of date, you can be assured any security fixes have been retrospectively applied to guarantee they remain secure.
To find out more about backporting, please see this article on Backporting Security Fixes on Redhat's website.
Hosting shortcuts: favourite and recent hosting packages
In this guide we’ll learn how about the recent packages list and how to ‘favourite’ packages. By using these features, you can save navigating to hosting package’s Service Overview page. Shortcuts from the My20i homepage are created.
You’ll find both lists on the My20i home page on the right-hand side. Once you have managed a few packages from the Manage Hosting page or favourited any, you’ll be able to see something like this:
Clicking on any of the domains will take you to the Service Overview page for that package.
To ‘favourite’ any packages, you’ll first need to manage the hosting package from the Manage Hosting page. Once on the Service Overview page you’ll see a star icon the top above the search bar:
Once you click the star icon it will turn blue. When you go back to the My20i homepage you’ll see it under the Favourite Packages list.
Utilising these features makes managing packages quicker and easier since you can do it in just one click. This will save time when you manage multiple hosting packages as a reseller or an agency.
Complete guide to the 20i File Manager
In this guide we’ll go through the features of the 20i File Manager to show how you can use it to manage the files within your hosting.
What is the file manager?
The file manager is a GUI that lets you manage the files in your control panel without the inconvenience of using FTP. You can quick and easy upload, move, create or delete files just to name a few of the actions you can take.
How to access the file manager
To access the File Manager, you’ll first need to Manage a hosting package and find the File Manager option, under Web Files.
Here you can see the files and directories within the root of the hosting package. To navigate into a folder, you need to double click: that will open the folder and show its content.
How to navigate the file manager
The Home button in the top left will take you back to the root of the hosting, making it easier to get back should you need to. The next icon to the right is Refresh which will refresh the current folder so you can make sure it is up to date with any changes you make. On the top right is a hamburger menu which hides a few more tools. When expanded it will look like this:
How to use the file manager:
All of these tools will help manage the files and these are explained below:
- Close – The X button will close the menu so these icons no longer show
- Cut – After selecting a file or folder you can click this to cut the file and allow you to paste it elsewhere while also removing it from its current location
- Copy – After selecting, this will allow you to copy a folder or file, then paste it elsewhere within the hosting package
- Paste – Allows you to add the cut/copied file or folder into the current folder you are in
- Clear Clipboard – Allows you to remove any cut/copied file or folder from the clipboard so it can’t be pasted, unless cut/copied again
- New File – Allows you to create a new file. This brings up a field where you can name the file and once named, to either Create or Create & Open the file.
- New Folder – Creates a new Folder. This brings up a field where you can name the folder and once named, to either Create or Create & Open the file.
- Upload – Drag and drop files from your local computer or select files from your computer to be uploaded to the hosting.
Once you have added something to upload, a list will appear at the bottom of the page. You can add multiple files to this list. Start the upload by clicking the upload button in the top right.
- Search – Search the hosting for either a file or folder by name. Once the search is complete you will have the option to go directly to where that file is located.
- Open in New Window – Opens the File Manager in a new window separate from your current browser.
- List view – Changes the view for File Manager to show the files and folders in a list going from top to bottom.
- Grid view - Changes the view for File Manager to show the files and folders in a grid format.
There are also other tools that show when right clicking (control + click on a Mac). The options differ depending if you select a file, folder or in empty space.
A few of the options are a repeat of the tools in the hamburger menu and serve as a context-based way to manage the content.
There are a few new features here that will be listed below:
- Code Editor/Rich Text Editor – When right clicking a file you have the option to edit within Code Editor or a Rich Text Editor. By default, you can also double click a file to edit it in the Code Editor.
- Delete – This will remove the file/folder you right clicked but will ask for confirmation to ensure this is correct before removing the data
- Download/Download as ZIP – Allows you to download a copy of a file/folder to your local device. If a folder is selected it will first create a zip of the folder and contents which will then download locally.
- Compress – Allows you to select a folder or multiple files to compress into a zip file. When selected this will open a field so you can name the zip file:
- Rename – Allows you to rename a file or folder. This will bring up a field where you can edit the name.
- Permissions – Allows you to check and edit the permissions that are set on the files or folder. This shows with the Read, Write and Execute permissions for you to select. These permissions are also shown in alphabetical and numerical notation.
If you make changes to these permissions, we’d recommend using our File Permissions Checker to ensure that access isn’t compromised.
- File Info/Folder Info – Shows information about a file or folder such as the name, path, size, permissions and modified date
- Get Disk Usage –You can right click either on a folder or empty space to get this option. Once selected, a disk usage report will open under the File Manager. This will take a moment to populate. Once complete, you can select the folder icon to see a report:
The report includes information on the largest files and folders with charts to show where the most space is being used:
Once closed, disk usage reports can be brought up again, using the menu in the bottom left, but will not persist after leaving the File Manager page.
Last of all there is a Malware scanner option on the bottom right. This is linked to our Malware Scanner. If any scan shows the package being infected, it will also show here.
Once selected, it will show a list of infected files and you’ll have the option to go directly to the folder where the files are located. The files will also show with an icon beside the name to show that these have been flagged as infected.
The My20i File Manager is a powerful and convenient way to manage your website files. It helps you manage your website files, and offers a powerful way to as well as being able to see more information about the content of your website.
Is ImageMagick supported?
ImageMagick - the open-source image tool - is supported. We currently run Version 7.1.1. The path to the ImageMagick binary is:
/usr/bin/convert
Alternatively, some scripts may require just the directory path, in which case please enter:
/usr/bin
If you have any questions or issues, please get in touch with Support through your My20i account.
Imagick PHP Extension
The Imagick PHP Extension is available for all customers using PHP version 7 and above.
Which PHP functions are disabled on your WordPress platform?
Our WordPress platform has been specifically designed to offer the best security, performance and reliability for WordPress.
As a result, we have specifically tuned firewall rules and layers of protection to help keep WordPress sites secure. As part of this protection, a small number of PHP functions have been disabled, as we've found that they're often used for malicious purposes.
The following functions are disabled for security reasons:
- exec
- opcache_get_configuration
- opcache_get_status
- passthru
- parse_ini_file
- popen
- proc_open
- shell_exec
- show_source
- system
In our experience, it's highly unlikely any of your plugins rely on any of the functions above. However, if you have a genuine use case for any of these functions, you can still host your WordPress site on our Linux platform.
If you're a 20i Reseller you can move packages between all 3 of our platforms easily. So for example, if you've setup a WordPress site on Linux and now wish to migrate to the WordPress platform, head to the Platform Transfer area in My20i to get started.
Temporary URLs: what are they and what are they used for?
When you create a hosting package, you're automatically given a temporary URL. Temporary URLs are useful for:
- Viewing a hosting package when you have used a domain reference
- Viewing a site that you’ve migrated, before you switch the DNS to 20i
- Showing your client their site before making it live on the actual domain name
You can view a package's temporary URL in StackCP:
You can also create your own customised temporary URL. Just follow our How to add a custom temorary URL guide.
Viewing a hosting package when you have used a domain reference
At 20i you can create a hosting package using a domain reference. This means that the hosting package won’t be connecting to a live domain name via DNS, so to view the files you’ve uploaded to the site you can use the temporary URL.
It will display the site as if it were live, except it will be on our temporary URL servers and the URL is something like http://example-co-uk.stackstaging.com.
Viewing a site that you’ve migrated, before you switch the DNS to 20i
When migrating a site to 20i, we recommend the following process:
- Migrate the site files, emails and databases to 20i
- Check the site works at 20i via the temporary URL
- Point the nameservers to 20i.
Step 2 is where the temporary URL comes in.
After you’ve copied all the site data in 20i, you may want to check that it works. Selecting the temporary URL will show you what the site will look like before you’ve pointed the nameservers to 20i’s.
Showing your client their site before making it live on the actual domain name
You may want to show your client a site that you’ve developed for them, without it being accessible on the live domain name. You can give your clients the URL: http://example-co-uk.stackstaging.com
Alternatively, you create a redirect from the domain name to the temporary URL. Read our guide on How to switch between temporary and live URL.
Frequently Asked Questions
Is the temporary URL the same as a Staging Environment?
No, the temporary URL is not the same as a staging environment as it will always reflect what will be on the live site, so it’s not possible to perform work and then “push” changes to the live domain name.
Does the temporary URL support SSL?
Temporary URLs fully support HTTPS:// connections by default – there’s no need to install an SSL on the site in order to connect to your temporary domain using https://. If you wish to use a customised temporary URL, the base domain will have to have an SSL installed on it for the connection to load securely, however.
Can I customise the temporary URL to my own brand?
Yes, you can create your own customised temporary URL. Just follow our How to add a custom temorary URL guide.
Are there any alternatives to using the temporary URL?
Yes, you can modify your hosts files. Your machine's local hosts file allows you to overide DNS for a particular domain or subdomain name. This is a great way to test the site ahead of changing real DNS: you're able to test the website at 20i while the rest of the internet continues to use DNS to point to the existing website.
This article shows you how to do this and modify your hosts file.
Does my website perform the same on the temporary URL servers?
No, temporary URL servers are reduced capacity as they're just for trialing a website on the platform before going live so they're not intended to benchmark performance.
Can I disable the temporary URL?
Whilst it's not possible to remove the temporary URL completely, if you set your website's home & site URL to the live domain name the temporary URL should redirect all traffic to the live site from the temporary URL.
How do I use the 20i File Permissions Checker?
The 20i File Permissions Checker allows you to easily view and fix file permission issues which don't match our recommended settings.
To use the File Permissions Checker:
- Login to My20i, head to Manage Hosting and select Manage on the hosting package you wish to check file permissions for.
- Select the File Permissions Checker icon.
- To begin a scan of the file permissions, select Scan Permissions.
- If any permissions are found to differ from our recommended settings, they will be presented to you in a list with the current permission level and our recommend level.
- You can either select all files and select Fix Selected or fix files individually by selecting Fix Permission.
How do I use hosting Package Labels?
Package labels can help organise your hosting packages. You can add any kind of label - it's just a text string that you decide. For example, if you wanted to categorise packages that are in development, you might apply a 'Development' tag to them.
Then, on the Manage Hosting page, you can filter by label to find them easily.
To add a hosting Package Label:
- Login to your My20i control panel.
- Head to Manage Hosting -> [select package].
- Down the right hand side, you’ll find the Package Labels section.
- To add a Label, type in the Label field (e.g. Testing) and select Add.
Now when you head back to the Manage Hosting page, you’ll see the drop-down menu allowing you to filter packages by Label (you may need to refresh the page if you've used the 'back' button).
Also, by clicking on a Label you can select all packages with that Label applied.
Here are some examples of Labels you may use:
- Testing
- New Website
- In Development
- Ready for Launch
- Awaiting Client Approval
- Subject to Change
- On Hold
- High Priority
- Low Priority
- Rework
- Personal
- Requires Review
How do I set up a cron job?
Cron jobs (also referred to as scheduled tasks), are an important tool for hosting websites looking to incorporate automation into their setups.
When used correctly, websites can automatically check for updates, send out emails, take backups and much more, so it’s worth knowing how to incorporate these through 20i’s hosting.
What is a Cron Job?
A cron job refers to a Linux command that is scheduled to run at a specific time – this command may run a file with a script in it, or utilise a command-line interface (CLI) such as WordPress’s WP CLI to run a specific function once or multiple times per day without user input.
Some setups, such as WHMCS for Reseller Hosting, have their own cron files that run key functions at specific points during the day, such as emailing out reminders to customers and checking domain renewal dates are in sync.
Most cron jobs consist of two key parts – the command, and the interval the command runs at.
How can I set up a cron job in My20i?
You can set up a cron job or 'scheduled task' in the Scheduled Tasks section of your hosting packages control panel.
Manage Hosting -> Manage -> Scheduled Tasks
These are commands or jobs that are set to run regularly. They can be set to run at intervals of minutes, or the same time every hour, day or month.
On the Scheduled Tasks page there are three things to consider:
1. What command you are wanting to run?
This is usually something like a WGET to a certain domain name or a PHP script. If you want to run a particular file such as WordPress's cron you'll need to use the correct version of PHP for the website. To select a particular version of PHP to run the command you use the commands to the right of the screen.
2. How often you need your cron to run?
This is selected from the drop-down boxes under where you enter the command. You can either use the first box to run it every 5, 10, 15 minutes or you can be more specific and select particular minutes in the hour, hours in the day or days in the month for the cron to run.
3. Would you would like to have emails sent to a specified address when a cron is run?
An email will only be sent if the cron produces an output so if the cron doesn't output anything no email will be sent.
How do I specify a custom index page?
By default, the following are seen as default index pages on our Linux Web Hosting platform:
- index.php
- index.html
- index.htm
- index.cgi
- index.rb
- index.py
Should you wish to specify a different/specific filename as your index page, you can do this with DirectoryIndex.
Add the following in the .htaccess file, within the directory you are serving/intend to serve site content from:
DirectoryIndex file.php
file.php should be replaced with the name of the file you wish to make default.
What are your default index pages?
On our Linux platform and Managed Cloud Hosting, the following are currently set as default index pages (in order of priority):
- index.php
- index.html
- index.htm
- index.cgi
- index.rb
- index.py
On our Windows platform for Resellers, the following are configured (in order of priority):
- default.aspx
- Default.asp
- index.php
- index.htm
- Default.htm
- index.asp
- index.html
- iisstart.htm
Due to the managed nature of the platform, WordPress packages are set to only use index.php.
How do I show custom error pages?
Having a custom error page can have many advantages.
If you wish to customise or brand the default error pages that are shown on your sites it is quick and easy when you web hosting is with us.
Head to Manage Hosting and the package you wish to add the custom error for.
Under ‘Web Tools’ Select the Custom Errors icon.
From here you can configure what action occurs when a particular status code is encountered on the site.
How to set a custom error page
It is really simple to set a custom error page. Select the status (error) code you wish to configure action for, then select the type of action that you want to happen and the final value of the action which will either be a redirect to a page you created for this purpose, external URL or plain text.
For WordPress hosted websites, that means no extra plugin is needed to show a custom error page.
Why set a custom error page?
There are multiple reasons why having a custom error page is beneficial for your website.
- Improved user experience: Customised error pages can provide a better user experience by providing your website visitors with helpful and informative messages instead of generic and unhelpful error messages. A custom error page can include instructions on how to resolve the issue, direct to other helpful pages on the website or provide your contact information.
- Branding and personalization: Individualised error pages can be designed to match the website's branding and style, providing a consistent look and feel. This can help reinforce the website's brand and create a personalized experience for users.
- Reduced bounce rates: A well-designed error page can encourage users to stay on the website and continue browsing, rather than leaving the website due to a frustrating error message. This can help reduce bounce rates and increase user engagement.
- If you are a hosting reseller or a digital agency you can provide this as a service for your customers. They don’t have to worry about error pages when you provide a customised solution for them.
- Error tracking and analysis: Custom error pages can be used to track and analyse errors on the website. This can help website owners identify and resolve recurring errors, improving the overall reliability and performance of the website.
What error code can a custom page be set up for:
You can quick an easy set a custom error page for all 4xx and 5xx error codes.
In detail the error codes are:
4xx Client Error |
5xx Server Error |
400 Bad Request |
500 Internal Server Error |
401 Unauthorized |
501 Not Implemented |
402 Payment Required |
502 Bad Gateway |
403 Forbidden |
503 Service Unavailable |
404 Not Found |
504 Gateway Timeout |
405 Method Not Allowed |
505 HTTP Version Not Supported |
406 Not Acceptable |
506 Variant Also Negotiates |
407 Proxy Authentication Required |
507 Insufficient Storage |
408 Request Timeout |
508 Loop Detected |
409 Conflict |
510 Not Extended |
410 Gone |
511 Network Authentication Required |
411 Length Required |
|
412 Precondition Failed |
|
413 Payload Too Large |
|
414 URI Too Long |
|
415 Unsupported Media Type |
|
416 Range Not Satisfiable |
|
417 Expectation Failed |
|
418 I'm a teapot |
|
421 Misdirected Request |
|
422 Unprocessable Entity |
|
423 Locked |
|
424 Failed Dependency |
|
425 Too Early |
|
426 Upgrade Required |
|
428 Precondition Required |
|
431 Request Header Fields Too Large |
|
451 Unavailable For Legal Reasons |
|
As an example how a custom error page can look, here is the one we use at 20i
How do I set a custom directory index?
By default, our web servers will look for the index.html file in order to know what to display when any given directory is accessed, such as public_html.
You can change which index file is looked-for if you don’t wish to use – or can’t use – the default index.html file. Rules are added within the root .htaccess file to make this work.
To make this easier you can use the 20i tool to set the default directory index:
- Head to Manage Hosting and select the package you wish to update the default directory index for.
- Select the Directory Indexing icon.
- Various common index files are pre-filled. You may wish to add your own or simply select Enable Directory Indexing – we’ll then generate the .htaccess rule and add it to the correct location in your site files to set the desired behaviour.
I installed WordPress on the temporary URL, how can I change it to my domain name?
Using the 20i WordPress Tools
If you've utilised 20i's temporary URL and would like to update it to your own live domain, then you can easily use the 20i WordPress tools to update this. To update the temporary to the live URL:
- Head to Manage Hosting -> [select package] -> Settings.
- You'll then see the Site URL and Home fields, currently, they should have URL that looks something like http://example-co-uk.stackstaging.com.
- Simply update both of these fields to your live domain, e.g. http://example.co.uk.
- Select Save Settings.
Note: Ensure you update the hyphens (e.g. ' - ') to periods (e.g. ' . ') when updating the URL in order for the live domain to work correctly.
You should now be able to access your site at your live domain.
Try 20i's WordPress Hosting today. You'll get WordPress staging, a global CDN and unlimited email as well as exclusive WordPress page speed plugins for your website with bullet-proof security.
Can I block visitors by country?
You can block access to your websites by country or IP address.
- Head to My20i > Manage Hosting > Options/Manage > Block Visitors
- You can choose to allow all countries (with exceptions), or block all countries (with exceptions). You can also block specific IP addresses/CIDRs.
What will blocked countries / IP addresses see?
When blocked, a 403 Forbidden warning will be displayed.
How to modify your hosts file for Windows, macOS and Linux.
Your machine's local hosts file allows you to override DNS for a particular domain or subdomain name.
This is a great way to test the site ahead of changing real DNS: you're able to test the website at 20i while the rest of the internet continues to use DNS to point to the existing website.
The way to modify this file and the location of it differs by the operating system.
To modify your hosts file, you can add two entries to the file that contains the IP address that you want the site to resolve to. Adding the following two lines, for example, would point www.domain.com and domain.com to the IP 1.2.3.4:
1.2.3.4 domain.com www.domain.com
Modify hosts file on Windows:
- Press Start and Search for Notepad
- In the search results, right-click Notepad and select Run as administrator. (this bit's important!)
- Use File -> Open and navigate to the following file:
c:\Windows\System32\Drivers\etc\hosts
- Make the changes (see below)
For Mac OS 10.0 to 10.6:
- Open Applications > Utilities > Terminal
- Type sudo nano /etc/hosts
- Enter the administrator password
- Make the changes (below)
To save changes in nano, press Control+x and then y when prompted.
Modify hosts file for Mac OS X 10.6 through 12:
- Open Applications > Utilities > Terminal
- Type sudo nano /private/etc/hosts
- Enter the administrator password
- Make the changes (below)
- Type dscacheutil -flushcache in to Terminal and press enter.
To save changes in nano, press Control-x and then "y" when prompted.
How to modify hosts file for Linux:
- Use your favourite editor to open
/etc/hosts
(i.e sudo vim /etc/hosts) - Make the changes (below)
Making The Change
The hosts file takes arguments of the format:
XX.XX.XX.XX domain.com www.domain.com
The IP address for the website is displayed down the right-hand side of the hosting package overview page in My20i. To get to this page, head to Manage Hosting, find the hosting package and select Options > Manage. Once on the overview page, the IP address can be found under the Account Information heading. They'll usually start with '185.151.3x.xxx':
185.151.3x.xxx domain.com www.domain.com
After you add this line and save the file, your system begins resolving to the specified IP address.
If you also have subdomains that you'd like to resolve to your 20i hosting package, you can add them like this:
185.151.3x.xxx domain.com www.domain.com sub.domain.com
After testing is finished please remove these entries so you start using "real DNS" once again.
It's important to ensure that when making this change you have entries for both your domain and all relevant subparts. For example, if you just add an entry for "domain.tld", then "www.domain.tld" will point the original server. The same goes for any subdomains
Providing Access Logs to a Third-Party provider
Some third-party providers may request access logs for investigation (i.e. Google AdWords). You can access these logs from within your My20i account.
- Head to Manage Hosting > Options > Manage
- Select Access/Error Logs
- Select Download Log Files.
This will download all your access and error logs as a .ZIP file which contains all the logs we have for this site.
You can select which logs that you'd like to give to your third-party provider. These logs contain information such as IP addresses and which web pages they've accessed.
How do I edit the PHP configuration on my website?
The PHP Configuration option allows you to change different values and variables within PHP. The PHP Configuration writes to the user.ini file, located within your file-space.
You can access the PHP configuration tool by going to Manage Hosting > Options (next to the package you wish to edit) > Manage > Web Tools > PHP Configuration
Below are the different configurable options available:
ASP_tag: Enables ASP Tag support to help reduce the coding volume in HTML.
Auto_append_file: Specifies the name of a file that is automatically parsed after the main PHP file.
Auto_prepend_file: Specifies the name of a file that is automatically parsed before the main PHP file.
Display_errors: Controls whether errors are displayed to the user or not.
Error_reporting: Sets the error reporting directive at runtime. Sets that level of error for the duration of the script’s runtime.
File_uploads: Allows HTTP file uploads to the server.
Post_max_size: The maximum size of POST data allowed to the server, per request.
Max_execution_time: The maximum amount of time on how long a single PHP script can run before the running script is killed.
Max_input_vars: The maximum number of input variables your hosting package can use for a single function.
Max_file_uploads: The maximum number of files that can be uploaded in one single request.
Memory_limit: The maximum amount of server memory that each PHP script can use.
Output_buffering: PHP sends the script output only after the PHP script processing has completed.
Short_open_tag: Makes the PHP code more concise by using shorter syntaxes in PHP scripts.
Upload_max_filesize: The maximum size of a file that can be uploaded.
To test your configuration you can generate a PHP file called info.php, for example, and then populate it with the code below:
phpinfo();
?>
It's important to note that PHP will only read the PHP configuration once every 5 minutes.
How to download a backup via ssh
Why would you need to make a backup in SSH?
The primary reason for using SSH to back up your website is its speed and simplicity. Backing up your site is especially crucial when you're about to make extensive changes, facing unresolved issues that might require a restoration from a backup, or simply adhering to best practices.
What are the most popular SSH clients?
How do I connect to my site via SSH?
If you haven't connected to SSH before, we have a guide on how to do this that is available here
Step 1 - Compress your website.
The first step is relatively simple and that is to zip up the website files, the best way to do this is to zip up the public_html folder. Once you run the command below you will see a zip file of public_html within the root directory. The reason for compressing the web files is it will make it much easier and quicker for you to download the files
zip -r public_html.zip public_html/
Step 2 - Make the files web-accessible.
The next step is to move the zip folder into a folder where it is accessible via the website the majority of the time the document root for your website will be public_html therefore we need to move our zip folder into public_html which we can do with the following command,
mv public_html.zip public_html/public_html.zip
Step 3 - Downloading the web files
All that needs to be done to download the files is to visit the site in your browser. In this case, the link would be your normal website URL with public_html.zip appended as if it were an extra link. This will then automatically start the download and all that needs to be done is to wait for this to finish. Once finished you will find you have a backup of your website downloaded onto your local machine. So for example, if your website is domainname.co.uk then you would need to visit domainname.co.uk/public_html.zip
Alternative download methods
There are multiple different ways of downloading website backups, the easiest method would be to use the backup restore tool within My20i this allows you to download a backup and you can also upload a zip file to restore if you need to. Other methods include using SFTP/FTP to download the files, WinSCP is also a tool which uses a secure SSH connection to allow you to make a connection to the package to download the files.
How do I create a bulk backup of all my websites?
The Multisite Backup tool is a feature we offer to allow you to manage the backups you have taken for your packages in one place. Within the tool, you can take a backup and then download the backup for any site you are hosting.
Please note: We would recommend subscribing to our automatic backup service, Timeline Backups to ensure that you benefit from regular daily backups - however, should you need to keep local backups then this tool can be used instead.
How to use the Multisite Backup tool?
- Select the packages you want to generate a backup for (If you want to backup all packages then press Select All)
- Click Start Backup.
- Wait for the backup to complete.
- Press Download Backup.
Please note the backups are deleted after 12 hours, so please make sure you download any backups you take before then. If you have any issues or questions regarding the multisite backup tool feel free to contact our support team who'll be happy to assist further.
How do I use the PHP Version Manager Tool?
The PHP Manager allows you to conveniently manage the PHP versions on all of the websites inside your My20i account in one place from one area of the dashboard.
To access the PHP Version Manager:
- Go to My20i
- Select Manage Hosting
- Open the Tools drop-down menu at the top of the page
- Select PHP Version Manager
The PHP manager page will list all of your packages, as well as the current version of PHP that the package utilises. You can also update the version of PHP the packages use.
How to update the PHP version of your website?
- Find the website you want to update the PHP version on.
- Under Available PHP Versions click the dropdown arrow and select the PHP version required.
- Click Update.
Or
- Find the website you want to update the PHP version on.
- Under Available PHP Versions, click the dropdown arrow and select the required PHP version.
- Repeat steps 1 and 2 for the sites you want to update.
- Once all the sites have the right PHP Version, scroll to the bottom and press Update.
If you have any questions or issues with the PHP Manager tool, please contact our support team, who will be more than happy to assist with any queries.