A P P E N D I X  B

Setting Up an HTTP or FTP Server: Examples

This appendix provides sample procedures for setting up a firmware server, which is necessary to invoke the flashupdate command. A firmware server can be either an HTTP or an FTP server. To upgrade firmware, you can use either the FTP or HTTP protocol.



Note - These procedures assume that you do not have a web server currently running. If you already have a web server set up, you can use or modify your existing configuration. For more information, see man httpd and also the documentation included with your HTTP or FTP server.



Before you begin to set up the HTTP or FTP server, follow these guidelines:



caution icon

Caution - The firmware server must notgo down during the firmware upgrade. Do notpower down or reset the system during the flashupdateprocedure.




Setting Up the Firmware Server

This section provides the following sample procedures for setting up a firmware server:


procedure icon  To Set Up an HTTP Server

This sample procedure for setting up an Apache HTTP server with the Solaris 8 operating environment assumes that:

 

1. Log in as superuser and navigate to the /etc/apache directory.


hostname % su
Password: 
hostname # cd /etc/apache

2. Copy the httpd.conf-example file to replace the current httpd.conf file.


hostname # cp httpd.conf httpd.conf-backup
hostname # cp httpd.conf-example httpd.conf

3. Edit the httpd.conf file and make changes to Port: 80, ServerAdmin, and ServerName.

a. Search through the httpd.conf file to find the "# Port:" section to determine the correct location to add the Port 80 value as shown in CODE EXAMPLE B-1.


CODE EXAMPLE B-1 Locating the Port 80 Value in httpd.conf
# Port: The port to which the standalone server listens. For
# ports < 1023, you will need httpd to be run as root initially.

#

Port 80
 
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.

b. Search through the httpd.conf file to find the # ServerAdmin: section to determine the correct location to add the ServerAdmin value as shown in CODE EXAMPLE B-2.


CODE EXAMPLE B-2 Locating the ServerAdmin Value in httpd.conf
# ServerAdmin: Your address, where problems with the server 
# should be e-mailed. This address appears on some server-
# generated pages, such as error documents.
 
ServerAdmin root
#
# ServerName allows you to set a host name which is sent back to ...

c. Search through the httpd.conf file and search for ServerName (CODE EXAMPLE B-3).


CODE EXAMPLE B-3 Locating the ServerName Value in httpd.conf
#
# ServerName allows you to set a host name which is sent back to clients for
# your server if it's different than the one the program would get (i.e., use
# "www" instead of the host's real name).
#
# Note: You cannot just invent host names and hope they work. The name you 
# define here must be a valid DNS name for your host. If you don't understand
# this, ask your network administrator.
# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address (e.g., http://123.45.67.89/)
# anyway, and this will make redirections work in a sensible way.
#
ServerName oslab-mon

4. Start Apache.


CODE EXAMPLE B-4 Starting Apache
hostname # cd /etc/init.d
hostname # ./apache start
hostname # cd /cdrom/cdrom0/firmware/
hostname # mkdir /var/apache/htdocs/firmware_build_number
hostname # cp * /var/apache/htdocs/firmware_build_number


procedure icon  To Set Up an FTP Server

This sample procedure for setting up an FTP server assumes that the Solaris 8 operating environment is installed for the FTP server to be used.

1. Log in as superuser and check the ftpd man page.


hostname % su
Password: 
hostname # man ftpd

In the man pages you will find the script that will create the FTP server environment. Search through the man page to find the lines shown in the example below.


This script will setup your ftp server for you.
Install it in the /tmp directory on the server.
Copy this script and chmod 755 script_name.
#!/bin/sh
# script to setup anonymous ftp area
#

2. Copy the entire script out of the man page (not just the portion shown in the sample above) into the /tmp directory and change the permission on the script to chmod 755.


hostname # vi /tmp/script
hostname # chmod 755 /tmp/script
hostname # cd /tmp
hostname # ./script

3. If you need to set up anonymous FTP, add the following entry to the /etc/passwd file. You must use the following:

/export/ftp was chosen to be the anonymous FTP area. This prevents users from logging in as the FTP user.


# ftp:x:500:65534:Anonymous FTP:/export/ftp:/bin/false



Note - When using anonymous FTP, you should be concerned about security.



4. Add the following entry to the /etc/shadow file. Do not give a valid password. Instead, use NP.


ftp:NP:6445::::::

5. Configure the FTP server on the loghost server.


hostname # cd /export/ftp/pub
hostname # mkdir firmware_build_number
hostname # cd /cdrom/cdrom0/firmware
hostname # cp * /export/ftp/pub/firmware_build_number