(file) Return to README CVS log (file) (dir) Up to [Pegasus] / pegasus / cgi

  1 a.dunfey 1.6.2.1 //%2006////////////////////////////////////////////////////////////////////////
  2                  //
  3                  // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
  4                  // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
  5                  // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
  6                  // IBM Corp.; EMC Corporation, The Open Group.
  7                  // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
  8                  // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
  9                  // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 10                  // EMC Corporation; VERITAS Software Corporation; The Open Group.
 11                  // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 12                  // EMC Corporation; Symantec Corporation; The Open Group.
 13                  //
 14                  // Permission is hereby granted, free of charge, to any person obtaining a copy
 15                  // of this software and associated documentation files (the "Software"), to
 16                  // deal in the Software without restriction, including without limitation the
 17                  // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 18                  // sell copies of the Software, and to permit persons to whom the Software is
 19                  // furnished to do so, subject to the following conditions:
 20                  // 
 21                  // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 22 a.dunfey 1.6.2.1 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 23                  // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 24                  // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 25                  // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 26                  // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 27                  // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 28                  // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 29                  //
 30                  //==============================================================================
 31 mike     1.1     
 32 a.arora  1.5     
 33 karl     1.3     The Pegasus WEB Demonstration
 34 a.arora  1.5     =============================
 35 mike     1.1     
 36 karl     1.4     
 37 a.arora  1.5     TABLE  OF  CONTENTS
 38                  ===================
 39                  
 40                  1. Introduction
 41                  2. How to setup Pegasus
 42                  3. How to setup Apache webserver
 43                  4. How to setup the Pegasus webdemo 
 44                  5. How to start the Pegasus webdemo
 45                  
 46                  
 47                  1. Introduction
 48                  == ============
 49                   This readme talks about the steps to setup Pegasus, Apache webserver and the
 50                   Pegasus webdemo on Windows and Linux platforms.
 51                   The pegasus/cgi directory contains the HTML CGI interface to Pegasus. It is 
 52                   used as part of a demonstration of the Pegasus environment through a WEB 
 53                   browser.
 54                  
 55                   It consists of two** subdirectories:
 56                   1. htdocs : This directory contains the HTML forms that form the basis of the
 57                               demonstration. The starting point for the demo is index.html
 58 a.arora  1.5      
 59                   2. cgi-bin: This directory contains the CGI executables.  This consists of the
 60                               Pegasus CGIClient.exe program and the supporting shared libraries.  
 61                               We have placed them in this directory despite the fact that they 
 62                               also exist in the PEGASUS_HOME/bin directory to limit exposure to 
 63                               other executables through CGI and to avoid a permanent path the                   
 64                               $PEGASUS_HOME$/bin directory when Apache is executing.
 65                    **There is a third directory "icons" which has the logo for "Open Groups".
 66                  
 67                   This demonstration uses the HTML pages in htdocs as forms to generate CGI
 68                   requests through the WEB Server.  These requests are serviced by the Pegasus
 69                   CGIClient executable (copied to "cgi-bin" directory by the Makefile in this 
 70                   directory). CGIClient, in turn converts the CGI forms input to Pegasus CIM  
 71                   Operations C++ calls. The Pegasus client library converts the calls to XML 
 72                   conforming with the DMTF CIM Operations over HTTP specifications and passes 
 73                   them to the Pegasus CIM Server.
 74                  
 75                   The CIM server responses in XML are interpreted by the CGI client (part of the  
 76                   SDK code) which then generates appropriate HTML responses and passes them back 
 77                   to the WEB server.
 78                  
 79 a.arora  1.5      NOTE: By default, the CGIClient fixes the address and port of the CIM server as
 80                   ----   URL  : localhost
 81                          Port : 5988
 82                         This can be changed by using "Define Host" option provided in the demo.
 83                  
 84                   If you have already got Pegasus installed and configured, please jump to
 85                   "3. How to setup Apache webserver". 
 86                  
 87                  
 88                  
 89                  2. How to setup Pegasus
 90                  == ===================
 91                     A. On Windows platform
 92                     -- -------------------
 93                        Environment setup:
 94                        ==================
 95                        1. MS Visual Studio VC++ (tested on .NET  2003 (Version 7.1))
 96                        2. A CVS client (say WinCVS 1.2 @ http://www.wincvs.org/download.html) 
 97                        3. GNU-make 3.79 for Windows (@ http://ftp.gnu.org/pub/gnu/make/)
 98                           It should be compiled using NMake (NMake comes with VC++). For details
 99                           on how to work with NMake, please refer to Readme file(s) which comes
100 a.arora  1.5              with the GNU-make source code.
101                           NOTE: The latest GNU-make for Windows can also be found at 
102                           ----  "http://www.openpegasus.org/pb/index.tpl".
103                            
104                          
105                        Downloading Pegasus source tree:
106                        ================================
107                        There are two options for downloading Pegasus source code:
108                        1. Source from CVS:
109                           Download Pegasus sourcetree from www.pegasus.org (say in <Drive>:\<pegtop>).
110                           If using WinCVS to download, please use following settings:
111                            a>  Go to "Admin" menu option and select "Preferences"
112                            b>  In "General" tab, set CVSROOT  to ":pserver:anon@cvs.opengroup.org:
113                                /cvs/MSB"
114                            c>  Set Authentication to '"passwd" file on CVS server' (this option is
115                                there in "General" tab under Admin->Preferences).
116                            d>  In "WinCVS" tab (again, under Admin->Preferences) set  Home to 
117                                "<Drive>:\<pegtop>"
118                            e>  Go to "Admin" menu option and select "login"
119                            f>  Give "anon" as the password when prompted
120                            g>  Type "cvs checkout pegasus"  in the command line menu option under 
121 a.arora  1.5                   "Admin".
122                        2. Source from www.openpegasus.org
123                           There is a snapshot of the latest release of Pegasus (eg. Pegasus 
124                           2.3.1) on the pegasus home page http://www.openpegasus.org. The release  
125                           is present under the Recent Documents (eg. "Release 2.3.1 - zip format 
126                           (Windows)"). You may download the source from this link.
127                        
128                        
129                  
130                        Building Pegasus:
131                        =================
132                        1. Export following environment variables with suitable values.
133                           For an example:
134                            set  PEGASUS_ROOT=<Drive>:/<pegtop>/pegasus
135                            set  PEGASUS_HOME=<Drive>:/<pegtop>/pegasus
136                            set  PEGASUS_PLATFORM=WIN32_IX86_MSVC
137                           NOTE: a> You might have to use "\" in the path instead of "/". 
138                           ----  b> These variables can be exported from the command window 
139                                    manually each time you need to compile/run Pegasus, or you can 
140                                    add them as "System Variables" in "My Computer" -(right 
141                                    click)->"Properties"-->"Advanced"--> "Environment variables".
142 a.arora  1.5           2. Make sure that you execute "vsvars32.bat" ("vcvars32.bat" in Visual
143                           Studio 6.0) file (comes with Visual Studio) every time you open a new
144                           command prompt Window before issuing any compilation (NMake or make).
145                           Or else, you may also set PATH environment variable to point to Visual
146                           Studio paths.
147                        3. Compile MU.exe  (Unix-commands emulator for Windows) by issuing a make 
148                           in the "<Drive>:\<pegtop>\pegasus\src\utils\mu" folder. Make sure that
149                           MU.exe exists in "<Drive>:\<pegtop>\pegasus\bin" folder. If not, copy
150                           it here.
151                        4. Add "<Drive>:\<pegtop>\pegasus\bin"  directory to the PATH environment 
152                           variable.
153                        
154                        5. Issue following commands in pegasus home directory 
155                           (<Drive>:\<pegtop>\pegasus)
156                            a>  make : (This comand may take 10 to 30 minutes depending on your 
157                                        machine's configuration. If you don't see any error message
158                                        on the screen, the compilation would have gone fine. You
159                                        may still confirm this by checking for "cimserver.exe" file
160                                        in "<Drive>:\<pegtop>\bin" path. In case of any error, check
161                                        the error message on the screen and try to correct it. Some
162                                        of the common problems faced are: 
163 a.arora  1.5                           i > "cl.exe : File Not Found." (This implies that you haven't
164                                                   executed step# 2).
165                                        ii> "<Drive>:<pegtop><some-path>  Not Found" (Try changing the
166                                                   slash in the path exported by PEGASUS_HOME. If using
167                                                   "/", replace it with "\" and vice-versa.
168                                        iii> For some other error, try to solve it, or else you may ask
169                                             your query on "pegasus-l@opengroup.org" mailing list
170                                             giving a detailed description of the problem (preferably 
171                                             with some snapshots).
172                                     
173                            b>  make repository : (This command may take 5 to 10 minutes, again
174                                        depending on your machine's configuration.
175                            c>  make tests (optional) : (This command may take roughly 5 minutes).
176                  
177                        Starting the CIM Server:
178                        ========================
179                        1. From Command prompt, type cimserver. This would start it (inorder to 
180                           stop issue "cimserver -s" command). You can issue "cimprovider -l" 
181                           command to verify that the cimserver is running fine. This command 
182                           would tell you if the server is not running.
183                        2. There are various command line clients present in pegasus which 
184 a.arora  1.5              provide/configure some of the basic features of the cimserver. Some of 
185                           these are:
186                           cimconfig  - To list/change/setup configuration parameters for 
187                                        cimserver.
188                           cimprovider- To list/load/unload/delete/ various providers.
189                           cimmof     - This command operates through the client interface and  
190                                        acts as a remote compiler for MOF files against an active 
191                                        CIM Repository.                    
192                           cimmofl    - This command is also used to compile the MOF files, but it 
193                                        operates locally and directly against the repository.
194                           cimauth    - For configuring/ listing authorization support.
195                           cimuser    - For listing/adding/deleting/modifying users to access the 
196                                        pegasus repository.
197                        3. There is a command line utility CLI for running individual cim 
198                           operations.
199                           "CLI -h" to get help for the usage of this client.
200                  
201                  
202                  
203                     B. On Linux Platform
204                     -- -----------------      
205 a.arora  1.5           Environment setup:
206                        ==================
207                        RedHat Linux 8.0 on IA32 with gcc-3.x
208                  
209                        Downloading Pegasus source tree:
210                        ================================
211                        There are 2 options for downloading pegasus sources on your local machine:
212                        1. Source from CVS.
213                           Commands for fetching the Pegasus source code using CVS are:
214                            a> Export the CVSROOT environment variable:
215                               "export CVSROOT=:pserver:anon@cvs.opengroup.org:/cvs/MSB"
216                            b> Run "cvs login" command. When it prompts for the password give 
217                               "anon".
218                            c> Execute "cvs checkout pegasus".
219                           NOTE: Refer the note in "How To Setup the Pegasus WebDemo (on Linux)" 
220                           ----  for selecting the path where Pegasus code should be put.
221                           Once the source tree has been checked out it can be updated regularly
222                           (as required) by running "cvs update -d".
223                        2. Source from www.openpegasus.org
224                           There is a snapshot of the latest release of Pegasus (eg. Pegasus 
225                           2.3.1) on the pegasus home page http://www.openpegasus.org. The release 
226 a.arora  1.5              is present under the Recent Documents (eg. "Release 2.3.1 - compressed 
227                           tar format (Linux)"). You may download the source from this link.
228                                  
229                        
230                        Setting up Pegasus
231                        ==================
232                        1. Open .bash_profile in your home directory  ~<username>/.bash_profile
233                  
234                        2. Write the following statements into .bash_profile in order to setup 
235                           Pegasus variables (replace <pegtop> with the path where you want to put 
236                           Pegasus source tree):
237                            PEGASUS_HOME=/<pegtop>/pegasus/
238                            PEGASUS_ROOT=/<pegtop>/pegasus/
239                            PEGASUS_PLATFORM=LINUX_IX86_GNU
240                            export PEGASUS_HOME PEGASUS_ROOT PEGASUS_PLATFORM
241                            export PATH=$PATH:/<pegtop>/pegasus/bin
242                  
243                           NOTE: You may keep the PEGASUS_HOME and PEGASUS_ROOT as different 
244                           ----  paths. This would allow you to install the binaries, libraries 
245                                 and the repository in a different path and not in the same path 
246                                 as the Pegasus source code. If they are different, please make 
247 a.arora  1.5                    sure that the paths exist.
248                        3. Logout and Re-login to your account and change directory to 
249                           pegasus/(the one we created in the step above).
250                           [The logout and login is to make sure that your .bash_profile is 
251                           executed so that the PEGASUS_XXXX variables are set to their respective 
252                           values. You may also execute .bash_profile manually 
253                           (". ~/.bash_profile") thus avoiding the logout/login process.]
254                        4. Check your system if gcc-3.x is installed. Run "g++ --version" to check 
255                           the version. If you are using Redhat linux then it would show something 
256                           like this: "g++ (GCC) 3.2 20020903 (Red Hat Linux 8.0 3.2-7) Copyright 
257                           (C) 2002 Free Software Foundation, Inc. This is free software; see the 
258                           source for copying conditions. There is NO warranty; not even for 
259                           MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
260                  
261                        Building Pegasus
262                        ================
263                        1. Change directory to the one in which pegasus sources are present and 
264                           execute "make" OR "make 2>&1 | tee make.log" 
265                           [The command "make 2>&1 | tee make.log" is just to keep a build log for 
266                           your reference, and is not mandatory. This log may be helpful in 
267                           detecting problems that might arise during build.
268 a.arora  1.5           2. Run "make repository" OR "make repository 2>&1 | tee make-
269                           repository.log". This will create a directory repository/ under the 
270                           PEGASUS_ROOT directory, which contains the classes and instances for 
271                           all namespaces present in the project. All the MOFs are compiled during 
272                           this "make repository", and the XMLs generated are put in the  
273                           "repository" directory.
274                        3. To execute all the basic tests present in Pegasus sources, execute  
275                           "make tests" and execute "make -f TestMakefile tests" to run all the 
276                           tests specified in the TestMakefile.
277                  
278                  
279                        Starting the CIM Server:
280                        ========================
281                        1. To start the pegasus server just run: "cimserver" 
282                           You may use "cimprovider -l" command to verify if the cimserver is
283                           running or not.
284                           To stop: "cimserver -s".
285                           [Remember: To stop the cimserver you need to have root access. If you
286                           started the cimserver from a non-user account you will have to 
287                           explicitly kill it by issuing "killall cimserver"]
288                        2. There are various clients present in pegasus which provide/configure 
289 a.arora  1.5              some of the basic features of the cimserver. Some of these commands 
290                           are:
291                           cimconfig  - To list/change/setup configuration parameters for 
292                                        cimserver.
293                           cimprovider- To list/load/unload/delete/ various providers.
294                           cimmof     - This command operates through the client interface and 
295                                        acts as a remote compiler for MOF files against an active 
296                                        CIM Repository.                    
297                           cimmofl    - This command is also used to compile the MOF files, but it 
298                                        operates.
299                                        locally and directly against the repository.
300                           cimauth    - For configuring/ listing authorization support.
301                           cimuser    - For listing/adding/deleting/modifying users to access the 
302                                        pegasus repository.
303                        3. There is a command line utility CLI for running individual cim 
304                           operations.  Execute "CLI ?" to get a list of operations supported by 
305                           pegasus currently.
306                           "CLI -h" to get help for the usage of this client.
307                  
308                  
309                  3. How to setup Apache webserver
310 a.arora  1.5     == =============================
311                     A. On Windows platform
312                     -- -------------------
313                        Download and install Apache webserver (Httpd) (binary version) for Windows 
314                        from www.apache.org (http://httpd.apache.org/download.cgi).
315                   
316                     B. On Linux platform
317                     -- -----------------
318                        Download the Apache webserver (Httpd) code for Linux from www.apache.org
319                        (http://httpd.apache.org/download.cgi).
320                        Follow the instructions in the README file to build and install Httpd.
321                   
322                  
323                  
324                  4. How to setup the Pegasus webdemo 
325                  == ================================
326                     A. On Windows platform
327                     -- -------------------
328                        Modify the httpd.conf (this file can be found in "<apache-install-dir>\conf"
329                        folder) Apache configuration file with the following Entries (do not forget
330                        to replace <pegtop> with the path where you have put the Pegasus source code):
331 a.arora  1.5     #PEGASUS
332                  ScriptAlias /pegasus/cgi-bin/CGIClient "<Drive>:/<pegtop>/pegasus/cgi/cgi-bin/CGIClient.exe"
333                  ScriptAlias /pegasus/cgi-bin "<Drive>:/<pegtop>/pegasus/cgi/cgi-bin"
334                  Alias /pegasus/icons "<Drive>:/<pegtop>/pegasus/cgi/icons"
335                  Alias /pegasus "<Drive>:/<pegtop>/pegasus/cgi/htdocs"
336                  
337                  <Directory "<Drive>:/<pegtop>/pegasus/cgi/cgi-bin">
338                  AllowOverride None
339                  Options ExecCGI
340                  allow from all
341                  </Directory>
342                  
343                  
344                     B. On Linux platform
345                     -- -----------------
346                        Modify the httpd.conf (it can be found in "<Apache-install-path>/conf"
347                        directory. The default value of <Apache-install-path> is "/usr/local/apache")
348                        Apache configuration file with the following Entries (do not forget to replace
349                        <pegtop> with the path where you have put the Pegasus source code) :
350                  #PEGASUS
351                  ScriptAlias /pegasus/cgi-bin/CGIClient "/<pegtop>/pegasus/cgi/cgi-bin/CGIClient"
352 a.arora  1.5     ScriptAlias /pegasus/cgi-bin "/<pegtop>/pegasus/cgi/cgi-bin"
353                  Alias /pegasus/icons "/<pegtop>/pegasus/cgi/icons"
354                  Alias /pegasus "/<pegtop>/pegasus/cgi/htdocs"
355                  
356                  <Directory "/<pegtop>/pegasus/cgi/cgi-bin">
357                  AllowOverride None
358                  Options ExecCGI
359                  allow from all
360                  </Directory>      
361                        
362                        NOTE: Please make sure that each directory in the path "/<pegtop>/pegasus
363                        ----  /cgi/cgi-bin/" has execute permission for "nobody" user (Apache 
364                              httpd uses this userid to access files on the server, when a client 
365                              request comes in). This can be done by giving "x" permission in 
366                              "others" for all the directories. 
367                              Giving execute permission to all the directories may be a security
368                              concern for some users when they have the Pegasus source tree in 
369                              their home directories. In this case, there are two options:
370                               1> Put the Pegasus source tree in some other path (eg. "/pegasus"), 
371                                  and not in home directory.
372                               2> Copy the entire cgi directory tree from "/<pegtop>/pegasus/cgi" 
373 a.arora  1.5                     to put it in some path where you can give execute permission to 
374                                  "others".
375                  
376                  
377                  5. How to start the Pegasus webdemo
378                  == ================================
379                       A> Give a "make" in <pegtop>/pegasus/cgi to get the necessary executables
380                          copied (CGIClient program, etc) to cgi-bin.
381                       B> Open a web-browser from a client machine and put the following URL in it:
382                          "http://<host-addr>/pegasus"
383                          where <host-addr> can be the "localhost" (if the client machine is same
384                          as the server), or a valid IP address of the server (machine hosting 
385                          the Pegasus webdemo and the Apache server).
386                       C> You would see the index.html (under pegasus/cgi/htdocs path) loaded in the
387                          browser. Follow the instructions mentioned and have fun !
388                       
389 karl     1.3     

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2