P4Web Release 2007.3 User Guide
[Getting Started]  [How To...]  [Browser Tips]  [Glossary]  [Road Map]  

Administering P4Web

This topic covers the following aspects of P4Web administration:

P4Web is a Perforce client program that runs on any platform. It can be used either in Standard mode or Viewer mode:

P4Web communicates with the Perforce server using the Perforce C++ API. It also communicates with your web browser, sending HTML and receiving URL requests and form input. To your web browser, P4Web looks like a web server. To a Perforce server, P4Web looks like any other Perforce client program.

Installing P4Web

P4Web is available for Macintosh, Windows, and Unix. For download information, please go to the Perforce Downloads page.

Starting P4Web

There are two ways to start P4Web: on Windows as a service, or on all supported platforms from the command line.

Starting the Windows service

On Windows, you can start the P4Web you configured during installation by choosing Start>Programs>Perforce>P4Web. You can also start a P4Web with an alternate configuration using the p4web command, as described below. Run p4web in the Start>Run window or by issuing the p4web command at the DOS prompt.

If you are running P4Web as a service on Windows, P4Web is started immediately after you install it. To verify that it has started, go to the Windows Control Panel. Under Administrative Tools>Component Services, click on Services and find Perforce Web. If P4Web is not started, click Start the service in the left-hand column.

Invoking from the command line

To start an instance of P4Web, invoke p4web, specifying desired options using the following command line flags:

Command line flag Description
-b Specifies Viewer mode. Users are not prompted to enter a password to connect to P4Web. However, if your user name requires a password when accessing Perforce, specify that password using the -P flag when you start P4Web. The default mode is Standard mode, in which P4Web can read and write files in a client workspace on the local machine.
-B Specifies Viewer mode plus authentication. You are prompted to enter a password upon starting P4Web.
-C charset Character set to be used for translation of Unicode files.
-c client Specifies the Perforce client workspace to be used to connect to the Perforce server.
-h Displays the p4web command line flags but does not start the program.
-H host Specifies the Perforce client workspace host machine. Because the client workspace resides on the machine where P4Web is running, there is typically no need to specify this flag.
-l Accept connections only from a browser running on the local machine. By default, P4Web accepts connections from an authorized browser on any machine. (See Passwords and Authorization for more information.)
-L logfilename Log all requests sent to P4Web to the specified file.
-p host:port Perforce server host and port number. Defaults to your local host machine and port 1666.
-P password Specifies the password for the Perforce user to be used to connect to the Perforce server. Note: This option can only be used with the -B flag
-soptions

Specifies security-related options. Specify all options in a single instance of the -s flag, for example -saBD. (Note: Remote users are users whose browser is running on a different machine than the machine where P4Web is running). Options are as follows:

  a Prevent remote users from switching client workspaces
B Enable remote users to use client workspaces that have no owner
D Enable remote users to create client workspaces. Note: by default, client workspaces created by local users are assigned a client root that cannot be edited. To enable local users to edit the client root, specify -sD.
E Enable remote users to edit the Root, Altroots and Owner fields in client workspace specifications
F Enable display of startup flags to remote users
i Disable integration
L Enable remote users to create, edit, and resolve symlinks
N Enable remote users to use null-rooted client workspaces
P Enable remote users to use the recursive wildcard (...) in client workspace views
q Disable the display of Revision History. Note: When you disable the display of Revision History, P4Web displays links to the file contents on the Path Browser page. This feature enables you to use P4Web in viewer mode as a document server. In Standard mode, you can browse your client workspace on the system where P4Web is running. When you are in Depot View, all Path Browser links take you to the depot version of the file. In Workspace View, all Path Browser links take you to the local version of the file.
r Disable the p4 commands feature
s Generate https links instead of http links. (See Configuring P4Web with https for more information.)
w Suppress the display of client workspace links to files to remote users
x Suppress the display of users' email addresses to remote users
-T tabs Specifies the tabs to be displayed. Specify the first letter of the each of the desired tabs. If you omit the Files tab, the first tab you specify is the first tab that is displayed in your browser. The Setting tab cannot be hidden.

Example: p4web -T fps displays the Files, Pending and Submitted Changelist tabs.

An additional, previously hidden tab might be displayed, if it is linked from some other page. For example, -Tf displays the Submitted Changelist tab if you click a changelist number on the Revision History page. When you click on the Files tab, the Submitted Changelist tab is hidden again.

-u user Specifies the Perforce user name to be used to connect to the Perforce server. Note: This option cannot be used with the -B flag.
-U username Mandatory on UNIX systems if you start P4Web as root. For security purposes, P4Web drops its root privileges after binding to its listen address.
-V Displays version information but does not start P4Web.
-w port Specifies the port on which P4Web accepts browser requests. On Windows and Macintosh, the default port for P4Web is 8080. On UNIX and related platforms, the port used by P4Web is the 5000 plus the P4Web user's UID. For example, if the user's UID is 525, then, by default, P4Web uses port 5525. You can start multiple instances of P4Web using on different port numbers regardless of the port number chosen during installation. To override the default port, specify another port using the -w option.

Configuring P4Web with https

To specify that all links generated in a P4Web page are https links, start P4Web with the -ss flag. Note that P4Web does not accept https requests. To convert https requests to http so P4Web can process them, use an https converter such as stunnel. P4Web RSS feeds also support https, if you configure stunnel to provide valid certificates and if your RSS reader accepts https requests.

For example, to set up stunnel with P4Web on Windows:

  1. Download and install stunnel from http://www.stunnel.org/
  2. Create a text file called stunnel.p4web, containing the required configuration settings. For example, on Windows, enter the following settings:
        [vpn]
        accept = 8080
        connect = 8081
        TIMEOUTclose = 0

  3. Start stunnel. Example (full paths required):   c:\\stunnel\\stunnel c:\\stunnel\\stunnel.p4web
  4. Start p4web. Example:   c:\\perforce\\p4web -w 8081 -ss
Direct your P4Web users to browse to https://stunnelhost:8080.

Connecting to P4Web

To connect to an instance of P4Web, enter the following URL in the addess bar of your browser:

http://localhost:nnnn/   (where nnnn is the port on which p4web accepts browser requests.)
The Perforce server port address is set in the environment variable P4PORT, unless you are running P4Web as a service on Windows. If you are running P4Web as a service, the port address is set in the environment variable P4WEBPORT.

Note: If your browser and P4Web are running on different machines, specify the name of the machine where P4Web is running instead of "localhost". When prompted, enter your Perforce username and password (if any).

Using P4Web from remote machines

P4Web mediates between a Web browser and a Perforce server. You can run P4Web on a machine that is separate from both the browswer and server machines. The important thing to understand is that your client workspace resides on the machine where P4Web is running, and not the machine where the browser is running (unless they are the same machine).

Stopping P4Web

To stop a P4Web program:

Configuring the P4Web favicon

A favicon (short for "favorites icon") is an icon associated with a particular website or webpage. To override P4Web's default favicon, either add the desired icon as //depot/favicon.ico or set P4WEBFAVICON to the depot path of the desired icon file in your depot. The favicon is served to Firefox and Safari browsers, and to Opera browsers unless the user was logged into the browser session using a cookie. (Opera fails to serve the cookie when it requests /favicon.ico so the internal version will be served instead. For details about why P4Web uses cookies to log users in, see the P4Web release notes.)

To enable Internet Explorer to display the P4Web favicon, you must be running version 6 or higher. To display the icon, your users must perform the following steps:

  1. Clear the Internet Explorer cache.
  2. Clear the cookies associated with the host where P4Web is running.
  3. Clear history associated with that host.
  4. Restart Internet Explorer.
  5. Additional step for Internet Explorer 6: Add the page to your favorites. If you already have the page in your favorites folder, remove it and add it again. The favicon is displayed in the URL field when you open the page using the Favorites menu.

User Documentation

After you've pointed your browser to P4Web, use its online help to view the user documentation. You can also access the online help from the Perforce web site, as follows:


Copyright 2007 Perforce Software. All rights reserved.