- Posted by bwf
- On June 19, 2013
- 0 Comments
After becoming fed up of hauling my bulky 15” laptop around in my bag all the time for my A Level coursework, I started looking into alternative ways of keeping all my files with me but without the need to carry my laptop. The obvious answer would have been to take a USB memory device around with me, but I knew that if I had some important documents on it then the inevitable would happen and I would lose it. I found the answer to my problem one day whilst taking a backup of my website; the cPanel Web Disk. Web disk is a feature of cPanel that I had never really looked into, but it turns out that it is actually a really cool feature which turns your web hosting into a virtual hard drive for your computer without losing its website functionality. I have been using Web Disk since October 2012 and it has made my everyday life much easier as I can leave my laptop at home and continue with my A Level coursework on my school computer without having to carry any files around with me.
I have written the following guide to set up Web Disk on your computer and iOS devices so that others can benefit from this great feature.
Web Disk for Windows
Setting up web disk is easy and takes just a couple of minutes. To add a web disk ‘hard drive’ to your computer, first load the start menu and click on ‘Computer’ then click on ‘Map network drive’, the following window should open:
Click ‘Next’ on this window and then next again. You should now see the following:
In this window you need to enter your URL and call port 2078, so if your URL is ‘mydomain.com’ for example, you should enter:
Note the https:// at the start, no www. and the :2078 at the end – it is important that you follow this format or else the wizard will not be able to access web disk and setup will fail.
After entering your URL, click next and you should be prompted to log in:
The login credentials for this are exactly the same as your cPanel login credentials. Enter them and click ‘OK’, you should now be asked to name your new drive:
The following window will then confirm that the drive has been added:
Launch your new drive to see the contents of your hosting account. You will notice that the default directory is the /home directory which is not visible to the public, so it is safe to save files here. Any files that you wish to make public should be stored within the /home/public_html folder. You can securely store documents within the public_html directory so that you can download them from a browser but you must secure the directory with a password. To learn how to secure a directory from within cPanel scroll down to the last section of this guide.
You will notice that your new network drive will now appear in the ‘Network Location’ section of the ‘Computer’ window along with any other network locations that you might have set up.
Your new drive can now be treated like a normal directory on your computer, allowing you to drag and drop files to and from the window, delete files, make new folders etc.
Web Disk for iOS
In iOS, some apps are compatible with the web disk service offered by cPanel such as Pages and Keynote. I will show you how to set up web disk in Pages for iPad.
When you have finished making a document and you wish to save it, click on the spanner in the top right, then click on ‘Share and Print’ then ‘Copy to WebDAV’, this will launch a box asking you to enter your login credentials:
In this window you need to enter your URL and port 2078, so if your URL is ‘mydomain.com’ for example, you should enter:
Note the https:// at the start, no www. and the :2078 at the end – it is important that you follow this format or else setup will fail.
If successful, you will then see this screen:
Choose a format to save your document to and then you will see it appear within the chosen directory on your hosting account. The same process is true for other apps such as Keynote and Numbers.
Remember that the default directory for your web disk is the /home directory which is not visible to the public, so it is safe to save files here. Any files that you wish to make public should be stored within the /home/public_html folder. You can securely store documents within the public_html directory so that you can download them from a browser but you must secure the directory with a password. To learn how to secure a directory from within cPanel scroll down to the end of this guide.
Web Disk in-browser
If you’re in a rush or you need to access a file quickly from a device which is not set up for web disk then you can still log in via your browser and download any file within your hosting partition. However, you must note that there is no logout function available using this access method, so do not log in on a public or shared computer unless you are able to clear the cache or run private browsing mode.
To access web disk in any browser simply call port 2077 of your URL and enter your cPanel login credentials when prompted to.
You must construct your URL correctly when entering it into the address bar of your browser. Ensure that you type http:// and put :2077 at the end of the URL like so, or else web disk will not run:
Securing a directory in cPanel
Directories within /home/public_html are visible to the public by default but you can password protect them by using a very handy feature of cPanel called ‘Password Protect Directories’. Protecting a directory will make it inaccessible to visitors unless they enter the correct username and password as specified by you. Password protecting directories is great for when you want to protect a file, but wish to maintain access to it from a browser whenever you might need it.
First you need to log into cPanel and scroll down to find ‘Password Protect Directories’ under ‘Security’:
You will then see a list of your directories. Click on the directory that you want to protect:
First you need to tick the ‘Password protect this directory’ box and name the protected directory – this can be any name, not necessarily the directory itself. Then click save. When the confirmation message appears, click the go back button and add a username and password to the directory. Another confirmation message will now load to say that the user has now been added with the password that you entered. If you then proceed to launch the URL that you have just protected you will be asked to enter a username and password to proceed:
If you now enter your credentials from earlier you will be able to proceed to the normal directory index screen, if the credentials are wrong then a ‘403 Forbidden’ error will be generated and access will remain restricted.