Guide to installing Apache web server v 1.3.12, MySQL v 3.22.21, PHP v 3.0.16 and Microsoft's 'FrontPage2000 Server Extensions' on an Indy running IRIX 6.5.8
This is a guide to installing the Apache web server v 1.3.12, MySQL v 3.22.21, PHP v 3.0.16 and Microsoft's 'FrontPage2000 Server Extensions' on an Indy running IRIX 6.5.8.
Index:
Background
Installing MySQL
Installing Apache
Apache's configuration file
Stopping and starting Apache
Apache's access and error logs
Password protecting a directory on a web site, using Apache
Installing PHP
Obtaining and installing 'FrontPage2000 Server Extensions'
Background
'Apache' is the most widely used web (http) server. SGI provide the software in 'tardist' format and on the 'August 2000 freeware' CD. (I thank Steve Crockett for a pre-release version of Apache 1.3.12 for IRIX). Binaries for IRIX are also available at Sunsite.uk. There is an Apache FAQ and information about the 'Apache HTTP Server Project'.
'MySQL' is probably
the most widely used database server because it is free, fast and robust. It
provides web sites with a Structured Query Language (SQL) database client/server.
The server daemon 'mysqld' runs with a wide range of client programs and
libraries.
'PHP' is a server-side,
cross-platform, HTML embedded scripting language. There is an 'Introductory
Tutorial' and links to example
archive sites and other resources. SGI provide
it in 'tardist' format on the 'August 2000
freeware' CD.
'FrontPage2000 server extensions' are a set of executables on UNIX computers and DLLs on Windows PCs that enable 'clients' running 'Microsoft's FrontPage2000' on PCs elsewhere, to access, read and update web servers. The FrontPage2000 extensions will only run under Apache v 1.3.12 or later.
Installing MySQL
I first installed MySQL v 3.23.21 (the latest version is 3.23.21) from the May 2000 version of SGI Freeware at http://freeware.sgi.com/. It was 17.8-MB and it installed in '/usr/freeware/mySQL'. The documents are in '/usr/freeware/doc/MySQL-3.22.21'. See 'manual_toc.html' in that directory for full details of the software and how to use it. The MySQL website has full details of the software and how to use it. There is a sample MySQL startup script called 'mysql.server' in the '/usr/freeware/share/mysql' directory, which is made when the software is installed. Copy the sample shell script 'mysql_server_sh' to the '/etc/init.d' directory and make a symbolic link for the script to 'S99mysql' in the 'etc/rc2.d' directory. This will cause 'MySQL' to start automatically at boot time. If there are problems installing 'MySQL', there is advice about this at MySQL.
Installing Apache
There are several web servers in IRIX and one or more are present and running on most IRIX computers. One of the most widely used is Netscape's Fasttrack server. If you already run one of these web servers on the system where you want to install Apache, it should be stopped before you use Apache. I stopped the Fasttrack servers on my Indy with the commands '/etc/init.d/nss_fasttrack stop' and '/etc/init.d/admin_fasttrack stop'. I also typed 'chkconfig nss_fasttrack off' and 'chkconfig nss_admin off' to prevent them starting at boot time. After installing Apache, I typed 'chkconfig apache on'.
I installed Apache from the SGI Freeware August 2000 distribution. (I thank Steve Crockett for a pre-release version). The SGI Freeware version is built with full dynamic loading and all the standard distribution modules. Additional modules may be added via the ACAPI mechanism. The package installed in '/usr/freeware/apache/'. Documents were in '/usr/freeware/apache/share/htdocs'. The manual is at /usr/freeware/apache/share/htdocs/manual/index.html. The server is run by user: 'nobody', group: 'nobody'.
Setting up the root web: I already had a web of html files running under a Fasttrack server at '\var\www\htdocs'. I copied them to the Apache 'root' directory at '/usr/freeware/apache/share/htdocs'. I set all the files to 'owner.group' 'nobody.nobody'.
Apache's configuration file
The
'/usr/freeware/apache/etc/httpd.conf' file is the main Apache configuration
file. I added my email name in one section of the configuration file
'/usr/freeware/apache/etc/httpd.conf' and altered the port that it uses from
8080 to 80. The other configuration files, that did not need to be altered, were
'srm.conf' and 'access.conf', in the same directory.
Stopping and starting Apache
There are two ways to start the Apache server:
(a) '/usr/freeware/apache/sbin/httpd'
(b) '/etc/init.d/apache start'
It can be stopped in two ways:
(a) '/etc/init.d/apache stop'
(b) 'kill –TERM <pid>', where <pid> is the number returned with the command 'cat /usr/freeware/apache/var/run/httpd.pid'
It can be restarted using the command:
/etc/init.d/apache stop; /etc/init.d/apache start
Apache's access and error logs
These
are in '/usr/freeware/apache/var/log'. You can 'rotate' the access logs every 30
days with a line in '/usr/freeware/apache/etc/httpd.conf':
TransferLog "|/usr/freeware/apache/sbin/rotatelogs var/log/access_log 2592000"
Password protecting a directory on a web site, using Apache
Apache allows you to protect a document, an entire directory, or files that match a certain pattern, so that they can be accessed by a single user or group of users, or users from a certain domain or machine. These settings can be made either in the main server configuration files, but it is easier to set this in a '.htaccess' (pronounced "dot H T Access") file which is placed in the directory to be protected. Using the method below, you will create a file called '/usr/freeware/apache/share/passwd/.htpasswd', containing the names and passwords of the users that will need to have access to the site and a '.htaccess' file in the directory to be protected. On Unix systems, the password is encrypted, and must be created using the '/usr/freeware/apache/bin/htpasswd' program. To create a new password file with your username and password in it, type:
cd /usr/freeware/apache/share/passwd
/usr/freeware/apache/bin/htpasswd -c .htpasswd username
You will them be asked twice to type the password.
/usr/freeware/apache/share/passwd/.htpasswd' now exists and contains a line:
<username>:<encrypted password>
You
can add additional names to the file by repeating the command without the '-c'
switch.
If you wish to add several users in a 'group', create another file called
'.htgroup', with entries in it like:
group: user1 anotheruser myusername
Next create a file called '.htaccess' using a text processor and place it in the web directory to be protected.
To allow just one username/password to access the directory and files in it, use the following entries:
AuthUserFile /usr/freeware/apache/share/passwd/.htpasswd
AuthGroupFile /dev/null
AuthName JustMe
AuthType Basic
require user me
The 'AuthName' is the word that will appear on the authentication dialog. 'AuthType' must be 'Basic', since no other authentication schemes are supported at this time.
To allow only members of 'groupname' to access it, enter in the file:
AuthUserFile /usr/freeware/apache/share/passwd/passwd/.htpasswd
AuthGroupFile /usr/freeware/apache/share/passwd/.htgroup
AuthName Protected
AuthType Basic
require group groupname
To find out more, see the Apache Core Documentation page which contains information on how to use the many 'directives' or lines in '.ht*' files, which control who has access and how it is to be checked. This is available on the Apache server that has just been setup at /usr/freeware/apache/share/htdocs/manual/mod/directives.html and at the Apache web site.
Installing PHP
I downloaded and installed the 10.8-MB *tardist version of PHP using Netscape's 'Navigator'. (I thank Vince Levey for
a pre-release version of PHP for Apache). I selected the components that use MySQL and Apache. Note that, if you install a
version which says that there are 'errors
in the exit commands', then edit '/usr/freeware/apache/etc/httpd.conf'
and move the lines
AddType
application/x-httpd-php3 .php3
AddType application/x-httpd-php3 .phtml
after
the "LoadModule php3_module" line to a position after the line
'AddType application/x-tar .tgz' in the section titled <IfModule
mod_mime.c>.
After
making any changes to '/usr/freeware/apache/etc/httpd.conf',
restart the httpd server, as shown above.
The
documents about php are in /usr/freeware/doc/php'. Files with the extension
*.phtml and *.php3 will now be now be processed by 'php'.
Obtaining and installing 'FrontPage2000 Server Extensions'
I suggest that you first print out Microsoft's information and instructions on downloading and installing FrontPage2000 server extension under IRIX. Download from Microsoft (a) the installation script 'fp_install.sh' (b) the IRIX installation file 'fp40.sgi.tar.Z' and (c) the Apache patch, if you need it, to the /tmp directory. People in the UK can get the installation file and script locally.
Before you run the script
'fp_install.sh', which installs the distribution 'fp40.sgi.tar.Z', there are
several important steps to take.
- Make the
installation script executable.
- Make a backup copy of '/usr/freeware/apache/etc/httpd.conf'.
- Edit '/usr/freeware/apache/etc/httpd.conf': Alter the line 'AllowOverride
None' to 'AllowOverride All'; remove the double quotes ("") around the
path names in the lines for 'DocumentRoot' and 'UserDir' and copy the lines for
'DocumentRoot' and 'UserDir' into the file '/usr/freeware/apache/etc/srm.conf'.
Leave the double quotes on other lines in '/usr/freeware/apache/etc/httpd.conf'.
- I already had a web in my own login area ~cspry/public_html, so I copied
this web to a backup resource, leaving ~cspry/public_html as an empty
directory.
The following steps list the places where you type or respond (shown in red), as the server extensions software is installed.
In a UNIX shell and as 'Superuser':
- cd /tmp
- ./fp_install.sh
- Are you satisfied with your backup of the system (y/n) [N]? y
- FrontPage Extensions directory [/usr/local/frontpage/]: /usr/local/frontpage/
- Do you want to install a root web (y/n) [Y]? y
- Server config filename: /usr/freeware/apache/etc/httpd.conf
- FrontPage Administrator's user name: cspry
- User name of the owner of this new web:[sys] nobody
- Group of this new web:[] nobody
- What type of Server is this: 2
- Which local character encoding does your system support: [1] 1
- What should the default language be: [1] 1
- Install new sub/per-user webs now (y/n) [Y]? y
- Enter the web name (CTRL-D if no more webs): ~cspry
- FrontPage Administrator's user name: cspry
- Group of this new web:[] mygroup
- Enter user's password: mypassword
- Confirm password: mypassword
- Enter the web name (CTRL-D if no more webs): ^D
- Do you want to install Virtual Webs (y/n) [Y]? n
- Installation completed! Exiting...
At one stage, it complained that it was not able to alter the permissions on any of the files or directories in '/usr/freeware/apache/share/htdocs'. I suggest that you set these manually to be owned by user.group 'nobody.nobody' with the command
cd /usr/freeware/apache/share; chown -r nobody.nobody ./htdocs
Please notify me mailto:cspry@cspry.co.uk of errors, omissions and improvements to this little guide.
Return to the 'home page'
Return to the `Computing index page'
Return to the 'Indy administration index'