This chapter tells you how to install Sun Java System Web Server on UNIX systems. It contains the following sections:
The topics in this section describe the installation of Sun Java System Web Server on UNIX platforms.
You must install your version Sun Java System Web Server 6.1 in a server root directory separate from the server root directory that contains previous versions of the Web server.
Before you install Sun Java System Web Server, you must log in as root, unless you meet the following conditions:
You plan to install the Sun Java System Web Server on a port higher than 1024.
The location where you plan to install the server (the server root directory) is writable with your non-root login.
You are not planning to use Express installation.
If you meet these conditions, you do not need to log in as root to install the server; instead log in as the user account that the Administration Server will use. However, you may still prefer to log in as root, even though you meet the conditions.
Only root can bind to ports >= 1024. However, to improve security, do not allow an instance to run as root. You can configure an instance to run as another user. By default, an instance's configuration files are writable by the user that instance runs as. This means a non-root user can modify an instance's configuration file to obtain root access. Therefore, to further improve security, avoid starting an instance as root.
Solaris offers the net_privaddr privilege to allow specific non-root users to bind to ports lesser than 1024. Using this privilege means even instances that bind to ports lesser than 1024 can be started by non-root users.
To get the Sun ONE Web Server files and unpack them, follow these steps:
Insert the Sun Java System Web Server CD in the drive.
Change to the CD-ROM directory. For example:
cd /cdrom
Change to the directory on the CD labeled with your UNIX operating system. For example:
cd Solaris_Sparc
Change to the installation directory. For example:
cd SUNWwbsvr
Copy the tar file, sunw-webserver-6.1.< platform-name >.tar, from the CD to your home directory or a temporary directory. For example:
cp sun-webserver-6.1.sol.tar /tmp/SUNWwbinstall
Untarring the file will cause the permissions of the destination directory to be modified so that applications can no longer write files to it. To avoid this problem, untar the file in a directory where you can modify the permissions. For example, instead of /tmp, use a subdirectory under /tmp, for example, /tmp/SUNWwbinstall.
Copying the file may take some time.
Change to the directory on your UNIX machine where you copied the file. For example:
cd /tmp/SUNWwbinstall
Untar the file by typing tar -xvf filename. For example:
tar -xvf sun-webserver-6.1.sol.tar
This command unpacks the server files and creates a temporary directory structure under the current directory. Unpacking the file may take a little time. When the files are unpacked, you see a /WebServer and a /lib directory, and the following files:
Download the file from http://www.sun.com/download/ and save it in a temporary directory.
Change to the directory on your UNIX machine where you copied the file. For example:
cd /tmp/SUNWwbinstall
Unpack the . gz file by typing gunzip filename. The file name is in the format:
sun-webserver-6.1.<platform-name>.tar.gz
Example:
gunzip sunw-webserver-6.1.sol.tar.gz.
Untar the unzipped file by typing tar -xvf filename. Example:
tar -xvf sun-webserver-6.1.sol.tar
This command unpacks the server files and creates a temporary directory structure under the current directory. Unpacking the file may take a little time. When the files are unpacked, you see a /WebServer and a /lib directory, and the following files:
README.txt
3RD-PARTY-LICENSE.txt
LICENSE.txt
setup
installWrapper
setup.inf
template.inf.
Untarring the file will cause the permissions of the destination directory to be modified so that applications can no longer write files to it. To avoid this problem, untar the file in a directory where you can modify the permissions. For example, instead of /tmp, use a subdirectory under /tmp, for example, /tmp/SUNWwbinstall.
You run the setup program to install Sun Java System Web Server.
During the installation process, you have the choice of three kinds of installation: Express, Typical, or Custom. Most users should choose Typical or Custom. Typical or Custom gives you more flexibility in the components you can install and the settings you can configure.
Express installation is for users who have little experience or are evaluating the product. It makes assumptions about such things as port number and which components to install. For more information, see To install using express installation.
When running the installer, you can use the following commands:
Press the Enter key to accept defaults specified in brackets (for example [All]).
Press CTRL+B to return to a previous screen (note that this sequence does not work on all screens).
Press CTRL+C to cancel the installation program.
Enter comma-separated lists of numbers when you want to select multiple items (for example, 1, 2, 3).
For Express installation, you must be logged in as root when running setup.
If you are not in the directory already, change to the directory where you unpacked the file.
Type ./setup to start the server installation.
If you are not logged in as the root user (superuser), or if you do not have sufficient write permissions, you will get one or more error messages.
A welcome screen appears. Press Enter to continue with the installation.
Choose whether you accept the software license agreement by typing Yes to accept, or No to decline. If you have not yet read the license agreement, cancel out of the installation and read the file LICENSE.txt that is in the same directory as the setup program. Type Yes or y to accept the agreement.
Specify the server root directory where the server files and directory structure will be installed or accept the default ( /opt/SUNWwbsvr/) and press Enter.
You need to run the server as a user who has write access to this directory, for example, the directory owner.
Choose all components screen and press Enter.
Install the following subcomponents:
Server Core. Installs the Administration Server and the first instance of Sun Java System Web Server.
Java Development Kit. Sun Java System Web Server 6.1 provides Java Developer’s Kit (JDK) version 1.4.1_03 as a bundled product. You can install the provided JDK, or use your own JDK.
If you do not want to install the bundled JDK, type 1 and press Enter. In this case, To install using typical or custom installation is an additional step in the installation process, where you would need to specify the path to the JDK.
Specify the fully qualified domain name of the computer on which you are installing the server and press Enter. Example:
plaza.sun.com
Enter the UNIX user and group names to use when running the default instance of Sun Java System Web Server and press Enter.
If you are installing as root, the default user and group on all UNIX systems except Solaris OE, is nobody. On Solaris OE, if you are installing as root, the default user and group is webservd. If the user or group does not exist, it is automatically created during installation.
HP-UX has a UID of -2 for nobody. If you have to run the server as nobody on this platform, change the UID of nobody to a positive unique number less than the UID max.
Enter the UNIX user name to use when running the Administration Server and press Enter.
In most cases this user is root.
Enter the Administration Server user name and password to use for authentication. You are asked to enter your password twice. Press Enter.
Type the Administration Server port number or accept the default of 8888.
For maximum flexibility, choose a port number above 1024. If you want to use a port number lower than 1024 for your Administration Server, you must be logged in as root to start the server. Do not use a port that is already in use.
This Administration Server is not the same as the Administration Server shipped with other Sun Java System servers.
For more information on ports, see Choosing Unique Port Numbers.
Type the port number of Sun Java System Web Server.
The default is 80. This port should be different than the Administration Server port. Unless you are installing as root, the port must be within the stated range (1024 to 65535). If you are installing as root you can use port numbers below 1024.
If you use a port other than the default port (port 80), the URL used to gain access t o your home page will change. For example, if your computer is called www.sun.com and you choose port 9753, the URL of the server will be http://www.sun.com:9753/
For more information on ports, see Choosing Unique Port Numbers.
Type the root directory where content files of your server (the images, HTML documents and data you want to present to users accessing the server) will reside, and press Enter. The default is server_root /docs.
If you are installing Sun Java System Web Server as root (superuser), then the option to start Web Server automatically when the system boots up (Start on Boot) comes up next. If you want to enable Start on Boot, retain the default, which is Yes and press Enter; otherwise, type No and press Enter.
You can disable the Start on Boot option as follows:
On Solaris and HPUX, you can turn off this option by editing the S1WS_START_ONBOOT variable in the webserver01 script. On Linux, delete the following links to disable it:
/etc/rc.d/rc3.d/S75webserver01
/etc/rc.d/rc5.d/S75webserver01
If you chose to use your own JDK, enter the absolute path to the directory where you installed the JDK on your system.
Java support in Sun Java System Web Server 6.1 requires a JDK version that is at least JDK version 1.4.1.
The JDK must already exist in the specified directory.
If the custom JDK is located in a directory with a standard tree structure, you can press Enter to continue with the installation. If the custom JDK location follows a non-standard tree structure, then at this prompt you would need to enter the full path to the directory where libjvm.so (or libjvm.sl) is located.
After the installation program extracts and installs the Sun Java System Web Server components, press Enter.
Go to the https-admserv directory under your server root directory (for example, /opt/SUNWwbsvr/) and start the Administration Server by typing ./start.
You can also type ./startconsole in the server root directory.
startconsole starts the Administration Server and launches a browser to the Administration Server administration pages.
To configure your Sun Java System Web Server, use the URL:
http://server_name:administration_port
For example: http://www.sun.com:5566
Enter your administration user name and password.
You can now configure your Sun Java System Web Server. For more information on configuring and using Sun Java System Web Server 6.1, see the Sun Java System Web Server 6.1 SP7 Administrator’s Guide.
Express installation is for users who have little experience or are evaluating the product. It makes assumptions about such things as port number and which components to install. By default, the JDK used is the bundled JDK.
The following table lists the assumptions made by the Express installation. If you would like to use different installation settings, use Typical or Custom installation.
Installation Setting |
Value |
---|---|
administration port |
8888 |
administration URL |
http://machine name:administration port |
HTTP port number |
80 |
document root |
server_root/docs |
UNIX user to run server |
root |
subcomponents |
All default subcomponents installed |
You must log in as root to use Express installation.
If you are not in the directory already, change to the directory where you unpacked the file.
Type ./setup to start the server installation.
A welcome screen appears.
Press Enter to continue with the installation.
Choose whether you accept the software license agreement by entering Yes to accept, or No to decline. If you have not yet read the license agreement, cancel out of the installation and read the file LICENSE.txt that is in the same directory as the setup program.
Choose Express and press Enter.
Type a server root directory or accept the default ( /opt/SUNWwbsvr/).
This directory is where the server files and directory structure will be installed. root must have write access to this directory.
Choose all components.
Press Enter.
Enter the UNIX user and group names to use when running the default instance of Sun Java System Web Server.
For Express installation, this user must be root. The group must be the group to which root belongs.
Enter the UNIX user name to use when running the Administration Server.
In most cases, this user is root.
Enter the Administration Server user name and password to use for authentication. You are asked to enter your password twice.
After the installation program extracts and installs the Sun Java System Web Server components, press Enter.
Go to the https-adminserv directory under your server root directory (for example, /opt/SUNWwbsvr/) and start Administration Server by typing ./start. You can also type ./startconsole in the server root directory.
startconsole starts the Administration Server and launches a browser to the Administration Server pages.
To configure your Sun Java System Web Server, use the URL:
http://server_name:administration_port
For example: http://www.sun.com:8888
Enter your administration user name and password.
You can now configure your Sun Java System Web Server. For more information, see the Sun Java System Web Server 6.1 SP7 Administrator’s Guide.
You can install Sun Java System Web Server on multiple machines using two different methods: templatized installation and silent installation.
Templatized installation is executed from your local machine, where you run the installation program across multiple remote machines at once.
Silent installation requires that you first install the web server on a local machine, then edit the resulting log file, install.inf, to correspond to the remote machines. With silent installation, you must install the remote instances one by one.
Both methods are described in this section.
To install using templatized installation
To install using silent installation
To use templatized installation, enter the installation settings for each remote machine in a template file called template.inf. You can then use the template to install the web server on multiple machines from a single session on your local machine.
The template.inf file is found in the same directory as the setup program.
To run templatized installation, perform the following steps:
In the /.rhosts directory of your local machine, create an entry for each remote machine where you will install the web server using the format
remote_machine_name username
For example, if the remote machine is host1 on the domain do gs, and you are logged in as root, enter the following information:
host1.docs.com root
In the /etc/hosts.equiv directory of your local machine, create an entry for each remote machine where you will install the web server using the format
remote_machine_name
For example, if the remote machine name is host1 on the domain docs, enter the following information:
host1.docs.com
In the /.rhosts directory of each remote machine where you will install the web server, create an entry for your local machine using the format
local_machine_name username
For example, if the local machine name is chewbacca on the domain docs and you are logged in as root, enter the following information:
chewbacca.docs.com root
In the /etc/hosts.equiv directory of each remote machine where you will install the web server, create an entry for your local machine using the format
local_machine_name
For example, if the local machine name is chewbacca on the domain docs, enter the following information:
chewbacca.docs.com
Create a setup directory on your local machine with a link to server root
ln -s server_root/ setup-directory
Change to the directory where setup resides.
For the local machine share and export the directory containing the setup program via NFS:
- For the remote machine, create a setup directory and mount via NFS mount -F nfs <local machine name >: setup-directory setup-directory
- Finally make sure that the SetupLocation is accessible from the remote machine.
Remote access is only on Solaris machines. Remote access is different from platform to platform.
Open the template.inf file.
Enter the installation setting:
HostNames: the name of the host where the web server will be installed, separated by commas. For example:
host1,host2,host3
Components: the components to install, separated by commas. For example:
webcore,jdk,cleanup
SetUpLocation: the location of the setup program used by the template file.
For each host, enter the following:
[hostname]: the name of the machine where the web server will be installed by the template.
InstallType: the type of installation to run: express [1], typical [2], or custom [3].
SuiteSpotUserID: The user ID used when running the default instance of the Sun Java System Web Server.
SuiteSpotGroup: The group the user running the default instance of the Sun Java System Web Server belongs to.
ServerRoot: the directory where your server will be installed. For example:
/opt/SUNWwbsvr/
HttpDocRoot: The document root of the Sun Java System Web Server instance. For example:
/opt/SUNWwbsvr/docs
For the core server, enter the following:
AdminPort: Enter the port number for the Administration Server.
HttpPort: The port of the default Sun Java System Web Server instance.
AdminSysUser: The user id used when running the Administration Server. The user should have access permissions to use the directory Server to perform user and group management tasks. For example, root.
AdminName: The user name used to access the administration screens of the Administration Server. For example: admin.
AdminPassword: The password used to access the administration screen of the Administration Server. For example: admin.
Run the installation wrapper by typing the following command at the command prompt:
path_to_perl_executable/perl installWrapper -f template.inf
The installWrapper is a Perl script.
The following is an example of the template.inf file:
[ MachineName] HostNames = draco.sun Components=webcore,snmp,cleanup SetUpLocation=/Sun/WebServer/P20030814.1 [iws-intern3] InstallType= 2 SuiteSpotUserID= nobody SuitespotGroup= nobody SecurityCheck= False RequireDomain= False InstallWhich= 1 ServerRoot=/Sun/WebServer/tmpl_inst/SUNWwbsvr HttpDocRoot=/Sun/WebServer/tmpl_inst/SUNWwbsvr/docs JDK_DIR=/usr/j2se [core] Upgrade= False Reinstall= False AdminPort= 20000 HttpPort= 20001 AdminSysUser= root AdminName= admin AdminPassword= admin UgLdapUse= No CompVersions= 2:2:1:2:2:1:1:2: [cleanup] Archive= cleanup.zip |
Silent installation is a less efficient way than templatized installation to install multiple instances of Sun Java System Web Server because remote instances of the server are installed one by one rather than several at a time. You use silent installation to create a file of responses to the setup program’s prompts, then edit the file (install.inf) and use it to install future Sun Java System Web Server installations. With silent installation, you must first install Sun Java System Web Server on your local machine, then edit install.inf to correspond to the remote machines where you’ll install additional instances of the server. If you are installing Sun Java System Web Server on a number of remote machines, it is recommended that you use templatized installation instead.
Silent installation works best when you use the Typical installation and your installations are all similar.
The install.inf file contains the password used to log on to the Administration Server. The password is not encrypted; it is in plain text. If you use silent installation, delete the install.inf file once you are done with it.
To use silent installation, follow these steps:
Run setup with the -k option, which creates a file called install.inf that contains all your responses to the installer prompts. At the command prompt, type:
./setup -k
Answer the installer prompts and install Sun Java System Web Server.
When the server is installed, go to the server_root /setup directory, where you find the install.inf file.
Copy the install.inf file to the directory where you will run setup to install your Sun Java System Web Server.
Edit the values in the install.inf file to match the values of the next server you want to install.
For example, change the machine name, port number, installation directory, etc.
Run setup using the install.inf file for input. For example:
./setup -s -f install.inf
The server is installed.
The following is an example of an install.inf file.
[General] FullMachineName= draco.india.sun.com SuiteSpotUserID= webservd SuitespotGroup= webservd ServerRoot= /Sun/WebServer SecurityCheck= False RequireDomain= False Components= WebServer [WebServer] Upgrade= False SuiteSpotUserID= webservd SuiteSpotGroup= webservd AdminPort= 4600 HttpPort= 4601 HttpDocRoot= /Sun/WebServer/docs StartOnBoot= n JDK_DIR= /Sun/WebServer/bin/https/jdk JDK_LIBPATH= AdminSysUser= root AdminName= admin AdminPassword= admin CompVersions= 2:2:1:0:0: Components= webcore,JDK,cleanup [cleanup] Archive= cleanup.zip |
The following table shows some useful install.inf parameters to edit. For best results, do not edit any parameters except those listed in the table.
Parameter Name |
Use |
---|---|
FullMachineName |
The machine name. |
SuiteSpotUserID |
The user ID used when running the default instance of the Sun Java System Web Server. |
SuiteSpotGroup |
The group the user running the default instance of the Sun Java System Web Server belongs to. |
ServerRoot |
The directory where you install the server. |
AdminPort |
The Administration Server port. |
HttpPort |
The port of the default Sun Java System Web Server instance. |
HttpDocRoot |
The document root of the Sun Java System Web Server instance. |
AdminSysUser |
The user ID used when running the Administration Server. |
AdminName |
The user name used to access to the Administration Server’s administration screens. |
AdminPassword |
The password used to access to the Administration Server’s administration screens. |
JDK_DIR |
The directory where your JDK is installed. |
When you install the Sun Java System Web Server product, two web server instances are installed by default under the server root directory:
A Web Server instance
A Web Server instance for administration purposes, also called the Administration Server.
Files for the Web Server instance are stored in the https-host.domain directory under the installation directory.
Files for the Administration Server instance are stored in the https-admserv directory under the installation directory.
For more information about the configuration files that are created, see the Sun Java System Web Server 6.1 SP7 Administrator’s Configuration File Reference.
You can remove Sun Java System Web Server from your computer by using the uninstall application.
Though you can select individual subcomponents to uninstall, Sun does not recommended. The uninstaller only removes the parts of the code pertaining to the selected subcomponent, but does not update configuration files. Your server may not run if you uninstall individual subcomponents.
Go to your server root and type ./uninstall.
A list of Sun Java System servers currently installed in this location appears.
Find Sun Java System Web Server in the list and type the number next to it at the prompt.
Note that uninstalling Sun Java System Web Server automatically uninstalls the Administration Server, since it is an instance of Sun Java System Web Server.
A list of installed Sun Java System Web Server subcomponents appears.
Select all subcomponents and press Return.
The subcomponents are uninstalled and you return to the command prompt.
The uninstall program does not remove every server file. For example, it does not remove keys and certificates, configuration files, logs, ACL files or the document root.