apache home page: http://httpd.apache.org/
http protocol: http://en.wikipedia.org/wiki/Http
eerste http rfc: http://www.rfc-editor.org/rfc/rfc1945.txt
huidige http standaard rfc: http://www.rfc-editor.org/rfc/rfc2616.txt
# apt-get install apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common
Suggested packages:
apache2-doc apache2-suexec apache2-suexec-custom
The following NEW packages will be installed:
apache2 apache2-mpm-worker apache2-utils apache2.2-common
The following packages will be upgraded:
apache2.2-bin
1 upgraded, 4 newly installed, 0 to remove and 301 not upgraded.
Need to get 1,819kB of archives.
After this operation, 2,675kB of additional disk space will be used.
Do you want to continue [Y/n]? y
WARNING: The following packages cannot be authenticated!
apache2.2-bin apache2-utils apache2.2-common apache2-mpm-worker apache2
Authentication warning overridden.
Get:1 http://ftp.debian.org testing/main apache2.2-bin 2.2.16-2 [1,344kB]
Get:2 http://ftp.debian.org testing/main apache2-utils 2.2.16-2 [164kB]
Get:3 http://ftp.debian.org testing/main apache2.2-common 2.2.16-2 [307kB]
Get:4 http://ftp.debian.org testing/main apache2-mpm-worker 2.2.16-2 [2,222B]
Get:5 http://ftp.debian.org testing/main apache2 2.2.16-2 [1,384B]
Fetched 1,819kB in 2s (615kB/s)
Reading changelogs... Done
(Reading database ... 105457 files and directories currently installed.)
Preparing to replace apache2.2-bin 2.2.16-1 (using .../apache2.2-bin_2.2.16-2_i386.deb) ...
Unpacking replacement apache2.2-bin ...
Selecting previously deselected package apache2-utils.
Unpacking apache2-utils (from .../apache2-utils_2.2.16-2_i386.deb) ...
Selecting previously deselected package apache2.2-common.
Unpacking apache2.2-common (from .../apache2.2-common_2.2.16-2_i386.deb) ...
Selecting previously deselected package apache2-mpm-worker.
Unpacking apache2-mpm-worker (from .../apache2-mpm-worker_2.2.16-2_i386.deb) ...
Selecting previously deselected package apache2.
Unpacking apache2 (from .../apache2_2.2.16-2_i386.deb) ...
Processing triggers for man-db ...
Setting up apache2.2-bin (2.2.16-2) ...
Setting up apache2-utils (2.2.16-2) ...
Setting up apache2.2-common (2.2.16-2) ...
Enabling site default.
Enabling module alias.
Enabling module autoindex.
Enabling module dir.
Enabling module env.
Enabling module mime.
Enabling module negotiation.
Enabling module setenvif.
Enabling module status.
Enabling module auth_basic.
Enabling module deflate.
Enabling module authz_default.
Enabling module authz_user.
Enabling module authz_groupfile.
Enabling module authn_file.
Enabling module authz_host.
Enabling module reqtimeout.
insserv: warning: script 'K01mintsystem' missing LSB tags and overrides
insserv: warning: script 'mintsystem' missing LSB tags and overrides
Setting up apache2-mpm-worker (2.2.16-2) ...
Starting web server: apache2apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
.
Setting up apache2 (2.2.16-2) ...
Dit hoeft normaal gezien niet te gebeuren. apt-get heeft dit reeds gedaan als alles goed is verlopen.
# /etc/init.d/apache2 restart
Restarting web server: apache2apache2:
Could not reliably determine the server's fully qualified domain name,
using 127.0.1.1 for ServerName
... waiting apache2:
Could not reliably determine the server's fully qualified domain name,
using 127.0.1.1 for ServerName
Deze melding kan je vermijden door in
/etc/apache2/sites-available/default
hetvolgende te plaatsen:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName localhost
DocumentRoot /home/www
<Directory />
Options FollowSymLinks
...
Het gaat echter een gewone warning en geen error. Je kon die trouwens ook al zien gedurende de installatie van apache.
Surf nu met FIREFOX naar http://localhost
Je zou een eenvoudige website moeten zien "It Works !"
In lynx ziet onze website er als volgt uit:
$ lynx localhost
It works! This is the default web page for this server. The web server software is running but no content has been added, yet. Commands: Use arrow keys to move,'?' for help,'q' to quit,'<-' to go back.
Arrow keys: Up and Down to move. Right to follow a link; Left to go back. H)elp O)ptions P)rint G)o M)ain screen Q)uit /=search [delete]=history list |
U kan de versie van apache2 op scherm brengen met
# dpkg -l | grep apache
rc apache-common 1.3.34-4.1+etch1 support files for all Apache webservers
ii apache2 2.2.16-2+etch6 scalable, extendable web server
ii apache2-doc 2.2.16-2+etch6 documentation for apache2
ii apache2-mpm-prefork 2.2.16-2+etch6 Traditional model for Apache HTTPD 2.1
ii apache2-utils 2.2.16-2+etch6 utility programs for webservers
ii apache2.2-common 2.2.16-2+etch6 scalable, extendable web server
De default website "It works!" is terug te vinden in de directory /var/www
Je kan de website aanpassen als root met vim op de file /var/www/index.html
apache2 komt met een binary: /usr/sbin/apache2
en een managementscript: /usr/sbin/apache2ctl
Dit laatste is vergelijkbaar met het opstartscript /etc/init.d/apache2 maar biedt meer mogelijkheden. Een extract uit de man pagina:
$ man apache2ctl
...
start
Start the Apache httpd daemon. Gives an error if it is already
running. This is equivalent to apachectl -k start.
stop
Stops the Apache httpd daemon. This is equivalent to apachectl
-k stop.
restart
Restarts the Apache httpd daemon. If the daemon is not running,
it is started. This command automatically checks the configura‐
tion files as in configtest before initiating the restart to
make sure the daemon doesn’t die. This is equivalent to
apachectl -k restart.
fullstatus
Displays a full status report from mod_status. For this to work,
you need to have mod_status enabled on your server and a text-
based browser such as lynx available on your system. The URL
used to access the status report can be set by editing the STA‐
TUSURL variable in the script.
status
Displays a brief status report. Similar to the fullstatus
option, except that the list of requests currently being served
is omitted.
graceful
Gracefully restarts the Apache httpd daemon. If the daemon is
not running, it is started. This differs from a normal restart
in that currently open connections are not aborted. A side
effect is that old log files will not be closed immediately.
This means that if used in a log rotation script, a substantial
delay may be necessary to ensure that the old log files are
closed before processing them. This command automatically checks
the configuration files as in configtest before initiating the
restart to make sure Apache doesn’t die. This is equivalent to
apachectl -k graceful.
graceful-stop
Gracefully stops the Apache httpd daemon. This differs from a
normal stop in that currently open connections are not aborted.
A side effect is that old log files will not be closed immedi‐
ately. This is equivalent to apachectl -k graceful-stop.
configtest
Run a configuration file syntax test. It parses the configura‐
tion files and either reports Syntax Ok or detailed information
about the particular syntax error. This is equivalent to
apachectl -t.
...