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:
To your web browser, P4Web looks like a web server. To a Perforce server, P4Web looks like any other Perforce client program. 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.
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 and run it on your Windows machine. 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 and run it on your Windows workstation. If you are logged in as administrator, P4Web is installed as a service. Otherwise, the P4Web executable is installed in the directory you specify.
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:
To specify flags for P4Web services, stop the service and set P4WEBSERVICEFLAGS as follows:
p4 set -S "Perforce Web" P4WEBSERVICEFLAGS="flags"
For example:
p4 set -S "Perforce Web" P4WEBSERVICEFLAGS="-M -sBCDEG"
Then restart the service.
When you start P4Web in Standard mode or Viewer mode, you specify the Perforce user and client that are used when P4Web connects to the Perforce server. The client view and protections defined for the specified client and user determine the scope and type of access to the Perforce server that P4Web has. For details about defining protections and client views, refer to the P4 User's Guide.
If you installed P4Web as an application, choose Start>Programs>Perforce>Launch P4Web Application. To specify settings other than those you configured when you installed P4Web, invoke it from the command line.
If you are running P4Web as a service, P4Web is started immediately after you install it. To verify that P4Web has started, go to the Windows Control Panel. Under Administrative Tools>Component Services, click on Services and find Perforce Web. If P4Web is not running, 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 (no authentication). 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 machine where P4Web is running. | |
-B | Specifies Viewer mode plus authentication. Each user is prompted to enter user name and password the first time they browse to the P4Web instance, and whenever tickets expire (if the target server is using ticket-based authentication). | |
-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. | |
-d path | Specify a default file filter (for performance). | |
-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. | |
-i | Specify this flag in the /etc/inetd.conf file if starting P4Web using inetd. | |
-In "name" -Io "comment" |
Override the Perforce server's Zeroconf human-readable name or comment. | |
-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. If the log file name includes spaces, specify it in double quotes. | |
-M | Accept connections from multiple users. By default, P4Web connects to the server and issues commands using the single user specified by the -u flag. When you enable connections from multiple users, a single instance of P4Web can interact with the Perforce server on behalf of all (valid) users. When users connect, they are prompted for username and password, and are required to choose a client workspace (if they intend to sync and edit files) or to select Browse mode (if they intend only to view information and browse files). | |
-m mimefilepath |
Specify a custom MIME type map file. In the MIME type map file, you can map new types and override existing
mappings, to control how your browser handles files returned to it by
P4Web. As an alternative to the -m flag, you can set the P4WEBMIMEFILE
environment variable (unless you are starting P4Web as a Windows service,
in which case you must use the -m flag). Example:
|
|
-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 in Viewer mode (-B or -b flag). | |
-r path | Restrict to clients with roots in the specified path (for security). | |
-s options |
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. The -ss and -sq options affect both local and remote users. All other options affect only remote users.) Options are as follows: |
|
Options | a | Prevent remote users from switching client workspaces. |
B | Enable remote users to use client workspaces that have no owner. | |
C | Accept connections from any client. | |
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 | Allow remote users to edit the Root, Altroots and Owner fields in client workspace specifications. | |
F | Enable display of startup flags for remote users. | |
G | Accept connections from remote users if client has empty Host field. | |
h | To reduce requests to the Perforce server, do not allow requests for integration history from server when displaying revision history, submitted changelists, and jobs. | |
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 clients that contain 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 -M 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. | |
-0 | Register as a Zeroconf service. (Flag is zero, not the letter O). Note: the Avahi implementation of Zeroconf does not support an option for restricting the advertising of services to the localhost machine. You can prevent other machines from connecting by specifying the -l flag when you start P4Web, but if you are using Avahi, the P4Web instance is visible to other machines. |
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 address 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).
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: