ARCHIVED: How do I create subdirectories of my www directory for my web pages?

This content has been archived, and is no longer maintained by Indiana University. Information here may no longer be accurate, and links may no longer be available or reliable.

Note: On June 23, 2008, UITS will retire Steel. As part of this process, UITS will move the Mypage service to a new platform. For more, see ARCHIVED: About the Mypage migration.

The procedure for creating a subdirectory of your www directory is similar to creating any other directory in Unix. From the Unix prompt, enter:

  mkdir ~/www/directoryname

Replace directoryname with the name of your subdirectory.

If you wish to make a subdirectory of www available to web browsers, the subdirectory and the files within must have their permissions set so that the rest of the world can access them.

At Indiana University, on Steel you can do this either by running spinweb in recursive mode, or by using the chmod command.

To run spinweb in recursive mode, enter spinweb -r. This will automatically set the correct subdirectory and file permissions for any subdirectories you have created, but you must run it again every time you create any new subdirectories.

To use chmod to set permissions, follow these steps:

  1. To set the correct subdirectory permissions, enter:
      chmod 711 ~/www/directoryname

    Replace directoryname with the name of your subdirectory.

  2. To set the correct permissions for files within subdirectories, enter:
      chmod 644 ~/www/directoryname/filename

    Replace directoryname and filename with the subdirectory and filenames, respectively.

You can also create and use subdirectories of subdirectories, as long as you set the correct permissions for all nested directories and the files within them.

When accessing files within a subdirectory of your www directory via HTTP, the URL takes this form:

  http://mypage.iu.edu/~username/directoryname/filename

Replace username with your username, directoryname with the name of the subdirectory, and filename with the name of the file within the subdirectory. You should not include the www directory in the path of the URL. For example, the URL for the image helmet.jpg in dvader's ~/www/graphics/clothes/ subdirectory would be:

  http://mypage.iu.edu/~dvader/graphics/clothes/helmet.jpg

Note: The IU South Bend Mypage service is different from the Mypage service noted here; see IUSB's Web Publishing: Mypage.

This is document beio in the Knowledge Base.
Last modified on 2018-01-18 10:14:46.