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

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2