You’ve done your research, you’ve picked a good hosting plan, and you’ve signed up. What’s the next step? You’ll need to orient yourself to the contents of your Web space, and learn how to upload Web pages. This tutorial shows you how.
Features of shared Web hosting
Usually, when you join a shared Web hosting plan, the hosting company gives you a number of facilities, such as a Web-based control panel for managing your site, some usage statistics, and email accounts. Nearly all Web hosting plans include at least the following:
- Some Web space. This is an area of the Web server’s hard drive that stores your website’s files, such as Web pages and images. Upload your Web pages here, and they then become viewable on the Web. Usually you’re given between 10 megabytes (MB) and a few hundred MB of Web space.
- FTP access. This allows you to use an FTP program to upload your website’s files to the Web space.
Logging in via FTP
The first thing you’ll probably want to do with your new hosting plan is connect to the Web server via FTP and upload your website. (If you need help with understanding and using FTP, take a look at our articles on FTP.) Once you’ve logged in via FTP, you’ll see a listing of files and folders. This is your home directory; it’s an area of the Web server where you can upload, download and delete files and folders.
Let’s take a look at the various files and folders you can expect to see in your home directory. You’ll then learn how to upload your website.
Understanding the contents of your home directory
The home directory usually contains a few files and/or folders. The exact contents depend on your hosting plan, but here we’ll explain the most common folders and files that you’ll find in your home directory.
- You’ll usually find a folder with one of these names in your home directory. It’s called the document root, Web root or website directory, and it’s the folder that corresponds to the top level of your website. For example, if you place a file called
mypage.htmlin this folder, and your website’s URL is
www.example.com, you can view that file on the Web using the URL
- This folder, if it exists, is usually either in your home directory, or inside the document root folder. It’s where you upload any CGI scripts that you want to use on your website. CGI scripts are usually written in Perl. For more info, see our articles on Perl and CGI scripting.
- This folder is for uploading Perl scripts designed to run under mod_perl, the Apache Web server’s Perl extension. mod_perl scripts generally run a lot faster than CGI Perl scripts, and can integrate more closely with the Web server. If your Perl scripts are not mod_perl compatible — many aren’t — then upload them to the
- You’ll often find an
imagesfolder inside your document root folder. It’s a good idea to upload all your images to this folder (or to subfolders inside the
imagesfolder) so that all your images are in one place. If the folder doesn’t already exist, you can easily create it with your FTP program. (You might also want to create a
cssfolder to contain your style sheets, a
- Your home directory may well contain a
logsfolder. This folder contains the raw log files generated by the Web server; every time a visitor’s browser requests a Web page, image, or other URL from your website, the server writes a line to the current log file. Log files can get very big on a busy site, and they’re not that useful in their own right, which is why Web hosting companies often provide some sort of human-readable stats (see below).
- Many Web hosting packages come with usage statistics. These show you how many people visit your site each day, which pages they visit, and so on. Usually they’re created by processing the raw server log files (see above). Often the statistics are stored in a
statsfolder inside your document root. You can then browse the stats via a URL such as
- When you first login to your Web server via FTP, you’ll usually find a file with one of these names inside your document root folder. This is the holding page that appears when you view your new site via a browser; usually the page says something like, “website under construction”. When you upload your website, you’ll want to replace this file with your own
Default.htmhomepage. Pages with these special filenames are known as index pages; if a visitor browses a folder, such as
www.example.com/myfolder/, the Web server looks for one of these index pages inside that folder and, if it exists, it displays that page to the visitor.
- The presence of these folders in your document root indicates that your server is running FrontPage Server Extensions, a Microsoft technology that allows the FrontPage Web authoring software to store information on your server. If you use FrontPage, leave these folders alone. If you don’t use FrontPage, and you find the folders annoying, ask your hosting company if they can turn off the extensions for your site.
Uploading your first Web page
Now that you understand the structure of the files and folders in your home directory, you’re ready to start uploading your website. In this section we’ll walk you through uploading your first Web page.
Let’s assume that you want to upload a new home page for your website. This means that you want to replace the default index page in your document root folder (
To upload your home page, follow these steps:
- Make sure your home page is called
index.html. If it isn’t, rename it using your file manager (for example, Windows Explorer on Windows, or the Finder on Mac OS).
- Open your FTP program and use it to connect to your site. See our FTP articles for more info on this.
- Find your document root folder. This is probably called
mainwebsite_html, although your document root may be the same as your home folder. See the “Understanding the contents of your home directory” section above for more info. Once you’ve found the folder in your FTP program, open it (you can usually do this by double-clicking it).
- Upload the home page. Find your
index.htmlhome page file on your hard disk using your FTP program, then upload it to the document root folder on your Web server. You can usually do this by dragging the file in your FTP program, or by selecting the file and clicking an Upload button. If there was already a default index page called
index.htmlin the document root folder, you’ll probably need to confirm that you want to overwrite it.
- Test the page. Open up your Web browser and go to the URL of your website. You should see your newly-uploaded home page appear. If you still see a default holding page, make sure there are no other Web pages in your document root that might be overriding your
index.htmlpage (for example,
Default.htm). If you do find other files with these names, rename or delete them using your FTP program.
Congratulations! You now know:
- How your Web space on your server is organized
- How to upload a new home page to your Web site
Next, you’ll probably want to upload more Web pages, as well as images. To do this, just use your FTP program to upload the files, as described above. If you’re having trouble with images not appearing when they’re uploaded, you might also find our HTML Images tutorial helpful. Good luck — and if you need any extra help, feel free to ask in our Forums!
Leave a Reply