Site Tools


web_server

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
web_server [2020/08/27 15:50] pgh5aweb_server [2024/03/18 15:28] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +==== Web Server ====
 +
 +The Computer Science department runs a web server for ''%%www.cs.virginia.edu%%'', and everyone who has a CS account gets space to host personal web pages.  This web server is capable of executing ''%%php%%'' code.
 +
 +Your site is hosted under the ''%%www.cs.virginia.edu%%'' domain name.  The URL path to your web space is ''%%www.cs.virginia.edu/~userid%%''. Your userid is the userid with which you login to CS servers (ex. "abc1de"). The string ''%%~userid%%'' is a special string that expands to the path to your [[storage_home_directories|home directory]].  The web server automatically sees this path and translates it to the location where your web files are stored.
 +
 +=== Where to put html/php files ===
 +
 +The easiest way to access your home directory is by logging in to the portal servers.  You can do this via ssh: [[linux_ssh_access|Linux SSH Access]]
 +
 +In your [[storage_home_directories|home directory]], there is a folder called ''%%public_html/%%'' If you put a file called ''%%index.html%%'' into ''%%public_html/%%'', you can then browse to ''%%https://www.cs.virginia.edu/~userid%%'' and get a webpage as shown below.
 +
 +{{:webpage.png|}}
 +
 +Here's the ~/public_html/index.html file used:
 +
 +<code>
 +<html>
 +<head>
 +  <title>Paul Henderson</title>
 +</head>
 +<h1>
 +Hello world!
 +</h1>
 +</html>
 +</code>
 +
 +=== Symlinks ===
 +
 +You may be tempted to create a symlink in your web space that points to a file in another user's home directory, or some other location.  This will in fact work, however if the other user leaves the department or moves to a different storage partition, your site may break because the target file has moved.