HTML Webpages on Tux

All CCI faculty, staff, and students have Tux access, and are able to host web pages on tux (tux.cs.drexel.edu).


To set up a website on the CS web server, you'll need to start by logging in to Tux. If you haven't already, follow the instructions at Tux Account Information to get connected.

If this is the first time you're using the web server, you'll need to create a public_html directory with appropriate permissions. The following commands will walk you through checking if the directory exists and creating it if not. 

Note: the tilde character (~) is used extensively in this documentation. It is a shortcut to your home directory, which is very useful.

ls ~/public_html
ls: cannot access 'public_html': No such file or directory

If you get the above response, you will need to create a public_html directory. If you get a file listing (or nothing), you have a public_html directory and can skip the next command.

mkdir ~/public_html

Next, you'll need to check the permissions on your public_html directory and your home directory. 

ls -al ~
total 537288
drwx--x--x   46 bjb344 cci tux admins        97 Apr  2 15:50  .

This command will list the contents of your home directory. The first directory it shows is identified as "." - in Linux systems, the "." indicates the current directory, which is your home directory in the command given above. 

Run the command above on Tux and find the line which ends in "." - this will give us information on your home directory itself.

The first portion of the directory listing, "drwx--x--x", indicates the permissions on your home directory. These are separated into several groups. "d" indicates that your home directory is a directory, as opposed to a file (indicated by "-"). 

The next three characters indicate the permissions you have on the home directory (they represent the User portion of the permission system). The permissions "rwx" in the example above mean that the user who owns the directory have read, write, and execute permissions. This maps to a permission level of 7 - Read is 4, Write is 2, and Execute is 1, and you add these permissions up to get the value to set (7).

The next three characters indicate the permissions that your group have over the home directory. On Tux, this group will often be "CCI Tux Students" or "CCI Tux Faculty". Since you typically don't want all students or all faculty to have access to the contents of your home directory, we want to restrict the permissions on the home folder to "execute" (or 1) for the group. This will allow other users to access files and directories in your home folder to which you give them access, but will prevent them from listing the contents of your home directory.

The final three characters indicate the permissions that everyone has over your home directory. Like with group members, you probably don't want everyone on Tux to have access to your home directory. We want the "everyone" permission on your home directory to be "execute" or "1" so that everyone can access files you've given them access to, without being able to list the directory itself.

Putting this all together, your home directory should have the permissions "drwx--x--x". If your home directory does not match that, run the below command, which will set your home directory to "711" or "User read-write-execute, group execute, everyone execute" permissions.

chmod 711 ~

Once your home directory permissions are correct, we'll need to set the permissions on your public_html directory. 

For the public_html directory, you want to have full control (rwx or 7) and you want all other users to have read/execute permission (-rx or 5). To change the permissions on the public_html directory, run the below command:

chmod 755 ~/public_html
cd ~/public_html

Note that these permissions allow everyone on Tux and the public Internet to see the contents of this directory. Never store anything sensitive in your public_html directory!

Now that we have our public_html directory and have made sure that it has the correct permissions, we can create a basic web site. Using your favorite text editor on Tux (such as vi or nano), create a file called "index.html" and paste in the example code below.

Hello world!

Save the file and we'll need to make sure that the permissions are correct using the command below. Note that for files, you typically omit the "execute" permission - unless your file is a program, it doesn't need to be executable.

chmod 644 ~/public_html/index.html

Now you should be able to see your website on the CS Web Server at https://www.cs.drexel.edu/~{{YOUR_USERID}}/. Replace {{YOUR_USERID}} with your Drexel abc123-format username and visit that URL in your web browser. You should see a very basic website showing only "Hello World!". 


Please also see: