Skip to topic | Skip to bottom
Home
Socialtools
login



Socialtools.StandardApacher1.1 - 05 Jul 2005 - 06:16 - TWikiGuesttopic end

Start of topic | Skip to actions

Apache HTTP server

Apache version

Tested with Apache 1.3.33.

Overview

Apache is the most commonly-used HTTP server. Here we install it with some modules that we'll need for other things in ServerConfigStandard.

We recommend Apache 1.3, because not all modules are ready for Apache 2.0.

Apache runs as user apache, group apache.

Virtual hosts are configured in /usr/local/apache/conf/virtual_hosts. Each virtual host has a file in /usr/local/apache/conf/vhost.

HTML documents are in /var/www/domainname/htdocs.

Icons are in subdirectories of /var/www/icons.

Installation

Install prerequisites:

sudo apt-get install libperl-dev libwww-perl libgdbm-dev libc6-dev

Download the latest release of Apache 1.3.

Download FastCGI.

Download mod_perl.

Install /usr/local/configure-wrappers/configure-apache-mod-perl (make it world-executable).

Make an Apache user, and set up directories:

sudo adduser --system --home /var/www --group apache
sudo mkdir -p /usr/local/apache/conf/vhost
sudo mkdir -p /var/www/icons

Compile and install Apache:

tar zxf apache_1.3.x.tar.gz
tar zxf mod_perl-1.x.tar.gz
tar zxf mod_fastcgi-x.y.z.tar.gz
mv mod_fastcgi-x.y.z apache_1.3.x/src/modules/fastcgi
cd mod_perl-1.x
/usr/local/configure-wrappers/configure-apache-mod-perl
make
make test
sudo make install
sudo cp -r /usr/local/apache/icons/* /var/www/icons/

Install these files:

Make init script symlinks:

sudo update-rc.d apache defaults 25

Create a file, /usr/local/apache/conf/virtual_hosts (change the IP address to server's IP address):

# Use name-based virtual hosting.
NameVirtualHost 10.0.0.243

# each vhost is kept in each own separate file in the 'vhost' directory.

Start Apache:

sudo /etc/init.d/apache start

Adding virtual hosts

Here we'll add a virtual host for www.example.org.

Make directories for the virtual host's HTML files and logs:

sudo mkdir -p /var/www/www.example.org/htdocs
sudo mkdir -p /var/www/www.example.org/logs

Create a file, /usr/local/apache/conf/vhost/www.example.org, containing the Apache configuration for the virtual host. It should look like this (substitute your IP address and domain name):

<VirtualHost 10.0.0.243:80>
  ServerAdmin webmaster@example.org
  DocumentRoot /var/www/www.example.org/htdocs
  ServerName www.example.org
  ErrorLog /var/www/www.example.org/logs/error.log
  CustomLog /var/www/www.example.org/logs/access.log common

  # Prevent 'Cross-Site Tracing' attacks
  # (http://www.apacheweek.com/issues/03-01-24#news)
  <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
    RewriteRule .* - [F]
  </IfModule>
</VirtualHost>

Add two lines like this to /usr/local/apache/conf/virtual_hosts, to include the virtual host's config file:

# www.example.org
include conf/vhost/www.example.org

Restart Apache:

sudo /etc/init.d/apache restart

Adding webdav support

Download latest mod_dav source.

tar zxf mod_dav-1.0.3-1.3.6.tar.gz
cd mod_perl-dav.x
/usr/local/configure-wrappers/configure-mod-dav
make
sudo make install

Check apache config syntax, and make sure there are no error from mod_dav loading:

sudo /usr/local/apache/bin/apachectl configtest
sudo /usr/local/apache/bin/apachectl graceful

You should see in apache error log:

Apache/1.3.33 (Unix) DAV/1.0.3 mod_fastcgi/2.4.2 mod_perl/1.29 configured -- resuming normal operations

webdav docs & bugs

Upgrading

Compile and install Apache and FastCGI using mod_perl as described above, then install /usr/local/apache/bin/apachectl (and make it executable).
to top

I Attachment sort Action Size Date Who Comment
apache manage 1.0 K 12 Mar 2003 - 01:06 BenjaminGeer /etc/init.d/apache
apachectl manage 6.9 K 12 Mar 2003 - 01:07 BenjaminGeer /usr/local/apache/bin/apachectl
httpd.conf manage 32.7 K 18 Oct 2003 - 00:00 BenjaminGeer /usr/local/apache/conf/httpd.conf
configure-apache-mod-perl manage 0.6 K 02 Feb 2004 - 13:57 BenjaminGeer ...configure-wrappers/configure-apache-mod-perl
configure-mod-dav manage 0.1 K 05 Jul 2005 - 05:43 ToniPrug mod_dav, enabling webdav protocol, extension to HTTP

Socialtools.StandardApache moved from Socialtools.RabelaisApache on 28 Apr 2003 - 22:46 by BenjaminGeer - put it back
You are here: Socialtools > ServerConfigStandard > StandardApache

to top

Copyright © 1999-2010 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Open-org? Send feedback