Body
Introduction
Web hosting is, at its core, files and folders on a computer that are connected to the internet and set up to distribute them. How that computer (typically a server) is set up to do that is not really covered in this article, but this article will explain how to structure your files in your server and how they relate to what you view on your domain.
File Management
When you signed up for your domain, a web hosting account was created. Although you typically will interact mostly with the web interface to create subdomains, install applications, and other common tasks, you might occasionally also need to work directly with the files in your account. The File Manager in your cPanel is one way to see these files. You can also create an FTP account in cPanel and use an FTP program to interact with these files FTP stands for File Transfer Protocol, and it’s a way of using a desktop client to transfer files to and from your Web server space).
Let’s take a look at the File Manager built into your cPanel to get a better understanding of the file structure that makes up your website(s).
1. Login to sites.carleton.edu with your Carleton credentials.
2. On the homepage of your cPanel, you’ll have a list of the various tools available to you, with one of them being File Manager, which will be located under the Files category. You can also find it by using the search tool in the upper righthand corner.
3. On the left side of the “File Manager” window, you’ll see a navigation menu containing the file structure of your web hosting account.
You’ll notice when the File Manager opens up that this looks very much like a folder on your computer. There are a few folders in it as well as files, and you can navigate down into those folders and see what’s inside of them. At the top level of the File Manager, you also have the option of interacting with files and folders you select by moving them around or removing them.
Understanding Your Public_HTML Folder
By default, you have a variety of folders at the root of your web space (the first screen you see when you open up the file manager). Some of them are created automatically to store information about the panel and setup of certain sites. These folders are things like access-logs, etc, ssl, and tmp. You can safely ignore most of those folders because they don’t correspond to actual websites. On the other hand, a folder which you may find quite valuable is the public_html folder. Your main domain will correspond to this public_html folder. Whatever files and folders are inside of this folder are available on that main domain. If you installed WordPress here you’ll likely see a lot of WordPress-related files within it (which were probably helpfully put there by the automated installer).
Subfolder Structure
Subfolders inside the public_html folder will become subfolders in your domain. Let’s say we uploaded an image called mypicture.jpg directly into the public_html folder. That image would now be available at yourdomain.com/mypicture.jpg. The slash after your domain implies “this file is inside this folder”. But what if we had a folder inside the public_html folder? How does that appear? This is typically called a subfolder so let’s put a folder in public_html called “images” and put our image, mypicture.jpg, inside of that folder. What would you type in a browser to get to that file now? The location would be mydomain.com/images/mypicture.jpg. So subfolders are also indicated by a forward slash after a domain.
Subdomain Structure
What about subdomains? You can have completely separate sites called subdomains that appear as nameOfSubDomain.yourDomain.com. But where are they in the file structure? If I had a subdomain called photos.myDomain.com for example, it would become a folder named “photos” in your public_html folder. This is identical to how subfolders are structured in your domain. So when you go to the File Manager and navigate to public_html, you’ll see folders listed for all of your subdomains and once you navigate inside one of those folders, you’ll see files and subfolders specific to that subdomain. So for example if you have a subfolder named “photosSubFolder” inside your photos subdomain, then it would be accessed as such: photos.myDomain/photosSubFolder.com
“If subfolders and subdomains both follow an identical structure in my file manager, then how does cPanel differentiate between them when I access them through a url such as the ones shown above?”
Well it’s all based on how you create the two. You need to create a subdomain through the domains tab in cPanel (check out this tutorial for more details), but can create a subdirectory/folder through the public_html folder.
All and all, File Manager in cPanel is great to view these files and folders, but it can be limiting if you want to upload an entire folder of information to your website. If you find yourself wanting to do more with the files and folders on your web space you may want to consider using File Transfer Protocol (FTP). FTP will allow you to upload and download files to and from your File Manager (i.e. your website) in bulk. For information on using FTP, click here.
Questions?
If you are encountering problems or have any questions, submit a ticket and an Academic Technologist can help you.
Acknowledgement
Created by Paul Claudel Izabayo '25, 05/01/23. Last updated by Mauricio I. Reyes Villanueva '25, 01/18/24