Difference between revisions of "File Transfer"

From XMission Wiki
Jump to: navigation, search
Line 83: Line 83:
 
If you just want to temporarily make it inaccessible, but don't want to completely remove it, you can either move it to your home directory or change the permissions to no longer be group readable. You can also remove access permissions for the directory that the file is contained in. Note that this will make all files in that directory inaccessible (See "Setting Permissions")
 
If you just want to temporarily make it inaccessible, but don't want to completely remove it, you can either move it to your home directory or change the permissions to no longer be group readable. You can also remove access permissions for the directory that the file is contained in. Note that this will make all files in that directory inaccessible (See "Setting Permissions")
  
 
[[Category:FTP|File Transfer]]
 
[[Category:About|FTP]]
 
 
[[Category:Hosting|FTP]]
 
[[Category:Hosting|FTP]]
 +
[[Category:Getting Started]]
 +
[[Category:FAQ]]

Revision as of 21:24, 22 January 2014

Your Web Space

XMission provides you with 100MB of space in your home directory, which is located on XMission's file system in /home/users/a/acctname (where "a" is the first letter of your account name). In that directory you'll notice two other directories already created. One is "ftp" and the other is "public_html". All web pages and files you want viewable by the web need to go in "public_html".

In your "public_html" directory, there are three files. One of those files is named "index.html". XMission's webservers are configured to use "index.html" as the default web page in any web directory. Anything you put in that place, as long as it's named "index.html", will come up automatically when someone goes to your URL.

URL's/Web Addresses

A standard XMission account, that includes web space, will have a default URL of "http://www.xmission.com/~acctname" (where "acctname" is your account name). If you've never published pages to XMission before, you can see the default "index.html" at that address.

If you have a Virtual Hosting account with XMission, the default setup is the same. You can access your pages by going to your domain name, "http://www.mydomain.com", or by going to either of the addresses shown above. Think of your domain address as a nickname for your default XMission address.

File Locations vs. URL's

To help clarify the difference between the location of a file on the file system and the web address of that file, see the following example.

My account name is "foo". I have a web page that I've named "mypage.html". To make this file accessible by the web, I put the file in my "public_html" directory.

    The file system location of "mypage.html" is:
    /home/users/f/foo/public_html/mypage.html
    -or-
    ~foo/public_html/mypage.html
    The web address, or URL, of "mypage.html" is:
    http://www.xmission.com/~foo/mypage.html

Setting Permissions

Anything in your "public_html" directory that you'd like to be web accessible should be readable by "all". You can do this by issuing the command "chmod a+r filename" in your telnet shell or in some FTP programs. If you would like to remove read access to a file, issue the command "chmod go-r filename". This also works with directories. Make sure not to change permissions on your "public_html" directory or you may risk having all of your web pages inaccessible.

    Note: You may set all public_html permissions to defaults by logging in to http://home.xmission.com/ and selecting the "My Account" tab. 
    There, you will find a "Repair Your Web Permissions" option under the "XMission Tools" section.

Limiting Access

There are other ways to limit access besides setting permissions. One way is setting a file called ".htaccess" in the directory you want to limit access to. There are many rules you can set, including limiting access by IP address or domain. It's most widely used, though, for adding password protection. If you're interested in setting up a ".htaccess" file to add password protection to one of your directories, refer to our .htaccess help page.

Common Mistakes and Problems

  1. Images were transferred from a DOS/Mac machine in text mode rather than binary mode
  2. Your file is a MS-DOS text file and not a UNIX text file
  3. Including public_html in a document's URL
  4. Attempting to reference a file that isn't in your public_html directory
  5. File or directory permissions that prohibit the server from reading the documents
  6. Permissions changed on public_html, resetting group ownership
  7. Case discrepancies with filenames (e.g., Index.html instead of index.html)
  8. Viewing a cached copy of the page (Shift+Reload or Ctrl+Refresh to view updated documents)
    Note: You may set all public_html permissions to defaults by logging in to http://home.xmission.com/ and selecting the 
    "My Account" tab. There, you will find a "Repair Your Web Permissions" option under the "XMission Tools" section.

Publishing Your Pages

To upload your files, you will need to use FTP. We recommend using SmartFTP for PC, Transmit for Mac OS X, and Fetch for older Macs. Some HTML editors and web site builders have a built-in FTP function, which can be quite helpful.

When using an FTP program, most of the same basic information will be required.

    Host Address or FTP Address = ftp.xmission.com or ftp://ftp.xmission.com
    UserID or Username = acctname (where "acctname" is your account name)
    Password = yourpassword (your standard XMission login password)
    Home Directory = /home/users/a/acctname

For more details about using FTP, please refer to XMission's FTP FAQ.

Uploading Text/HTML

When you transfer files, they can be transferred in two ways; ASCII or binary. When uploading text or HTML (this includes scripts and CGI's), you'll want to be sure you're uploading in ASCII. The reason for this is how Windows/MS-DOS handles carriage returns (new line) opposed to how Unix handles them. If you upload a text file from a PC running Windows in binary mode, the carriage returns will be seen by UNIX with an added "^M" at the end of the line. In most cases this won't interfere with your web pages, but it can become a problem when using CGI scripts.

Most good FTP programs will have a setting to "auto detect" the transfer type and they generally do a good job of it. It can be more difficult for it to auto-detect the file type, however, when the extensions are anything other than .html or .txt. In that case, you'll want to set the transfer type manually. If you're not sure where to find this setting, consult the help documentation that's included with the FTP software you're using.

Uploading Binaries/Images

Binaries need to be uploaded differently than your text files, as mentioned above. If your FTP program is having a difficult time auto-detecting the transfer type, you will need to set it manually to "binary".

Binary files include images, word processor documents, spreadsheets, ZIP files, PC or Mac programs, music files, and many others. If you're not sure if the file is a binary, try to open it in a text editor such as Notepad or Simple Text. If it's clearly legible (all of it), then it most likely isn't a binary.

"Unpublishing" Pages

If there is a page or file that you no longer want viewable by the web, you can do a few things to make it inaccessible.

If you want to permanently remove the file from your web space, simply delete it using your FTP program or telnet shell.

If you just want to temporarily make it inaccessible, but don't want to completely remove it, you can either move it to your home directory or change the permissions to no longer be group readable. You can also remove access permissions for the directory that the file is contained in. Note that this will make all files in that directory inaccessible (See "Setting Permissions")