DA-681 Linux
Managing Communications
3-6
# `info libc "Name Service Switch"' for information about this file.
passwd: compat
group: compat
shadow: compat
hosts: files dns
networks: files
protocols:
db files
services: db files
ethers:
db files
rpc: db files
netgroup: nis
Apache Web Server
Default Homepage
The Apache web server’s main configuration file is
/etc/apache2/sites-available/default
, with the default
homepage located at
/var/www/apache2-default/index.html
.
Save your own homepage to the following directory:
/var/www/apache2-default
Save your CGI page to the following directory:
/var/www/apache2-default/cgi-bin/
Add a main page file under cgi-bin directory. For example, you may add a file called index.cgi at
/var/www/apache2-default/cgi-bin/.
#!/bin/sh
# /var/www/apache2-default/cgi-bin/index.cgi
# disable filename globbing
set -f
echo "Content-type: text/plain; charset=iso-8859-1"
echo
echo CGI/1.0 test script report:
echo
echo argc is $#. argv is "$*".
echo
echo SERVER_SOFTWARE = $SERVER_SOFTWARE
echo SERVER_NAME = $SERVER_NAME
echo GATEWAY_INTERFACE = $GATEWAY_INTERFACE
echo SERVER_PROTOCOL = $SERVER_PROTOCOL
echo SERVER_PORT = $SERVER_PORT
echo REQUEST_METHOD = $REQUEST_METHOD
echo HTTP_ACCEPT = "$HTTP_ACCEPT"
echo PATH_INFO = "$PATH_INFO"
echo PATH_TRANSLATED = "$PATH_TRANSLATED"
echo SCRIPT_NAME = "$SCRIPT_NAME"
echo QUERY_STRING = "$QUERY_STRING"
echo REMOTE_HOST = $REMOTE_HOST