General Information for COP 2250

I have used CSS to make recently covered links more apparent. Scroll down... you won't miss them!
I have used CSS to make exam links more apparent. Scroll down... you won't miss them!

General

Java Information

Miscellaneous scripts

Information related to accessing school resources

General Web Information


School Accounts

Getting a school account

As long as you are a registered student, you can have an account to use the school's computers. This account is needed to access the computers in the lab. As long as you are registered for a CS class, you should have such an account. This account will also allow you to log into ocelot and weasel. CS Account Info

As long as you are registered for classes at FIU, you have access to a web mail account. Web Mail Account Info

There is a computer that is maintained by FIU, instead of by CS. This computer is named solix. Solix Account Info This account is not needed to use the PCs in the computer labs, but it is needed to long onto the computers with names: solix and weasel The account that you get will give you access to these computers.

Changing Passwords

Once you have a school account, it is good for many computers here at FIU. You should change your password to something other than your student number.

Changing your password on solix

From the command prompt on serss1 and solix, issue the command

        passwd

in order to change your password. You will be asked for three things:

Back to top of page


FAQ: Why won't the <P class="..."> tag work?

Many people are having difficulty getting the <P class="red"> working. The problem is with the header tags that start the paragraphs: Do not include the header tags inside the paragraph. Do it this way

<h1>Heading</h1>
<P class="red">
Paragraph
</P>

This will get it working.

Back to top of page


Submitting Homework Online from ocelot or solix

I have created a script that you can call from school computers to upload files to my directory. Execute the following from your directory on weasel, ocelot or solix:

~downeyt/cs/public/webftp/webftp.pl

and follow the instructions. Use the -h option to learn how to customize the program.

Back to top of page


More Information About Modes

There are three types of permissions for a file or directory: read, write, and execute.

File

Directory

Each file has three different access permissions

The output of the ls -al command lists all the permissions. There are ten characters

Each permission is assigned a numeric value. The values are chosen so that each number from 0 - 7 indicates a unique combination of permissions.

To use the chmod command, determine the permissions that are required for each category of account that can access the page: user, group, other. Calculate the number for each category. There will be one number for each. Here are some examples of chmod commands

To get more information on the chmod command, use the man pages.

Back to top of page


DOCTYPE and Content Type for HTML validators

If you want to validate the code in an HTML page by using an HTML validator such as the one located at http://validator.w3.org, add the following to your HTML file:

Here are some example pages and links to validators for each page.

valid.transitional.html
This is a valid HTML Transistional page that uses old style presentation tags and attributes like <font> and <body bgcolor="red">
Validate the Page.
valid.strict.internal.html
This is a valid HTML page that uses an internal style sheet to replace the old style presentation tags and attributes. It is necessary to validate the style sheet in a second validation.
Validate the Page. Validate the Style Sheet.
valid.strict.external.html
This is a valid HTML page that uses an external style sheet. It is necessary to validate the style sheet in a second validation.
Validate the Page. Validate the Style Sheet. View the Style Sheet.
invalid.transitional.html
This is an invalid HTML Transitional page that has some incorrect tags and attributes.
Validate the Page.
invalid.strict.html
This is a valid HTML Transitional page, but an invalid strict page.
Validate the Page.
invalid.strict.external.html
This is a valid strict page, but the style sheet has some errors.
Validate the Page. Validate the Style Sheet. View the Style Sheet.

Back to top of page


Path Info on Netbeans

In order for Path Info to work properly in Netbeans for a servlet, it will be necessary to add an additional servlet-mapping for the servlet. You do not need to do this when you run servlets from ocelot. It is only necessary whey you run locally on Netbeans.

Edit the web.xml file for your web app. Look for the servlet mapping for your servlet. It will look something like this

  <servlet-mapping>
    <servlet-name>QueryPath</servlet-name>
    <url-pattern>tdowne99.QueryPath</url-pattern>
  </servlet-mapping>

Copy and paste another one of these right after this one. Edit the url-pattern by adding a /* at the end. When you are finished, you should have two servlet-mapping that look something like this

  <servlet-mapping>
    <servlet-name>QueryPath</servlet-name>
    <url-pattern>/tdowne99/QueryPath</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>QueryPath</servlet-name>
    <url-pattern>/tdowne99/QueryPath/*</url-pattern>
  </servlet-mapping>

Back to top of page


Root Context is not Available

For some unknown reason, sometimes the ROOT web app of your host on Tomcat becomes unavailable, and it is impossible to Stop or Reload it in the manager web app.

If this happens, try deploying ROOT.

  1. Locate the Deploy section of the manager web app.
  2. Type ROOT into the WAR or Directory URL: edit box
  3. Click the Deploy button

You will most likely have two links to the / web app. One will work, the other will not. Leave both of them. Your web app should now be working.

Back to top of page


Netbeans 4.1 Problems

Issue 1 Netbeans in the lab has some issues. If you make a change to a JSP, then netbeans "should" recompile the JSP into a servlet. Netbeans 4.1 fails to do this. Sooooo, you have to delete the old .class file. Be sure that all hidden files can be viewed when looking into directories in Windows Explorer before you start looking for these files. It will be located in

Documents and Settings
 your yser name
   netbeans
     4.1
       jakarta-tomcat-something
         work
           Catalina
             localhost
               your project name
                 org
                   apache
                     jsp
                       your subdirectory name

Open this directory and delete the .class files. Then you can run your application again and it will rebuild the .class files.

Issue 2 If you ever get the error

Deployment error: TomcatManager.undeploy invalid TargetModuleID passed. See the server log file for details.

then you have to delete another file. Look in

Documents and Settings
  user name
    .netbeans
      4.1
        config
          J2EE
            TargetModules
              tomcat_home__bun251815208 (or similar)
                home__bundled_ho-1459906850 (or similar)
                  project name

Delete the "project name" file.

Issue 3 If you ever get the error

generics are not supported in -source 1.4 (try -source 1.5 to enable generics)

Then you must

  1. Right-click on the name of your web application in the Projects tab
  2. Click on Properties
  3. Click on Source
  4. Set the source level to 1.5

In the future, when creating a new web application, on the New Web Application screen of the wizard, be sure that the checkbox

  Set source level to 1.4

is unchecked. It seems that this is checked by default for compliance with J2EE 1.4 projects. When it is checked, then the new JDK 1.5 constructs, like generics, cannot be used. Back to top of page


MySQL Commands

The name of your MySQL database on ocelot is
spring21_username
where username is your ocelot user name.

To access your database, log onto ocelot and type the command
mysql -h localhost -u spring21_username -p <Enter Key>
password

You will enter your password after mysql prompts you for it. The password will be your panther id.

Once you are connected, you can change your password with
SET PASSWORD = PASSWORD('passwordhere');

Once you are connected, issue the command
use spring21_username

After you are in your database, you can view all tables with
show tables;
Don't forget the ; at the end.

There won't be any tables until you do your homework. Once you have a table, you can view its structure with
describe name-of-table;

You can see all the records in the table with
select * from name-of-table;

Exit mysql with
exit;

Back to top of page


Symbolic Link

Symbloic links are used in UNIX much like a shortcut is used in Windows. A directory can create a link to a file in another directory. To the operating system, this looks like the file exists in the current directory, eventhough it actually exists in a different physical location.

To create a symbolic link:

  1. Change to the directory where the link is to be created.
  2. Issue the ln -s command with the path to the actual file that is being linked
    ln -s /path/to/real/someFile.ext

If the link was created, then you will see the name of the linked file in the current directory, but it will be labeled as a link in a directory lising,
lrwxrwxrwx someFile.ext
This means that the file is a link and that it will have the same permissions as the actual file.

Back to Index


Limiting Access to a Directory in Apache

There are four directives that are needed to restrict access to a directory in Apache. The directives belong in access.conf in a Location or Directory tag for the directory.

AuthType Basic
The authentication type is the method that the browser will use to retrieve the username and password. Basic is the simple method where the usual dialog box appears.
AuthName "Security Name"
Use the authentication name to define the string that will be displayed in the dialog box to identify which username and password are required.
AuthUserFile path_to_password_file
The authentication authority file is the path to the file that contains usernames and passwords.
Require user username1 username2
Identify the users who are allowed to access the site.
  AuthType Basic
  AuthName "your-user-name Apache Server"
  AuthUserFile  /home/scsfac/downeyt/etc/2101/registered.passwd
  Require user downeyt your-user-name

The above command uses the password file for uploading assignments, which is the one you need to use in order to allow me to access your site.

In the future, if you want to create your own password file, use the htpasswd command, which is located in the same dierctory as httpd. For the first user, include the -c option, which will create the password file. For additional users, do not include the -c option.

htpasswd -c path_to_password_file username1
htpasswd path_to_password_file username2

You are visitor number to visit this page since 8/8/2008.