Header left.png

Difference between revisions of "Web Services"

From Systems Group
Jump to: navigation, search
Line 36: Line 36:
 
Each user gets a unique webserver that is automatically created and does not serve content until created.
 
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.
 
There are two ways for this webserver to be created.
  
Line 41: Line 42:
 
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.
 
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.
  
<!-- The other method is to use the Webcli tool available on the Linux Servers to start the webserver manually, for more information see WebCLI below -->
+
The other method is to use the Webcli tool available on the Linux Servers to start the webserver manually, for more information see WebCLI below -->
  
 
== Common Questions or Issues ==
 
== Common Questions or Issues ==

Revision as of 15:34, 11 April 2023

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 have other 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.


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.