ࡱ > f h [ \ ] ^ _ ` a b c d e 5@ 0 bjbj22 . X X
|
a P P P P + $ s R :
+ +
P P
P
P r T
P PWN+ 4
1 0 a
y _ k y y y
r | +
|
An Najah National University
Faculty of Engineering
Computer Engineering Department
RCS Engine
Graduated Project First Semester
Documentation
Students:
Ala'a Deeb
Mohammad Yasin
Instructors:
Dr.Raed Qadi
Dr.Luai Malhis
Eng.Ashraf Armoosh
Remote Control System (RCS)
Introduction:
Network content is expected to continue expanding at explosive rates in the new future and with the develop of technology , ease of communication , increase the Internet speed and the capacity of data storing , the need to build secure systems , the need to replace manual systems with automatic systems , controlling more systems from one point and from anywhere and anytime , join systems together , manage and maintain systems securely and quickly make it increasingly important and necessary to develop comprehensive systems and strategies to achieve more powerful and secure future.
Our system is RCS:
It's a web application software with two sides (server side and client side) and complex database structures and graphic editor to build systems hierarchically and make it easy to monitoring and controlling them securely and quickly from anywhere and anytime.
In addition to software runs in server side to simulate inputs and outputs to and from microcontroller circuits.
So let's start to control fans and light and ..in my house or in my car by my internet connection from any place and any time .
Software Resources:
Java Script , Java Applet , Java Servlet, HTML , XML , DHTML , PHP,SQL query .
Software Tools:
Linux RedHat operating system , Microsoft windows operating system, Micromedia Dreamwaver, Microsoft Frontpage, Adope Photoshop ,Adope Illustrator, PHP editors(for two platforms ), Postgresql editor and browser.
Packages Needed:
Apache server package, Tomcat server package ,PHP server package , Postgresql server package.
Using PostgreSQL with PHP:
1. What is PostgreSQL?
PostgreSQL is an object-relational database management system (ORDBMS) based on POSTGRES,Version 4.21, developed at the University of California at Berkeley Computer Science Department.
PostgreSQL is an open-source descendant of this original Berkeley code. It provides SQL92/SQL99 language support and other modern features.
POSTGRES pioneered many of the object-relational concepts now becoming available in some commercial databases. Traditional relational database management systems (RDBMS) support a data model consisting of a collection of named relations, containing attributes of a specific type. In current commercial systems, possible types include floating point numbers, integers, character strings, money, and dates. It is commonly recognized that this model is inadequate for future data-processing applications.
The relational model successfully replaced previous models in part because of its Spartan simplicity. However, this simplicity makes the implementation of certain applications very difficult.
PostgreSQL offers substantial additional power by incorporating the following additional concepts in such a way that users can easily extend the system:
inheritance
data types
functions
Other features provide additional power and flexibility:
constraints
triggers
rules
transactional integrity
These features put PostgreSQL into the category of databases referred to as object-relational. Note that this is distinct from those referred to as object-oriented, which in general are not as well suited to supporting traditional relational database languages. So, although PostgreSQL has some object oriented features, it is firmly in the relational database world. In fact, some commercial databases have recently incorporated features pioneered by PostgreSQL.
2. Prerequisites:
To follow along with this , you will need the following:
The PostgreSQL Server already installed
PHP Compiled with PostgreSQL Support
An already made user and a database made for that user.
3. Connecting to PostgreSQL From PHP :
To start off using PostgreSQL from PHP, You'll first need to connect to it. This is accomplished with the HYPERLINK "http://www.phpfreaks.com/phpmanual/page/function.pg-connect.html" \t "_blank" pg_connect() function. This function is pretty straightforward and only expects one argument, the connection string. The connection string contains all of the information needed to connect to the database. The arguments available for connection_string includes host, port, tty, options, dbname, user, and password. The way you would usually connect to your database is as follows:
/* dbname is the name of the database you're connecting to* user is the PostgreSQL user you're going to connect as* password is the password for the user you're connecting as*/pg_connect("dbname=databasename user=username password=password") or die("Couldn't Connect: ".pg_last_error());// what pg_last_error() does is return the last error that occured, so you should always die with that to know what happened
4.Using pg_query() To create a table
Lets create our first table. We will make a script to do this, demonstrating the use of HYPERLINK "http://www.phpfreaks.com/phpmanual/page/function.pg-query.html" \t "_blank" pg_query(). Lets make a table named "Contacts" with the fields 'name','surname', and 'email'. To do this, use the following query:
/* We're using the query*CREATE TABLE contacts *(*name varchar(50),*surname varchar(50),*email varchar(50)*)*/pg_connect("dbname=dbname user=user password=password") or die("Couldn't Connect ".pg_last_error()); // Connect to the Database/* Use the Query */$query = "CREATE TABLE contacts (name varchar(50),surname varchar(50),email varchar(50))";$query = pg_query($query); // Execute the Queryif($query)echo "Table Created"; // Check to see if The Query Worked.else{echo "An error Occured! ".pg_last_error();}
If there was any error In using that script, then check to see if you supplied the correct username and password, and also check to see that PostgreSQL is running. Also be very careful to only execute that script once and then delete it. Otherwise you will get errors saying that there is already a table named 'contacts'.
5.Inserting Data Into your database:
Now that you've set up your table, its time to insert some records, your database should look something like this: Database name: Contacts name | surname | email Now its time to use the pg_query function again. We will this time insert some information into our database. We will use the SQL Command 'INSERT' to do this, its syntax is as follows: INSERT INTO table_name (column1, column2,...) VALUES (value1, value2,....) table_name is the name of the table, in the parenthesis you can specify which columns you want to insert into. For values, you will put what you want to insert into the database. so INSERT INTO contacts VALUES('John','Smith','johnsmith@domain.com') would insert John as the first name, Smith as the last name, and johnsmith@domain.com as the e-mail address. Lets try writing a script now to do this.
pg_connect("dbname=databasename user=username password=username") or die("Couldn't Connect".pg_last_error());$query = "INSERT INTO contacts VALUES('John','Smith','johnsmith@domain.com')";$query = pg_query($query);if($query)echo "inserted successfully!";else{echo "There was an error! ".pg_last_error();}
That should've done what we wanted to, otherwise you should backtrack and try remaking the table. If that was successful, which it should have been, lets go on to insert a few more records. In fact, Why don't we make a form based inserter? We shall start off with a basic form
Now we shall add the actual inserts to our form. We will first check to see if all fields were filled out, and then insert into the database, so the following should do the trick.
.
6.Viewing The Entries in the Database:
Excellent, Now that we can add to our database, the only thing that we really need to do now is to VIEW all of the database entries. We can do that using the SELECT Command in SQL. Keep in mind we're still using the pg_query() function. If we wanted to show all of the database fields, we could make a script that'll select all(* in SQL) of the entries.
pg_connect("dbname=databasename user=user password=password") or die("Couldn't Connect"); // Connect to the Database$query = "SELECT * FROM contacts";$query = pg_query($query);while($row = pg_fetch_array($query,NULL,PGSQL_ASSOC)){// print_r($row);// Uncomment the preceding line to see the entire array.echo "Name: ".$row['name']."
";echo "Surname: ".$row['surname']."
";echo "E-Mail Address: ".$row['email']."
";}
Now don't be afraid if you don't understand every part of this. I just used the function HYPERLINK "http://www.phpfreaks.com/phpmanual/page/function.pg-fetch-array.html" \t "_blank" pg_fetch_array() to fetch the results from the query Into an associative array. The keys of the array are named after the column names of the table. so $row['name'] will contain whatever was in the "name" column of our table. simple, isn't it? The $query Variable is the Query that you want to fetch. NULL is the row number, when you specify NULL, then the function will just skip that parameter. In the last parameter, the one that says PGSQL_ASSOC, that chooses what type of array It will return. PGSQL_ASSOC will have arrays with the column names as keys. PGSQL_NUM will return a numerated array, and PGSQL_BOTH will return both. As a final note, you can replace all of those echo's with a print_r() to see the entire array.
7.Updating:
The only thing left for you to know the basics, is the update command, which is pretty straightforward. It's syntax is UPDATE table_name SET column_name = new_value WHERE column_name = some_value So "UPDATE contacts SET email = 'HIDDEN' WHERE surname = 'smith'" would ddit and set the email to "HIDDEN" to anybody with the last name 'Smith'. simple, huh?
Server Run-time Environment:
1. The PostgreSQL User Account:
As with any other server daemon that is connected to outside world, it is advisable to run PostgreSQL under a separate user account. This user account should only own the data that is managed by the server, and should not be shared with other daemons. (For example, using the user nobody is a bad idea.) It is not advisable to install executables owned by this user because compromised systems could then modify their own binaries.
To add a Unix user account to your system, look for a command useradd or adduser. The user name postgres is often used but is by no means required.
2. Creating a Database Cluster
Before you can do anything, you must initialize a database storage area on disk.We call this a database cluster. (SQL uses the term catalog cluster instead.) A database cluster is a collection of databases is accessible by a single instance of a running database server. After initialization, a database cluster will contain a database named template1. As the name suggests, this will be used as a template for subsequently created databases; it should not be used for actual work.
In file system terms, a database cluster will be a single directory under which all data will be stored.
We call this the data directory or data area. It is completely up to you where you choose to store your data. There is no default, although locations such as /usr/local/pgsql/data or /var/lib/pgsql/data are popular. To initialize a database cluster, use the command initdb, which is installed with PostgreSQL. The desired file system location of your database system is indicated by the -D option, for example
$ initdb -D /usr/local/pgsql/data
Note that you must execute this command while logged into the PostgreSQL user account.
initdb will attempt to create the directory you specify if it does not already exist. It is likely that it will not have the permission to do so (if you followed our advice and created an unprivileged account). In that case you should create the directory yourself (as root) and change the owner to be the PostgreSQL user. Here is how this might be done:
root# mkdir /usr/local/pgsql/data
root# chown postgres /usr/local/pgsql/data
root# su postgres
postgres$ initdb -D /usr/local/pgsql/data
3. Starting the Database Server
Before anyone can access the database, you must start the database server. The database server is called postmaster. The postmaster must know where to find the data it is supposed to use. This is done with the -D option. Thus, the simplest way to start the server is:
$ postmaster -D /usr/local/pgsql/data
which will leave the server running in the foreground. This must be done while logged into the PostgreSQL user account. Without -D, the server will try to use the data directory in the environment variable PGDATA. If neither of these succeed, it will fail.
To start the postmaster in the background, use the usual shell syntax:
$ postmaster -D /usr/local/pgsql/data > logfile 2>&1 &.
Configuring with the Red Hat GUI Apache Utility
Red Hat has developed a GUI tool for configuring Apache, which you can start with the redhat-config-httpd command. When you first start the tool in a GUI, you should see the Apache Configuration window, shown in HYPERLINK "file:///F:\\RH9%20Linux%20help\\ch30p552.htm" \l "figure.c4be1869-21ee-41b3-b7c8-58b66129a937#figure.c4be1869-21ee-41b3-b7c8-58b66129a937" Figure 30.6.
HYPERLINK "" \t "_blank" INCLUDEPICTURE "F:\\RH9 Linux help\\images\\f3006.jpg" \* MERGEFORMATINET
Figure 30.6: The graphical Apache configuration utility
As you can see, this utility includes four tabs, which we cover in the following sections. When you finish your changes and click OK, changes are written to your httpd.conf file, overwriting any changes that you may have made earlier in a text editor.
Note:
As of this writing, redhat-config-httpd is still a work in progress. Before I use this utility, I first back up my current httpd.conf file. After I make changes, I make sure to test the syntax of httpd.conf with the httpd -t command. I open httpd.conf in a text editor to analyze the changes. Nevertheless, redhat-config-httpd is a great way to learn more about configuring Apache.
Setting Main Apache Parameters
The basic setup of Apache is straightforward. Youre configuring three directives in the Apache Configuration window Main tab:
The Server Name text box corresponds to the ServerName directive, which sets the name for the main website for the Apache server. This utility wont work unless you enter the name or IP address of your server in this text box. If youre configuring Virtual Hosts, dont enter any of those domain names in this text box. It is usually best to enter the IP address for your server, to avoid unnecessary traffic to any DNS servers connected to your network.
The Webmaster Email Address text box corresponds to the ServerAdmin directive, which sets the default e-mail address listed by automatically generated web pages. You can see the default setting, HYPERLINK "mailto:root@localhost" \t "_top" root@localhost, in HYPERLINK "file:///F:\\RH9%20Linux%20help\\ch30p552.htm" \l "figure.c4be1869-21ee-41b3-b7c8-58b66129a937#figure.c4be1869-21ee-41b3-b7c8-58b66129a937" Figure 30.6.
The Available Addresses box sets the TCP/IP ports where Apache listens for requests, using the Listen directive. Port 80 is the standard HTTP TCP/IP port, and Apache normally listens to requests from all addresses on the Internet, with the Allow from all command.
You can limit the range of computers allowed to view your website. Highlight All Available Addresses On Port 80 and click Edit. This opens the Edit An Address window, shown in HYPERLINK "file:///F:\\RH9%20Linux%20help\\ch30p552.htm" \l "figure.463cc236-6257-42b0-91df-6a304c3c8027#figure.463cc236-6257-42b0-91df-6a304c3c8027" Figure 30.7.
INCLUDEPICTURE "F:\\RH9 Linux help\\images\\f3007.jpg" \* MERGEFORMATINET
Figure 30.7: Limiting access to your web server
For example, HYPERLINK "file:///F:\\RH9%20Linux%20help\\ch30p552.htm" \l "figure.463cc236-6257-42b0-91df-6a304c3c8027#figure.463cc236-6257-42b0-91df-6a304c3c8027" Figure 30.7 illustrates limiting access to the network adapter on your computer with an IP address of 192.168.13.64. This changes the Listen directive in httpd.conf to
Listen 192.168.13.64:80
If you need to configure other services, such as secure web pages (HTTPS), click the Add button. This opens the Add New Address window, which looks almost identical to HYPERLINK "file:///F:\\RH9%20Linux%20help\\ch30p552.htm" \l "figure.463cc236-6257-42b0-91df-6a304c3c8027#figure.463cc236-6257-42b0-91df-6a304c3c8027" Figure 30.7. You can then enter the IP address of the desired network adapter and the TCP/IP port associated with HTTPS, 443. When youve completed your desired changes, click the Virtual Hosts tab.
Configuring Virtual Hosts
Next, you can start configuring Virtual Hosts within Apache. If you havent already done so, start the redhat-config-httpd utility and click the Virtual Hosts tab. The default view is shown in HYPERLINK "file:///F:\\RH9%20Linux%20help\\ch30p552.htm" \l "figure.27628375-0da9-4543-ad4d-dac7ac3b8b6b#figure.27628375-0da9-4543-ad4d-dac7ac3b8b6b" Figure 30.8.
HYPERLINK "" \t "_blank" INCLUDEPICTURE "F:\\RH9 Linux help\\images\\f3008.jpg" \* MERGEFORMATINET
Figure 30.8: The Virtual Hosts tab
The Default Virtual Host settings associated with the default httpd.conf file are shown. If you want to know more about the default settings, click Edit or Edit Default Settings and analyze the properties window. However, were focused on creating a Virtual Host for a real website, so click Add. This opens the Virtual Host Properties window, shown in HYPERLINK "file:///F:\\RH9%20Linux%20help\\ch30p552.htm" \l "figure.3881a784-be91-496f-ad4f-f23c656d0d61#figure.3881a784-be91-496f-ad4f-f23c656d0d61" Figure 30.9.
HYPERLINK "" \t "_blank" INCLUDEPICTURE "F:\\RH9 Linux help\\images\\f3009.jpg" \* MERGEFORMATINET
Figure 30.9: Configuring a virtual host
As you can see, there are six sections in this window: General Options, Site Configuration, SSL, Logging, Environment Variables, and Directories.
General Options
Every Virtual Host includes General Options, similar to those shown in HYPERLINK "file:///F:\\RH9%20Linux%20help\\ch30p552.htm" \l "figure.3881a784-be91-496f-ad4f-f23c656d0d61#figure.3881a784-be91-496f-ad4f-f23c656d0d61" Figure 30.9. In that figure, weve filled in some basic parameters for a website named mywebsite.abc.
As described earlier, you can set up multiple Virtual Hosts on a single IP address using the IP-based Virtual Host setting. The alternative, name-based Virtual Hosts, requires an IP address for each website configured through your Apache server.
Site Configuration
Next, select the Site Configuration option on the left side of the window. This opens a list of directory pages and error file settings, as shown in HYPERLINK "file:///F:\\RH9%20Linux%20help\\ch30p552.htm" \l "figure.84639442-f012-44cd-8910-d2ddff0e0bce#figure.84639442-f012-44cd-8910-d2ddff0e0bce" Figure 30.10.
HYPERLINK "" \t "_blank" INCLUDEPICTURE "F:\\RH9 Linux help\\images\\f3010.jpg" \* MERGEFORMATINET
Figure 30.10: Site configuration settings
When users look for your website, theyre taken to the directory associated with the DocumentRoot directive. As you can tell in HYPERLINK "file:///F:\\RH9%20Linux%20help\\ch30p552.htm" \l "figure.3881a784-be91-496f-ad4f-f23c656d0d61#figure.3881a784-be91-496f-ad4f-f23c656d0d61" Figure 30.9, thats the /var/www/mywebsite.abc/html directory. It looks for one of the filenames shown in the Directory Page Search List box: index.php, index.html, index .htm, or index.shtml.
The Error Pages shown at the bottom of the window display Apaches response to various HTTP errors. For example, the highlighted error, file not found, is associated with HTTP error code 404. The default behavior refers to ErrorDocument directives in httpd.conf. If you want special error pages, you can create special ErrorDocument directives for this particular Virtual Host. To do so, highlight the error code of your choice and click Edit. This opens the ApacheConf.py window, shown in HYPERLINK "file:///F:\\RH9%20Linux%20help\\ch30p552.htm" \l "figure.6e3bfe8c-83da-45a8-8f47-6b0846f915d5#figure.6e3bfe8c-83da-45a8-8f47-6b0846f915d5" Figure 30.11.
HYPERLINK "" \t "_blank" INCLUDEPICTURE "F:\\RH9 Linux help\\images\\f3011.jpg" \* MERGEFORMATINET
Figure 30.11: Changing error code behavior
As you can see in the figure, you can point the user in three directions for Error Code 404: Default points to the standard ErrorDocument directive in httpd.conf; File allows you to specify the web page of your choice; and URL lets you set the location of the desired error message online.
Finally, the Default Error Page Footer specifies the information associated with each error page. The standard footer is based on the bottom.html file in the /var/www/error/include directory. You can choose to not show the footer at all, or you can show it with or without an e-mail address.
SSL
Next, select the SSL option on the left side of the window. This opens a series of options associated with the Secure Socket Layer, as shown in HYPERLINK "file:///F:\\RH9%20Linux%20help\\ch30p552.htm" \l "figure.abd80e07-fccb-432b-aaba-32deb9f65bea#figure.abd80e07-fccb-432b-aaba-32deb9f65bea" Figure 30.12. When you install the Apache mod_ssl-* RPM, you get a series of fake keys in the /etc/httpd/conf directory, which are shown in the figure.
HYPERLINK "" \t "_blank" INCLUDEPICTURE "F:\\RH9 Linux help\\images\\f3012.jpg" \* MERGEFORMATINET
Figure 30.12: Secure Socket Layer settings
Logging
Next, select the Logging option on the left side of the window. This opens a series of options associated with logging and log files, as shown in HYPERLINK "file:///F:\\RH9%20Linux%20help\\ch30p552.htm" \l "figure.a4935dff-1e80-4d42-9330-b6c48ecb47e9#figure.a4935dff-1e80-4d42-9330-b6c48ecb47e9" Figure 30.13.
HYPERLINK "" \t "_blank" INCLUDEPICTURE "F:\\RH9 Linux help\\images\\f3013.jpg" \* MERGEFORMATINET
Figure 30.13: Virtual Host logging
The default log files are shown in the figure; the path is relative to the ServerRoot directive, normally /etc/httpd. Naturally, you may want to specify log files in special directories associated with the Virtual Host, such as mywebsite.abc/logs/access_log.
You can specify the information that goes into this log file in the Custom Log String text box. The information here is associated with the LogFormat directive described earlier in this chapter.
The options available in the Log Level drop-down list match those described earlier for the LogLevel directive: Emergency, Alert, Critical, Error, Warn, Notice, Info, and Debug.
You may want to make sure the Reverse DNS Lookup setting is set to No Reverse Lookup. Unless you have a reliable and speedy connection to a DNS server, finding the fully qualified domain names associated with an IP address could hurt your web servers performance.
Environment Variables
Next, select the Environment Variables option on the left side of the window. This opens a group of settings where you can set environment variables associated with CGI or SSI scripts, as shown in HYPERLINK "file:///F:\\RH9%20Linux%20help\\ch30p552.htm" \l "figure.1fd240d5-eadd-47d0-8d4d-e0b61e010f7d#figure.1fd240d5-eadd-47d0-8d4d-e0b61e010f7d" Figure 30.14.
HYPERLINK "" \t "_blank" INCLUDEPICTURE "F:\\RH9 Linux help\\images\\f3014.jpg" \* MERGEFORMATINET
Figure 30.14: Environment variables
While the principle is the same as regular environment variables in the shell, what you set here applies only to CGI and or SSI scripts.
Directory Options
Finally, select the Directories option on the left side of the window. This opens a group of settings where you can set the Options directive for various directories, as shown in HYPERLINK "file:///F:\\RH9%20Linux%20help\\ch30p552.htm" \l "figure.d2432b88-5c49-46d8-ab89-24831f4aa35e#figure.d2432b88-5c49-46d8-ab89-24831f4aa35e" Figure 30.15.
HYPERLINK "" \t "_blank" INCLUDEPICTURE "F:\\RH9 Linux help\\images\\f3015.jpg" \* MERGEFORMATINET
Figure 30.15: Directory options
The Options for the default directory are shown in HYPERLINK "file:///F:\\RH9%20Linux%20help\\ch30p552.htm" \l "figure.d2432b88-5c49-46d8-ab89-24831f4aa35e#figure.d2432b88-5c49-46d8-ab89-24831f4aa35e" Figure 30.15: ExecCGI, FollowSymLinks, Includes, IncludesNOEXEC, Indexes, and SymLinuxIfOwnerMatch (they are explained back in Table 30.5). You can edit the default settings by clicking the Edit button in the upper-right corner of the window.
You can specify Options for other directories. Click Add to open the Directory Options window shown in HYPERLINK "file:///F:\\RH9%20Linux%20help\\ch30p552.htm" \l "figure.2ca9100f-28a5-4ec4-b9ab-545ffbd3cf6b#figure.2ca9100f-28a5-4ec4-b9ab-545ffbd3cf6b" Figure 30.16. The options in this window are explained in HYPERLINK "file:///F:\\RH9%20Linux%20help\\ch30p552.htm" \l "wbpch30t11p11#wbpch30t11p11" Table 30.11.
HYPERLINK "" \t "_blank" INCLUDEPICTURE "F:\\RH9 Linux help\\images\\f3016.jpg" \* MERGEFORMATINET
Figure 30.16: Setting Options on a new directory
Table 30.11: Selections in the Directory Options Window SelectionDescriptionOrderSets the order of directives; the options are Allow from all; Order deny,allow; or Order allow,deny. Deny ListIf youre not allowing in all hosts, you can deny access to this directory to some or all hosts, by domain name or IP address.Allow List If youre not allowing in all hosts, you can allow access to this directory to some or all hosts, by domain name or IP address.DirectorySpecifies the directory to which the Options directive is to be applied.OptionsThe settings associated with the Options directive. .htaccess If you activate this setting, the AllowOverride directive is added to this directory.
Configuring the Server
There are some basic settings associated with each Apache server. Return to the Apache Configuration window and click the Server tab. The information should look similar to HYPERLINK "file:///F:\\RH9%20Linux%20help\\ch30p552.htm" \l "figure.8b64ac3a-77f1-4c0e-a7c9-11b2dd154c1c#figure.8b64ac3a-77f1-4c0e-a7c9-11b2dd154c1c" Figure 30.17. These settings are summarized in HYPERLINK "file:///F:\\RH9%20Linux%20help\\ch30p552.htm" \l "wbpch30t12p12#wbpch30t12p12" Table 30.12.
HYPERLINK "" \t "_blank" INCLUDEPICTURE "F:\\RH9 Linux help\\images\\f3017.jpg" \* MERGEFORMATINET
Figure 30.17: Apache configuration server settings
Table 30.12: Apache Configuration Server Settings SettingDescriptionLock FileThe file opened by Apache when it starts.PID FileAnother file opened by the Apache when it starts. Includes the PIDs associated with open httpd daemons.Core Dump DirectorySpecifies the directory for core dumps, which are used for debugging. Must be writeable by the user associated with the Apache server, normally apache.UserThe username associated with the Apache server.GroupThe group name associated with the Apache server.Performance Tuning
Several basic performance settings are associated with each Apache server. In the Apache Configuration window, click the Performance Tuning tab. The information should look similar to HYPERLINK "file:///F:\\RH9%20Linux%20help\\ch30p552.htm" \l "figure.1e2f8aca-106e-4a8f-8798-858e1295fc93#figure.1e2f8aca-106e-4a8f-8798-858e1295fc93" Figure 30.18. These settings are summarized in HYPERLINK "file:///F:\\RH9%20Linux%20help\\ch30p552.htm" \l "wbpch30t13p13#wbpch30t13p13" Table 30.13.
HYPERLINK "" \t "_blank" INCLUDEPICTURE "F:\\RH9 Linux help\\images\\f3018.jpg" \* MERGEFORMATINET
Figure 30.18: The Performance Tuning tab
Table 30.13: Apache Configuration Performance Settings SettingDescriptionMax Number Of ConnectionsCorresponds to the maximum number of clients who can connect to your web server simultaneously; sets the MaxClients directive.Connection TimeoutSets the time the web server waits for further communication from a client browser, in seconds; sets the TimeOut directive.Requests Per ConnectionLimits the number of requested items per connected browser; sets the MaxRequestsPerChild directive.Allow Persistent ConnectionsKeeps connections open to a browser, independent of TimeOut; if selected, the KeepAlive directive is set to true.Timeout For Next ConnectionSets the time which Apache waits for the next request from a client, if KeepAlive is true; sets the KeepAliveTimeout directive.
Run Applets in Mozilla :
On Linux, Mozilla requires JRE 1.4.2 or later.
Mozilla 1.4 and later, and Mozilla Firefox, are compiled with gcc 3.x. A gcc 3.x compatible version of the Java plugin must be used. JRE 1.4.2 and later contain a compatible plugin.
If you installed the JRE 5.0 RPM, this plugin is /usr/java/j2re1.5.0/plugin/i386/ns7/libjavaplugin_oji.so - and to install it for Mozilla (including Mozilla Firefox), do the following:
Open a terminal
Change to your Mozilla (or Mozilla Firefox) plugins directory
Issue the following command: ln -s /usr/java/j2re1.5.0/plugin/i386/ns7/libjavaplugin_oji.so
In JRE 1.4.2, this file was in plugin/i386/ns610-gcc32
Wlalk into sites:
My Sites Page (1_0.php):
The data table on this page shows all the sites and groups currently assigned to you. Click or double-click any of the sites or trended points to sort the information according to your needs. To add, edit or remove assigned sites or groups, consult the help boxes adjacent to the appropriate buttons.
Site Admin (1_1_1.php):
This page allows you to enter all relevant information about your site in order to best utilize RCS's many features. Be sure to include unique identifying information so that when you next log in, you will remember which site you are at. Make sure to at least enter a site name and address - you can always come back later to fill in the rest.
Controller Admin (1_1_3_1.php):
This page allows you to name and discern each individual controller from the others in your network. Complete the following information in order to get the most out of your RCS system.
Global Alarms (1_1_3_4.php):
This page allows you to utilize a set of template alarms to write to other controllers in the building network or over multiple sites in an enterprise. You can specify which alarm points to write, as well as the intended recipients to receive the alarms.
Controller Network Setup (1_1_3.php):
This page allows you to select or remove controllers and/or trended points that you would like to be a part of your RCS network.
Week Schedule/Day Schedule (1_1_4_1.php):
This page allows you to specify two different weekday (Monday-Friday) and weekend (Saturday-Sunday) "Occupied" settings for your controller. The occupied parameters that you set will apply to each weekday, and the same applies to your weekend settings.
Controller Programming (1_1_4.php):
RCS requires that you specify information that will allow each particular controller, or a group of controllers, to function properly. In order to accomplish this, descriptive information about each controller, scheduling and other essentials should be entered on this page.
Global Scheduling (1_1_5_1.php):
This page allows you to establish a specific group and its parameters to act as a master schedule for the sites that you wish. The information that you have specified for the master schedule group will serve as the information that will be entered for other sites that you have selected.
Week Schedule/Day Schedule (1_1_5.php):
This page allows you to specify two different weekday (Monday-Friday) and weekend (Saturday-Sunday) "Occupied" settings for your site. The occupied parameters that you set will apply to each weekday, and the same applies to your weekend settings.
Sub-System Setup (1_1_6.php):
The Sub-System Setup page is for configuring specific installations that require more than one controller working together sharing critical information. The administrator configures a Master Controller that dictates how all of the subordinate controllers work, typically in the scheduling functions. Possible Sub-System possibilities would be Loop Control, VVT Control, VAV Control, or general coordination with the controller network.
Site Summary (1_1.php):
This page contains your site summary. The information appearing below allows you to monitor a particular site and the controllers that are part of your network at that site, as well as alter or sort the information to suit your needs.
Add Group/Edit Group (1_2.php):
This page allows you to add or remove a site from or to a particular group. Or if you wish to edit the contents of a particular site or remove a group, these functions can be accomplished from this page.
Alarm Summary (2_1.php):
This page allows you to view selected information relating to specific alarms that you have chosen. You can select particular controllers or specific alarm trending points to view, along with other features to help you track information that is most helpful to you.
Advanced Graphing (2_4_1.php):
This page allows you to graphically compare two specific controllers and selected trended points. Select the controller, the trended point and time frame in order to view the information that you desire.
Data Table (2_4_2.php):
This page displays a printed display of the information that you have chosen to graph.
Graphing (2_4.php):
This page allows you to select controllers and particular trended points to graph, aiding you in analyzing your energy expenditures. You can also click on the controller or trended point to learn more about that specific detail.
User Log Summary (2_5.php):
The User Log summary allows you to view all activity that authorized users have executed to your system. Simply select the user(s) and time frame, and view the information.
User Admin (6_1_1.php):
This page allows you to setup or edit information and access for individual users.
Add/Edit Group (6_1_2.php):
This page contains your group summary. The information appearing below allows you to monitor a particular user and the level of access that the particular individual possesses. From this page, you can assign the user to particular sites or groups, as well as add or remove particular groups or sites from your system.
Users (6_1.php):
This page profiles the various users that have access to your RCS system. It includes pertinent information such as level of access, title within the company, contact information and login ID. Click or double click on any one of several categories to sort the user information to best suit your purposes.
Region Admin (6_2_1.php):
This page contains your regional administrator summary. The information appearing below allows you to monitor a particular region and the level of access that a particular administrator possesses. From this page, you can also add or remove a regional administrator.
Region Setup (6_2.php):
This page shows you all of the currently created regions. From this page, you can add a region, remove a region, edit information and conduct searches for given information on the page.
System Parameters (6_3.php):
This page outlines your system parameters. From here, you can establish system alarm actions, set passwords, define your RCS connection information, and much more.
My Info (6_4.php):
This page records and applies your user information, and allows you to establish or change your password.
Enterprise Admin (6_7.php):
The Enterprise Admin page allows you to dictate the appearance of RCS to all the Users. Administrators can also createannouncements that appear within the News Section.
Maintenance Admin (7_1_1.php):
This page allows you to add or alter information relating to a scheduled maintenance. Complete the information below as thoroughly as possible and click the "Submit" button when you are satisfied with the information you have provided.
Maintenance Summary (7_1_2.php):
This page contains a summary of all the information you should need to regularly schedule and complete maintenance of your system. Contact names and information, equipment information, scheduled maintenance dates and much more are provided for your convenience on this page.
Maintenance Schedule (7_1.php):
This page contains all the information you should need to regularly schedule and complete maintenance of your system. Contact names and information, equipment information, scheduled maintenance dates and much more are provided for your convenience on this page.
Equipment Admin (7_2_1.php):
This page serves as a general information site for the equipment that you have installed. From here, you can schedule maintenance, add or edit contact information, hardware specifications and much more. Complete the information below as thoroughly as possible and click the "Submit" button when you are satisfied with the information you have provided.
Equipment (7_2.php):
This page serves to summarize the equipment and its physical location. You are able to add, edit and remove equipment and information about it from this page.
Emergency Shutdown (10_0.php):
In the case of an extreme emergency, this procedure will shut down your controller network, including all equipment attached to the network. This should only be used in the instance of a catastrophic event that requires an extended power down time. In order to complete this action, you must enter your access codes.
Shutdown Selection (10_1.php):
After entering you access codes, you will be able to select specific parts of your enterprise to shut down. Or, if you desire, you can elect to shut down your entire enterprise.
Contact Confirm (12_1_1.php):
This page allows you to add a contact entry. Fill in the information below and click the "Submit" button.
Contact Admin (12_1.php):
This page contains contact information to schedule or obtain maintenance of your RCS system. You can also add, edit or remove contact information from this page.
News (13_0.php):
This page provides the news announced by administrators of the RCS sites .
Enterprise Admin (14_0.php):
This page provides you with a link to download the RCS manual in PDF format.
Suggestions (suggestions.php):
An alarm was triggered when a specified analog point went above the range that has been set. Verify that the programming of the alarm is correct or check to ensure that your equipment is operating properly. For further troubleshooting, we recommend that you contact a TCS/Basys Controls authorized technician.
Note:
Many of help boxes were added into the sites , to navigate all sites easily.
Graphic Navigation Capabilities
Graphic Navigation is defined as the ability for the user to utilize images and a point and click interface to navigate to specific information on their controller network. Navigation will begin at the Enterprise level and when then go down to the individual sites or controllers.
There are three Modes for the Graphic Navigation :
Building Mode This is where the user sets up his navigation, uploads his graphics and sets the appropriate icons in the right places. Users will be able to build layouts use simple drawing tools or they can upload graphics to use. They will be able to create numerous layouts and navigation that will allow them to navigate to different places by using a Hotspot tool. They will marquee (highlight) an area and then choose from a drop-down menu where they want that specified area to navigate to when the user clicks it. After RCS has auto detected the controllers in the building network they will appear on the bottom. Users will then in turn be able to drag these from the bottom and place them in work area where they deem appropriate. They will also have the option to use another graphic to represent the controller.
Building Mode
Monitoring Mode This is an active site. Users would navigate utilizing the hotspots on numerous layouts until they got to the site they wished. Once at the site, they could further navigate through images or schematics searching for the controller icons. They will immediately notice that the controllers are providing summarized data of the controller (i.e Controller name, Room Temperature, Occupancy Status, etc.). When the user rolls over the controller a menu will appear next to the pointer giving a complete summary of the monitoring information. There will also be tabs for modifying specific program settings or scheduling.
Monitoring Mode
Tree Mode This will provide a hierarchal textual tree that users can bypass all the navigation and go directly to the site they wish to see. It will look something roughly to a site map.
Sample Navigation from Enterprise to Region
These two screens to allow users to navigate through their sites starting from their states to their cities then to the region to reach the desired site.
These two screen are under construction.
APPENDIX
Appendix 1 - JAVA Servlet FUNCTIONS
All applets use a descriptive naming convention, where the nature of its function is reflected in its name. There are no spaces between each word in the file name, differentiation is made through the capitalization of the first letter of each word. After the file name it is followed by a .java, all lowercase.
Appendix 2 Classes, Includes and Styles in RCS / Share Sub-Directory
auth.inc
Included Classes
PageStyle
Class to define the styles. A style consists of a image directory structure and a set of stylesheets.
Functions Refer to the comments within the file for any details for functions.
getQD2040modeauth() Returns 1 if the server is on a QD2040, 0 otherwise.
PageStyle() Sets up an array for the different sections of the site.
SetStyles() Sets the Style.
GetStylesheetDir() Returns the directory for a specfic stylesheet in a specific section.
GetImageDir() - Returns the directory for the images specific to each section.
GetButtonDir()- Returns the directory for the button images.
GetDir() Utility function to get the entire directory name.
GetStyleID() Returns the id number for the style.
GetStyleName() Returns the style name.
UserAuth
Class to define and user variables. It also authenticates user logins.
Functions Refer to the comments within the file for any details for functions.
UserAuth() Sets up all the user variables.
HasAccess() Checks to see if the user has access.
InEnterprise() Checks to see if a site in is a specific enterprise.
GetRegionAccess() Returns the region access.
GetUserAccess() Returns the users access.
IsSiteAdmin() Checks to see if the user is a site admin.
BitIsSet() Utility function to check if a specific bit is set.
NewLog() Creates a new log
AddLog() Adds to current logs, but just adding a user log value.
SetCurrentSiteid() Sets the current siteid.
Redirect() Redirects to denied.php.
redirect2() Redirects to denied.php with a reason.
get_privacy_link() Returns the html for the privacy link.
controller.inc
controllergp.inc
countries.js
global.inc
Functions Refer to the comments within the file for any details for functions.
getQD2040mode() Returns 1 if the server is on a QD2040 and returns 0 otherwise.
getControllerImage() Returns the type of image the controller is if it is a user uploaded image. Otherwise it returns 0
getControllerImageHeight() Returns the height of the controller image if it is a user uploaded image.
getControllerImageWidth() Returns the width of the controller image if it is a user uploaded image.
menuheader() Function to create the top menu on the page.
logoheader() Function to display the banner logo on the top of the menu.
showdate() Function to show the date on the top of all pages.
getdatestring() Returns the date string to be displayed.
is_de_reserved_login() Checks to see if the login is a Direct Energy Reserved Login
is_integer_str() Checks to see if a character is an interger.
haspoints.inc
load_controller_image.php
load_image.php
log.inc
network.js
networka.js
posthost.inc
QD2040.txt
Appendix 3 Omni Database Table & Column Definitions
Definitions of tables and columns within the Omni Database.
Sites Table
Column NameColumn TypeDefaultColumn Definitionsiteid integer DEFAULT nextval('sites_siteid_seq'::text) NOT NULLThe unique id number for this site.sitename character varying(40)The user entered name of this siteadminid integer DEFAULT -1The id of the user that is the admin for this sitecity character varying(20) DEFAULT ''The city for this sitecounty character varying(20) DEFAULT ''The country for this sitestate character varying(4) DEFAULT ''The state for this siteregion character varying(20) DEFAULT ''The region this site is in(A user entered name)addr character varying(26) DEFAULT ''The street address for this sitezip character varying(10) DEFAULT ''The zip code for this siteinit boolean DEFAULT falseimage character varying(20)timezone character varying(6)The timezone for this siteareacode character varying(5) DEFAULT ''The area code for this sitealmcount smallint DEFAULT 0phone character varying(12) DEFAULT ''The phone number for this siteext character varying(5) DEFAULT ''The extention on the phone numbereprise integer DEFAULT -1The enterprise this site is inregionid integer DEFAULT -1The id for the region this site is incorp_sn character varying(20) DEFAULT ''Corporate Store Numbercorp_ds character varying(20) DEFAULT ''Corporate Districtcorp_rg character varying(20) DEFAULT ''Corporate Regionbldg_owtn smallint DEFAULT 0Building Owner Typebldg_sqft smallint DEFAULT 0Building Square footagebldg_nmfl smallint DEFAULT 0Number of floors in the buildingbldg_nmrm smallint DEFAULT 0Number of rooms in the buildingcountry character varying(30) DEFAULT ''The country this site is in
User Table
Column NameColumn TypeDefaultColumn Definitionlogin character varying(15)No DefaultThe login name for this userpassword character varying(15) DEFAULT 'password'The password for this userreal_name character varying(30) DEFAULT 'real_name'The real name for this useruseridinteger DEFAULT nextval('users_userid_seq') NOT NULL,Unique value for each user. This is the index for the user in other tablesisadminbooleanDEFAULT falseThis user is an adminowneridintegerNo DefaultThe userid of the user that created this user. This is still stored, but may not be used anymore.titlecharacter varying(26)No DefaultTitle for the useremailcharacter varying(50)No Defaultemail addressphcharacter varying(16)No DefaultPhone NumberepriseintegerDEFAULT -1Enterprise this user belongs tolevelsmallintDEFAULT 20=User, 1=Region Admin, 2=SuperUserscopesmallintDEFAULT 2Not used anymoreaddrcharacter varying(26)DEFAULT ''Address for this userzipcharacter varying(10)DEFAULT ''Zip code for this usercitycharacter varying(20)DEFAULT ''City for this userstatecharacter varying(4)DEFAULT ''State for this userregionidintegerDEFAULT -1The region this user is incountrycharacter varying(30)DEFAULT ''Country for this userstylescharacter varying(30)DEFAULT ''The style the user has selected for the RCS pages
Appendix 4 Site Database Table & Column Definitions
Definitions of tables and columns within the Site Database.
Network Table
Column NameColumn TypeDefaultColumn DefinitionaddrsmallintNo DefaultThe numerical address of the controllercontidsmallintNo DefaultThe id of the controller. This describes the type of the controllercontnamecharacter varying(30)No DefaultThe name the user enters for the controllergroupidintegerNo Defaultlocationcharacter varying(30)No Defaultcomm_enbooleanNo Defaultcomm_failsmallintNo Defaultmaster_schedbooleanNo Defaultoa_sharingbooleanNo DefaultmanagedbooleanNo Defaultparam_statussmallintNo Defaultsched_statussmallintDEFAULT 0spadjsmallintDEFAULT 0sptimebigintDEFAULT 0schedsmallintDEFAULT 1is_commbooleanDEFAULT trueprioritysmallintDEFAULT 5sys_indexsmallintDEFAULT -1versionsmallintDEFAULT 0spadjmaxsmallintDEFAULT 5sptimemaxintegerDEFAULT 120
W X d e ߿q]qq]q]qQ h> 6>*CJ( ]aJ( &h-] h-] 6>*B*CJ( ]aJ( ph #h-] h-] 6B*CJ( ]aJ( ph &h-] h-] 6>*B*CJ( ]aJ( ph3f &h-] h-] 6>*B*CJ( ]aJ( ph3f &h-] h-] 6>*B*CJ( ]aJ( ph h-] 6>*CJ( ]aJ( &h hRG 6>*B*CJ( ]aJ( ph33 &h h-] 6>*B*CJ( ]aJ( ph33 hRG 6>*CJ( ]aJ( 6 7 W X d e $A$ a$gd-] $A$ a$gdRG $A$ a$gdEB + x y
t $ A$ gdtum $ A$ gdC $ A$ gdEB $A$ a$gdEB $A$ a$gdRG $A$ a$gd> + x y
z { t u ٴَÇٙÇÇsdsdه`sd htum hcU htum 6>*CJ$ ]aJ$ htum 6>*CJ$ ]aJ$ htum CJ aJ hC htum hpz hEB CJ aJ hEB 6>*CJ$ ]aJ$ hcU hEB 6>*CJ ]aJ hcU hEB 6>*CJ$ ]aJ$ hC hEB hEQC hEB 6>*CJ$ ]aJ$ hEB CJ aJ hEQC hEB 6>*CJ ]aJ hEQC hEB 6>*CJ( ]aJ( %t u c d A O \ h $ 7$ 8$ A$ H$ gdpyK $ 7$ 8$ A$ H$ gdfF $ 7$ 8$ A$ H$ gd{ ) $ A$ gd{ ) $ A$ gdtum c d ( 9 p ! | ~ ̨̯̯̿r^QQQJF hfF hC hfF hC hpyK PJ nHtH &hfF CJ OJ PJ QJ ^J aJ nHtH ,hfF hfF CJ OJ PJ QJ ^J aJ nHtH ,hfF 5CJ OJ PJ QJ \^J aJ nHtH hpyK CJ aJ hC h!*8 hC h{ ) 6PJ ]nHtH hC hfF PJ nHtH hC h{ ) PJ nHtH ,h{ ) 5CJ OJ PJ QJ \^J aJ nHtH h{ ) CJ aJ htum CJ aJ ! F ~ \ # $ &