Web Services
Contents
Preamble
The ODU CS Department provides faculty and students the ability to host web pages from their CS Unix Account.
Important Knowledge
Your home directory that contains ~/secure_html
can be access on our Linux Servers.
Usage of these Web Services requires an understanding of Linux Permissions, if you are not familiar with these please see this Introduction to Linux Permissions written by Mitchell Anicas.
The ~/secure_html
directory and all of its content must have a specific set of linux permissions for it to be properly accessible to the Webserver that is serving it.
- Directories must have
other read and execute
- Files must have
other read
and if this file is supposed to be executed such as php it must also haveother execute
How it works
User websites are hosted at https://www.cs.odu.edu/~username/ where the document root is /home/username/secure_html/.
Example
Path | URL |
/home/username/secure_html/index.html | https://www.cs.odu.edu/~username/index.html |
Each user gets a unique webserver that is automatically created and does not serve content until created.
There are two ways for this webserver to be created.
The simplest method for having your webserver created is using the "autospin" feature, by navigating to a URL under where your content *should* be the system will automatically "spin" (create and turn on) the personalized webserver. Anyone that navigates to the URL will cause the webserver to be created. If for some reason the webserver of a specific user were to no longer be available, potentially due to an outage, the next navigation to a webpage will also cause it to be autospun.
Common Questions or Issues
Redirecting to external site
Problem
Some users would like cs.odu.edu/~username to redirect to an external page.
Solution
Create a file called .htaccess in the path you want to redirect. Ensure the .htaccess file has 755 permissions.
In the file, put the contents:
Redirect 301 / http://www.newdomain.com/
Example:
~/secure_html/.htaccess >
Redirect 301 / https://www.google.com/
Indexing (Error 403)
Problem
Going to cs.odu.edu/~username gives a 403 error but all folders and directories have the correct permissions
Reason
Indexing is off by default
Solution
One solution is to create an index.html.
Another solution is to make a .htaccess file and add the line "Options +indexes" to the directory you want to do indexing.