Linux Apache SSL PHP/FI Frontpage Mini HOWTO
Linux Apache SSL PHP/FI Frontpage Mini HOWTO
Table of Contents
Linux Apache SSL PHP/FI frontpage mini−HOWTO....................................................................................1
Marcus Faure, marcus@faure.de............................................................................................................1
1. Introduction..........................................................................................................................................1
2. Component installation........................................................................................................................1
3. Putting it all together............................................................................................................................1
1. Introduction..........................................................................................................................................1
1.1 Description of the components..........................................................................................................1
1.2 Working configurations.....................................................................................................................2
1.3 History...............................................................................................................................................2
2. Component installation........................................................................................................................3
2.1 Preparations........................................................................................................................................3
2.2 Adding PHP.......................................................................................................................................3
2.3 Adding SSL........................................................................................................................................4
2.4 Adding frontpage...............................................................................................................................4
3. Putting it all together............................................................................................................................4
3.1 Apache modules to try.......................................................................................................................4
3.2 Giving CGI's more security...............................................................................................................5
3.3 Compiling and installing the server daemon.....................................................................................5
3.4 Adding frontpage support to a web....................................................................................................6
3.5 Starting the daemon...........................................................................................................................7
3.6 Some considerations left....................................................................................................................7
3.7 Known bugs.......................................................................................................................................7
3.8 The final word....................................................................................................................................7
i
Linux Apache SSL PHP/FI frontpage mini−HOWTO
Marcus Faure, [email protected]
v1.1, July 1998
This document is about building a multipurpose webserver that will support dynamic web content via the
PHP/FI scripting language, secure transmission of data based on Netscape's SSL, secure execution of
CGI's and M$ Frontpage Server Extensions
1. Introduction
• 1.1 Description of the components
• 1.2 Working configurations
• 1.3 History
2. Component installation
• 2.1 Preparations
• 2.2 Adding PHP
• 2.3 Adding SSL
• 2.4 Adding frontpage
1. Introduction
Before you start reading: I am not a native speaker, so there are probably spelling/grammatical errors in this
document. Feel encouraged to inform me of mistakes.
software versions I tried, they will probably compile without greater problems and result in a fairly stable
daemon. If you are courageous, you can try to compile all the latest−stuff−with−tons−of−new−features, but
don't blame me if something fails ;−). However, you may report other working configurations to be included
in future versions of this document. All of the steps were tested on a linux 2.0.35 box, so the howto is
somewhat linux−specific, but you should be able to use it for other unixes as well.
You do not necesserily have to compile in all components. I tried to structure this howto so that you can skip
the parts you are not interested in.
The document is neither a user manual to Apache, SSL, PHP/FI nor frontpage. Its prime intention is to save
webservice providers some headaches when installing their server and to do my little contribution to the linux
community.
PHP is a scripting language that supports dynamic HTML pages. It is a bit like Apache's SSI, but by far more
complex and has database modules for many popular dbs. The GD libraries are needed by PHP.
SSL is an implementation of Netscape's Secure Socket Layer that allow secure connections over insecure
networks, e.g. to transmit credit card numbers to web based forms.
frontpage is a wysiwyg web authoring tool that makes use of some server−specific extensions called
webbots. Some people think frontpage is cool because you can create feedback forms and discussion webs
without having to know a bit about html or cgi. It even protects the designer from uploading his/her site via
ftp by using a builtin publisher. If you wish to support frontpage but do not like to setup a windows server,
the apache server extensions are your choice.
• Linux 2.0.31, Apache 1.2.4, PHP 2.0.0, SSL 0.8.0, fp 98 3.0.3 (*)
• Linux 2.0.33, Apache 1.2.5, PHP 2.0.1, SSL 0.8.0, fp 98 3.0.3 (*)
• Linux 2.0.35, Apache 1.2.6, PHP 3, SSL 0.8.0, fp 98 3.0.4
(*) version 3.0.3 is not recommended
1.3 History
v0.0/Apr 98: Preview version
v1.0/Jun 98: Now using Apache 1.2.6, updated fp section, minor corrections
2. Component installation
2.1 Preparations
You will need:
Get the sources you want. Untar apche, php, gd and ssl to /usr/src. Untar the SSL patch to
/usr/src/apache_1.2.6.
Like the frontpage extensions, phtml includes a security problem because it is run under the uid of the
webserver. Be sure to turn on safe mode in src/php.h and restrict the search path to a save value. There are
some other options in php.h you may want to edit. If you are very concerned about security, compile php as a
cgi. However, this will be a performance loss and not as smart as the module version.
Type make to build all files. When the compilation is done, copy mod_php.* and libphp.a to
/usr/src/apache_1.2.6/src Add a line
application/x−httpd−php phtml
2. Component installation 3
Linux Apache SSL PHP/FI frontpage mini−HOWTO
to Apache's srm.conf.
You may also want to add index.phtml to DirectoryIndex in that file so that a file index.phtml is
automatically loaded when its directory is requested.
You now have to apply the FP patch. cd to /usr/src/apache_1.2.6/src and type patch <
/usr/src/frontpage/version3.0/apache−fp/fp−patch−apache_1.2.5 This will create
the mod_frontpage.* files and do some modifications to Configuration etc. The 1.2.5 patch will
work with both apache 1.2.5 and 1.2.6. Skip the part about installing webs, you can do that later
ServerType standalone
Port 80
Listen 80
Listen 443
User wwwrun
Group wwwrun
ServerAdmin [email protected]
ServerRoot /var/httpd
ErrorLog logs/error_log
TransferLog logs/access_log
PidFile logs/httpd.pid
ServerName www.yourhost.com
MinSpareServers 3
MaxSpareServers 20
StartServers 3
SSLCACertificatePath /var/httpd/conf
SSLCACertificateFile /var/httpd/conf/httpsd.pem
SSLCertificateFile /var/httpd/conf/httpsd.pem
SSLLogFile /var/httpd/logs/ssl.log
<VirtualHost www.virt1.com>
SSLDisable
ServerAdmin [email protected]
DocumentRoot /var/httpd/virt1
ScriptAlias /cgi−bin/ /var/httpd/virt1/cgi−bin/
ServerName www.virt1.com
ErrorLog logs/virt1−error.log
TransferLog logs/virt1−access.log
User virt1admin
Group users
</VirtualHost>
<VirtualHost www.virt1.com:443>
ServerAdmin [email protected]
DocumentRoot /var/httpd/virt1
ScriptAlias /cgi−bin/ /var/httpd/virt1/cgi−bin/
ServerName www.virt1.com
ErrorLog logs/virt1−ssl−error.log
TransferLog logs/virt1−ssl−access.log
User virt1admin
Group users
SSLCACertificatePath /var/httpd/conf
SSLCACertificateFile /var/httpd/conf/httpsd.pem
SSLCertificateFile /var/httpd/conf/httpsd.pem
SSLLogFile /var/httpd/logs/virt1−ssl.log
SSLVerifyClient 0
SSLFakeBasicAuth
</VirtualHost>
<VirtualHost www.virt2.com>
SSLDisable
ServerAdmin [email protected]
DocumentRoot /var/httpd/virt2
ScriptAlias /cgi−bin/ /var/httpd/virt2/cgi−bin/
ServerName www.virt2.com
ErrorLog logs/virt2−error.log
TransferLog logs/virt2−access.log
</VirtualHost>
Depending on the modules compiled in, not all directives may be available. You can retrieve a list of
available directives with httpsd −h.
The user name must be the unix login of the webowner. The password does not necessarily have to match the
system password. You have to manually add sendmailcommand:/usr/sbin/sendmail %r to
/usr/local/frontpage/www.virt2.com:80.conf, otherwise your users will not be able to send
web−generated eMails. kill −HUP your httpsd to make fp reread its config. You can now access
www.virt2.com with your frontpage client.
Under some circumstances fpsrvadm complaints that a root web has to be installed first. This is pretty
useless, but you should do so to silence fpsrvadm.
Copy one of the demo files from the php examples directory to virt1 to test phtml.
You can find out the more specific version number by executing
/usr/local/frontpage/currentversion/exes/_vti_bin/shtml.exe −version. Older
versions have a nasty bug that requires httpd.conf to be writable by the gid of the webserver. This should
make you scream if you are at all concerned about security. Versions since 3.0.2.1330 are more usable.
Please note that at the time of writing both SSL and frontpage work, but not at the same time, that means you
can neither publish your web using ssl nor make use of the webbots through https. You can publish your web
on port 80 and access it encrypted on port 443, but your counters etc. will be broken. I consider this a bug.
This problem shall be fixed in SSL 0.9.0.
O.K. readers, you're done for today. Feel free to send me your feedback, eternal gratitude, flowers, ecash,
cars, oil sources etc.