public_html directory, which is located in your SCS home directory. Point your browser to the following address to display your files:
http://www.scs.fsu.edu/~your-username/filename
If you do not have a public_html directory in your home directory then you will need to make one and change the permissions on the directory if they are not correctly set. If you are using a machine that does not mount your home directory (link to page describing how to mount fs homedirs) then you will need to SSH to a machine that does (e.g. pamd.scs.fsu.edu).
Log in by using our SCS username and password. A successful login puts you in a shell at the base of your home directory. Type pwd and press return. You should get the full system path to your home directory (e.g., /home/some-path/your-username). If you get something different please send email to ops@scs.fsu.edu; their may be something wrong with file mounting on that machine. To make your web directory type:
mkdir public_html
public_html directory and on your home directory. Use the chmod command to set the permissions on these directories.
chmod o+x ~
chmod o+x public_html
public_html. Once the permissions are set, all files stored in public_html will be visible by the web. To protect files from being viewed by anyone you can change the permissions on a particular file or directory, or you can protect files or a directory by using the htaccess method described below.
File nameing extensions
AuthUserFile /dev/null
AuthGroupFile /dev/null
AuthName Domain-restricted
AuthType Basic
order deny,allow
deny from all
allow from .scs.fsu.edu
This will allow any host in the .scs.fsu.edu domain to view your pages but anyone else will get a 403 Forbidden error message.
*Individual File(s)
<FilesMatch <filename> >
AuthUserFile /dev/null
AuthGroupFile /dev/null
AuthName Domain-restricted
AuthType Basic
order deny,allow
deny from all
allow from .scs.fsu.edu
</FilesMatch>
ErrorDocument 400 /errors/badrequest.html ErrorDocument 401 /errors/authreqd.html ErrorDocument 403 /errors/forbid.html ErrorDocument 404 /errors/notfound.html ErrorDocument 500 /errors/serverr.htmlIf the relative path doesn't work, try using an absolute path like the ex. listed below. Example:
ErrorDocument 403 http://<em>your-domain</em>/<em>your-directory-path</em>/<em>filename.ext</em>Live Example: http://www.scs.fsu.edu/supercomputer/sp_apps_error404.php Remember this file must be accessible by the users browser.
mkdir secret-directory
cd secret-directory
.htaccess (Make sure you are inside of your secret-directory)
Add the following to the .htaccess file using your favorite editor.
AuthUserFile /home/jdoe/public_html/goodstuff/.htpasswd AuthName Personal AuthType Basic <Limit GET> require valid-user </Limit>Note: The path assigned to AuthUserFile varies depending on what group you are in. After logging into your home directory on pamd run the 'present working directory' (pwd) command, in order to determine your exact path. Example for SCS postdocs: $pwd
valid-user is replaced with gibbard then gibbard will be the only user permitted to log in.
Make these changes to the above text:First thing is to enable CGI execution on the apache webserver
This is done in the httpd.conf file. Location varies from unix platform.
(Example: Debian stores this config file in /etc/apache/httpd.conf)
Notice the entry Options ExecCGI located in the virtual host example below.
<VirtualHost *:80>
ServerName hirampc2.scs.fsu.edu
DocumentRoot /sites/
<Directory /sites/>
Options ExecCGI
AllowOverride Limit
Order Allow,Deny
Allow From All
</Directory>
ErrorLog /var/log/apache/sites/hirampc2.scs.fsu.edu/error.log
CustomLog /var/log/apache/sites/hirampc2.scs.fsu.edu/access.log combined
</VirtualHost>
Next create a somefile.cgi in the path of the DocumentRoot.
(Example: /home/gibbard/public_html/somefile.cgi)
You can utilize this test code written in perl:
#!/usr/bin/perl -wT print "Content-type: text/html\n\n"; print "Hello World!\n";
Perl will also have to be installed.
Be sure to have read and executable permissions for the world.
Navigate to the directory using a browser. (Example: hirampc2.scs.fsu.edu/~gibbard/somefile.cgi)
If the browser displays "Hello World" then everything should be working properly.
Additional Documentation: http://www.cgi101.com/book.
chmod command to change your file permissions on a file or a directory. The ls -al command will print detailed information for all the files and directories in your current directory.
For example, typing:
ls -al
Will give you:
-bash-2.05b$ ls -al total 7804 drwxr-xr-x 6 gibbard bio 512 Feb 15 22:17 . drwxr-xr-x 4 gibbard bio 1024 Feb 1 19:23 .. drwxr-xr-x 2 gibbard bio 512 Sep 20 13:56 downloads -rw-r--r-- 1 gibbard bio 0 Feb 15 22:17 file.html -rw-r--r-- 1 gibbard bio 951 Feb 1 21:43 index.php drwxr-xr-x 7 gibbard bio 2560 Jan 27 13:28 phpMyAdmin -rw-r--r-- 1 gibbard bio 7936000 Jan 25 21:01 phpMyAdmin-2.6.1.tar -rw-r--r-- 1 gibbard bio 22 Nov 16 13:55 phpinfo.php drwxr-xr-x 3 gibbard bio 512 Sep 21 05:20 projects
ls -la explained downloads directory from the list output above to briefly explain file permissions.
drwxr-xr-x 2 gibbard bio 512 Sep 20 13:56 downloads
File permissions are represented by a string of ten characters. The first character tells you what kind of file you have. Typically this is either a d for a directory or a - for a file. The remaining nine characters can be divided into three groups of three characters. The characters represent the file permissions for the user (file owner), the group, and other (everyone who can access the file system), respectively. This allows the file owner to separately enable/disable read (r), write (w), or execute (x) permissions on a file or directory for the three classes of users.
| file type | user | group | other |
d | rwx | r-x | r-x |
r,w,x will appear if the corresponding permissions are enabled for the corresponding class of user. Otherwise, the absence of a letter (-) means that the corresponding permission is disabled.
Following the permissions string is a number, which represents the number of files in the directory (this is always one in the case of a file). After this, you will find the file owner and the file group names, which correspond to the user and group, respectively.
The command chmod is used to change the permissions of a file or directory.
chmod 777 filename will result in rwxrwxrwx permissions.
chmod 000 filename will result in --------- permissions (no permissions for anyone)
Each number represents a set of permissions.
Example: 7 = rwx, 7 = rwx, 7 = rwx
Each letter contains a total value of 7
r has a value of 4
w has a value of 2
x has a value of 1
Example: chmod 644 filename
chmod 004 filename
chmod 430 filename
Show attachments
Hide attachments
| I | Attachment | Action | Size | Date | Who | Comment |
|---|---|---|---|---|---|---|
| | testfile.html | manage | 0.5 K | 16 Oct 2006 - 18:13 | HiramGibbard |