Your website
From CS Wiki
Public web space is available for students with a domain account. If you do not have a domain account, go to http://www.cs.mtsu.edu to request one.
- NOTE:You must request a domain account to have web space.
Requests usually take 1 to 2 days. Your personal web space is located at http://www.cs.mtsu.edu/~your_username. Throughout this guide, we will continually make reference to URLs that look the one above. Take very careful notice the tilda, ~ , before your_username. Replace your_username only, leave the tilda.
Contents |
Accessing
Build Remotely
First log into the Linux row. In your home directory, you will notice a folder labeled public_html. Everything put in this folder is acessible by the web. Run the command
cd ~/public_html
to go to your public_html directory. You may now begin to build your site using your favorite text editor. vi is highly recommended, but nedit is also available if you used X11_Forwarding while logging in.
Build Locally
You can also build your web site on your machine and then upload it to www.cs.mtsu.edu using the FTP protocol.
Mac
In mac, you can connect to torvalds, the main computer science web server, by going to your Finder, and select the Go menu. Choose the "Connect to Server" option.
http://images.digitalmedianet.com/2002/09_sep/tutorials/ftposx020924/1.jpg
In the Address section, enter:
ftp://your_username@ftp.cs.mtsu.edu
An authorization window will appear. Enter your password. Upon successful authorization, the site will be "mounted" just like any other drive and appear in your Finder's sidebar. Click on the sidebar entry and you will see your home directory for your linux account. In the list of files and folders, there will be a folder named public_html. Drag and drop your website files into this directory. When the files are done transferring, you will be able to access your site here:
http://www.cs.mtsu.edu/~your_username
Linux
In Linux, there are several good GUI (Graphical User Interface) FTP programs. Both Gnome and KDE have FTP built into the environment.
GNOME
Open the Places menu located beside the Applications menu on your desktop toolbar. Now select Connect to Server. Enter this address:
ftp://your_username@ftp.cs.mtsu.edu
An authorization dialog will appear. Enter your password. Upon successful authorization, an icon most likely will be placed on your desktop. If not, an entry for the FTP server will now be the Places menu. Click on the desktop icon and your filemanager will open. You will notice a folder named public_html. Drag and drop your website files to this folder. You can now access your site here:
http://www.cs.mtsu.edu/~your_username
KDE
Open up Konqueror, and enter this address:
ftp://your_username@ftp.cs.mtsu.edu
An authorization dialog will appear. Enter your password. Upon successful authorization, you will be taken to your linux account home directory. In the list of files and folders, you will notice a folder named public_html. Drag ad drop your website files to this folder. After the transfer is complete, you can access your site here:
http://www.cs.mtsu.edu/~your_username
Command Line
It's actually far easier to scp your files to linux.cs.mtsu.edu than ftp them to ftp.cs.mtsu.edu. Open your favorite terminal emulator. Then cd to the directory containing your website files. Something like this:
cd ~/mysite
Now enter this command:
scp * your_username@linux.cs.mtsu.edu:public_html/
It will ask your for your password if you don't have SSH Keys set up. Enter it. After the transfer is complete, you can access your site here:
http://www.cs.mtsu.edu/~your_username
Windows
Open Internet Explorer. Then enter this address:
ftp://your_username@ftp.cs.mtsu.edu/
An authorization dialog will appear. Enter your password. Upon successful authorization, you will be taken to your linux account home directory. In the list of files and folders, you will notice a folder named public_html. Drag and drop your web site files into this folder. When the transfer is complete, you can access your site here:
http://www.cs.mtsu.edu/~your_username
Allowed Index Filetypes
An index file is the file that the web server automatically loads when a request is made for a certain directory. For instance, if my username is janedoe, when http://www.cs.mtsu.edu/~janedoe is called for, the web server will return http://www.cs.mtsu.edu/~janedoe/index.html. HTML index files are not the only type of file you can use. The available filetypes can be used:
- index.html - Plain HTML file
- index.htm - Plain HTML file
- index.cgi - CGI script, usually perl
- index.pl - Perl script
- index.php - PHP script
- index.xhtml- XML file
- index.shtml- HTML file with server side includes
The order of these are very important and ranked in precedence from top to bottom. For instance if I have two files named index.html and index.htm in my public_html directory, index.html will be used because it holds precedence over index.htm.
Scripting
Perl / Shell
Executable scripts are available for use in your website. Languages offered are:
- Perl
- Python
- Bash
In order to make the script executable, you must set the execute bit on the file. For example, if you have a python script called foo.py, you set the execute bit by using chmod
chmod +x foo.py
PHP
Any file with a .php extension will be handled as a php script. PHP4 is no longer offered. PHP5 is the only version available.
Displaying Source Files
Internet Explorer 7 (and possibly previous versions) have trouble displaying files that are recognized as source files by the Linux web server. The solution is to specify the source file as a text file. This can be done easily by adding a line to a .htaccess file in the directory holding the source files. If the file does not exist, create it and add a line similiar to this:
AddType text/plain .cc .cpp .java
This forces the web server to serve all files with extension .cc .cpp and .java as a plain text file, not a program source file.
- NOTE: This file recurses in to all subdirectories. For example, if you place the the line in a .htaccess file located in your public_html directory, all folders inside public_html will respect the directive.
