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.
P4Web is available for Macintosh, Windows, and Unix. For download information, please go to the Perforce Downloads page.
Download the p4web executable for your Unix platform, and put it in a directory in your path. If you are installing it for everyone to use, put it in /usr/local/bin or equivalent. Make sure the p4web file has execute permission.
If you do not already have p4 (the Perforce command line client) on your system, download the executable from the Perforce Downloads page and install it.
Download the P4Web installer program, perforce.exe, and run it on your Windows workstation. When prompted, select User installation. This option installs the P4Web executable, p4web.exe and the Perforce command line client, p4.exe, if it is not already installed.
If you have administrative permissions, you can install P4Web to run as a service on your Windows machine.
Download the P4Web installer program, perforce.exe, and run it on your Windows workstation. When prompted, select one of the following options:
The port number that P4Web uses when running as a service is specified by setting the environment variable P4WEBPORT. When using P4Web as a service, point your browser to: http://localhost:P4WEBPORT.
To change the user when running P4Web as a service, you must first stop the service, then set the user, then start the service again. At the DOS prompt, issue the following commands:
There are two ways to start P4Web: on Windows as a service, or on all supported platforms from the command line.
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.
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. |
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:
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).
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).
To stop a P4Web program:
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:
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: