P4Web Release 2007.2 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, issue the p4web command. The p4web command syntax is as follows:

p4web [-w port] [-b or -B] [-l] [-ss] [global_options] [-h] [-V] [-L logfilename]

For more information about these flags, see the Perforce Command Reference.

Other flags:

  • The -h flag displays the p4web command flags but does not start the program.

  • The -V flag displays p4web version information but does not start the program.

    When P4Web starts, it displays the Perforce user, client, and server port it is using, and the URL to be used by browsers to connect to the instance.

    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.

    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.

    P4Web RSS feeds also support https, if you configure stunnel to provide valid certificates and if your RSS reader accepts https requests.

    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.

    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 your P4Web's port address.)
    The 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 runing 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).

    Stopping P4Web

    To stop a P4Web program:

    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.