Postfix
Postfix
Objectives
1. Postfix
2. Apache Web Server
Version 1 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by 6-1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Migrating from RedHat to SUSE Linux Enterprise Server 10
Objective 1 Postfix
Both, RHEL4 and SUSE Linux Enterprise Server 10, allow to
choose between Sendmail and Postfix as mail server. While
Sendmail is the default mail server under Redhat, the default mail
server in SUSE Linux Enterprise Server 10 is Postfix.
6-2 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by Version 1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Configure Mail and Web Services
Figure 6-1
For security reasons, Postfix works with four mail queues. For
every mail queue, there is a directory bearing the same name under
/var/spool/postfix/.
The functions of the queues and the Postfix files are described in
■ Process of Inbound Email
■ Process of Outbound Email
■ Components of the Postfix Program Package
Version 1 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by 6-3
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Migrating from RedHat to SUSE Linux Enterprise Server 10
The following figure shows how an email can reach Postfix and
how it is processed.
Figure 6-2
The pickup daemon checks it for content, size, and other factors
based on rules; then it passes the email to the cleanup daemon.
6-4 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by Version 1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Configure Mail and Web Services
After this, the email is copied to the incoming queue and the queue
manager /usr/lib/postfix/qmgr is informed of the arrival of this
email.
Then the email is copied to the incoming queue and the queue
manager /usr/lib/postfix/qmgr is informed of the arrival of this
email.
Version 1 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by 6-5
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Migrating from RedHat to SUSE Linux Enterprise Server 10
Figure 6-3
The queue manager fetches an email from the incoming queue and
copies it to the active queue as soon as the active queue contains no
other emails.
6-6 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by Version 1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Configure Mail and Web Services
The queue manager fetches an email from the incoming queue and
copies it to the active queue, as soon as the active queue is empty.
The SMTP service tries to find the mail exchanger specified for the
target host; then it delivers the email to the mail exchanger for the
recipient host.
Emails that cannot be delivered are removed from the active queue
by the queue manager and copied to the deferred queue.
The queue manager then copies this email at regular intervals from
the deferred queue back to the active queue and tries again to
deliver the email.
Version 1 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by 6-7
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Migrating from RedHat to SUSE Linux Enterprise Server 10
6-8 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by Version 1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Configure Mail and Web Services
Configure Postfix
Version 1 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by 6-9
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Migrating from RedHat to SUSE Linux Enterprise Server 10
6-10 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by Version 1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Configure Mail and Web Services
#
=========================================================================
=
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
#
=========================================================================
=
smtp inet n - n - - smtpd
#smtps inet n - n - - smtpd
# -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes
#submission inet n - n - - smtpd
# -o smtpd_enforce_tls=yes -o smtpd_sasl_auth_enable=yes -o
smtpd_etrn_restrict
ions=reject
#628 inet n - n - - qmqpd
pickup fifo n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr fifo n - n 300 1 qmgr
#qmgr fifo n - n 300 1 oqmgr
#tlsmgr fifo - - n 300 1 tlsmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - n - 0 bounce
defer unix - - n - 0 bounce
trace unix - - n - 0 bounce
verify unix - - n - 1 verify
flush unix n - n 1000? 0 flush
proxymap unix - - n - - proxymap
smtp unix - - n - - smtp
relay unix - - n - - smtp
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - n - - showq
error unix - - n - - error
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - n - - lmtp
anvil unix - - n - 1 anvil
#localhost:10025 inet n - n - - smtpd -o
content
_filter=
...
Version 1 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by 6-11
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Migrating from RedHat to SUSE Linux Enterprise Server 10
...
#
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# maildrop. See the Postfix MAILDROP_README file for details.
#
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
cyrus unix - n n - - pipe
user=cyrus argv=/usr/lib/cyrus/bin/deliver -e -r ${sender} -m
${extension} ${u
ser}
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail
($recipient)
ifmail unix - n n - - pipe
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe
flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop
$recipient
vscan unix - n n - 10 pipe
user=vscan argv=/usr/sbin/amavis ${sender} ${recipient}
procmail unix - n n - - pipe
flags=R user=nobody argv=/usr/bin/procmail -t -m /etc/procmailrc
${sender} ${r
ecipient}
If an entry in the file is too long for a specific service, this entry can
be continued in the following lines by adding an empty space at the
beginning of the following line; for example:
6-12 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by Version 1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Configure Mail and Web Services
Version 1 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by 6-13
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Migrating from RedHat to SUSE Linux Enterprise Server 10
6-14 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by Version 1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Configure Mail and Web Services
/etc/postfix/main.cf
Postfix is one of the last services that needs SuSEconfig to run for
generation of the actual configuration files from files located in
/etc/sysconfig/.
Version 1 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by 6-15
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Migrating from RedHat to SUSE Linux Enterprise Server 10
6-16 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by Version 1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Configure Mail and Web Services
Version 1 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by 6-17
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Migrating from RedHat to SUSE Linux Enterprise Server 10
6-18 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by Version 1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Configure Mail and Web Services
■ POSTFIX_UPDATE_CHROOT_JAIL. If SuSEconfig is to
set up the chroot environment, this value should be set to yes.
By default, the variable is set to no.
■ POSTFIX_LAPTOP. Some Postfix services access FIFOs
frequently, thus preventing the hard disk from spinning down.
However, if this is desired on notebooks for power-saving
purposes, the variable can be set to yes.
■ POSTFIX_UPDATE_MAPS. If SuSEconfig is to create the
database files from the corresponding lookup tables, this
variable should be set to yes (default).
■ POSTFIX_MAP_LIST. If POSTFIX_UPDATE_MAPS is set
to yes, you can select the lists Postfix should support here.
■ POSTFIX_RBL_HOSTS. Here you can specify a
comma-separated list of host names from which RBLs
(Realtime Blackhole List) can be obtained.
No mail is accepted from clients that are these lists.
This entry makes sense only if
POSTFIX_BASIC_SPAM_PREVENTION is not set to off.
■ POSTFIX_BASIC_SPAM_PREVENTION. Here, specify
how strict filter rules for UCE (unsolicited commercial email)
should be configured.
Possible levels are off, medium, and hard.
More details you can find at http://www.postfix.org/uce.html.
■ POSTFIX_MDA. Here, specify an MDA with which Postfix
should cooperate.
The entries are
❑ procmail. Use Procmail to deliver mail locally.
❑ cyrus. Use lmtp to deliver to cyrus-imapd.
❑ local. Use Postfix local MDA.
Version 1 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by 6-19
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Migrating from RedHat to SUSE Linux Enterprise Server 10
Apart from this method, further settings can be made directly in the
file /etc/postfix/main.cf, which has very detailed comments.
Following a manual modification of the file /etc/postfix/main.cf,
modifying /etc/sysconfig/postfix and subsequently running of
/sbin/SuSEconfig will not affect the file /etc/postfix/main.cf.
6-20 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by Version 1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Configure Mail and Web Services
/etc/postfix/main.cf
x In case there are multiple lines containing settings for variables, the settings
of the last definition will be used. This allows putting all your configuration
lines at the end of the configuration file.
Version 1 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by 6-21
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Migrating from RedHat to SUSE Linux Enterprise Server 10
6-22 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by Version 1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Configure Mail and Web Services
The variables that are relevant for most deployment scenarios are in
the file
/etc/postfix/main.cf
Variables that are not defined here are assigned default values or
remain empty.
postconf
Version 1 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by 6-23
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Migrating from RedHat to SUSE Linux Enterprise Server 10
If all mail traffic is running from a mail server at the ISP, a small
network merely needs a mail server that accepts the mail from the
clients and passes it to the ISP’s mail server.
Because the local mail server does not serve as the mail server for
the company domain from the Internet, the configuration is rather
simple.
6-24 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by Version 1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Configure Mail and Web Services
The following entries merely ensure that Postfix only accepts mail
from the clients in the local network:
geeko@da51.digitalairlines.com
geeko@digitalairlines.com
On the other hand, the host is important for messages sent to root.
masquerade_exceptions = root
masquerade_domains = digitalairlines.com
The relayhost entry also ensures that Postfix does not attempt to
establish a direct contact to respective mail servers of the recipients.
relayhost = da1.digitailairlines.com
Version 1 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by 6-25
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Migrating from RedHat to SUSE Linux Enterprise Server 10
In this exercise, you send mail in the local network. You configure
Postfix and test your configuration.
(End of Exercise)
6-26 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by Version 1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Configure Mail and Web Services
If the mail server is set up not only for sending email messages of
the users in the local network but also for receiving mail from the
Internet addressed to the domain, configuring it is a bit more
difficult.
inet_interfaces = all
mynetworks_style = subnet
myhostname = da51.digitalairlines.com
mydomain = digitalairlines.com
mydestination = $myhostname, localhost.$mydomain,
$mydomain
Version 1 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by 6-27
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Migrating from RedHat to SUSE Linux Enterprise Server 10
If Postfix is not only responsible for the mail of your domain but
also for the mail of other domains (as is normally the case with web
hosters), the domains are not entered under mydestination but in the
lookup table virtual, which is covered in following section.
maps_rbl_domains = rbl-domains.digitalairlines.com
smtpd_sender_restrictions = reject_maps_rbl
The following entry ensures that email from the range specified in
$mynetworks as well as email for which Postfix is responsible due
to the specifications in $mydomain is accepted—all other mail is
rejected due to reject_unauth_destination:
smtpd_recipient_restrictions = permit_mynetworks,
reject_unauth_destination
6-28 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by Version 1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Configure Mail and Web Services
(End of Exercise)
Version 1 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by 6-29
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Migrating from RedHat to SUSE Linux Enterprise Server 10
Lookup tables contain rules for processing email within the overall
Postfix system.
/etc/postfix/main.cf
/etc/postfix/lookup-table
postmap hash:/etc/postfix/lookup-table
6-30 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by Version 1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Configure Mail and Web Services
smtpd_sender_restrictions = hash:/etc/postfix/access
Version 1 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by 6-31
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Migrating from RedHat to SUSE Linux Enterprise Server 10
The rules are processed from top to bottom and the matching of
rules ends when the first match occurs.
Examples:
postmaster@digitalairlines.com OK
spam@hahaha.net 550 We're fighting against spam!
194.95.93.10 REJECT
6-32 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by Version 1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Configure Mail and Web Services
b See the man pages (man 5 access) for other possible actions.
canonical_maps = hash:/etc/postfix/canonical
The rules are processed from top to bottom and the matching of
rules ends when the first match occurs.
Version 1 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by 6-33
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Migrating from RedHat to SUSE Linux Enterprise Server 10
■ user. Defines a filter for all email addresses with the same user
part, provided the domain part of the email is listed in one of
the variables $myorigin, $mydestination, $inet_interfaces, or
$proxy_interfaces in the /etc/postfix/main.cf file.
■ @domain. Defines a filter for all email addresses of the
specified domain.
Examples:
training@digitalairlines.com geeko@digitalairlines.com
@slc.digitalairlines.com slc@digitalairlines.com
6-34 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by Version 1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Configure Mail and Web Services
recipient_canonical_maps = hash:/etc/postfix/recipient_canonical
The rules are processed from top to bottom and the matching of
rules ends when the first match occurs.
Examples:
geeko@digitalairlines.com training@digitalairlines.com
@slc.digitalairlines.com slc@digitalairlines.com
Version 1 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by 6-35
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Migrating from RedHat to SUSE Linux Enterprise Server 10
The cleanup daemon reads this table when an email arrives before
the generic lookup table /etc/postfix/canonical is read.
sender_canonical_maps = hash:/etc/postfix/sender_canonical
The rules are processed from top to bottom and the matching of
rules ends when the first match occurs.
6-36 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by Version 1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Configure Mail and Web Services
■ user. Defines a filter for all email addresses with the same user
part, provided the domain part of the email is listed in one of
the variables $myorigin, $mydestination, $inet_interfaces, or
$proxy_interfaces of the file /etc/postfix/main.cf.
■ @domain. Defines a filter for all email addresses of the
specified domain.
Examples:
training@digitalairlines.com geeko@digitalairlines.com
@slc.digitalairlines.com slc@digitalairlines.com
relocated_maps = hash:/etc/postfix/relocated
Version 1 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by 6-37
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Migrating from RedHat to SUSE Linux Enterprise Server 10
The rules are processed from top to bottom and the matching of
rules ends when the first match occurs.
Each line consists of a key field in the first column, which refers to
the email address of the former recipient or defines this by means of
a regular expression and contact information in the second column,
which may contain a new email address of the recipient or other
contact information.
Examples:
geeko@digitalairlines.com geeko@novell.com
tux@digitalairlines.com Please call 1-800-PIRATES
6-38 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by Version 1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Configure Mail and Web Services
The notifications of the mail server are sent by email to the sender:
transport_maps = hash:/etc/postfix/transport
Each line defines a rule that is evaluated via the qmgr or the
trivial-rewrite daemon before an email is sent.
The rules are processed from top to bottom and the matching of
rules ends when the first match occurs.
Version 1 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by 6-39
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Migrating from RedHat to SUSE Linux Enterprise Server 10
6-40 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by Version 1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Configure Mail and Web Services
Examples:
digitalairlines.com smtp:da51.digitalairlines.com:10025
suse.com uucp:da150
You can use the /etc/postfix/virtual lookup table to set up email for
a number of domains with separate user names.
virtual_maps = hash:/etc/postfix/virtual
Each line defines a rule that is evaluated via smtpd when an email
arrives.
The rules are processed from top to bottom and the matching of
rules ends when the first match occurs.
Version 1 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by 6-41
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Migrating from RedHat to SUSE Linux Enterprise Server 10
Example:
6-42 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by Version 1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Configure Mail and Web Services
alias_maps = hash:/etc/aliases
The rules are processed from top to bottom and the matching of
rules ends when the first match occurs.
Version 1 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by 6-43
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Migrating from RedHat to SUSE Linux Enterprise Server 10
or
da51:~ # newaliases
6-44 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by Version 1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Configure Mail and Web Services
(End of Exercise)
Version 1 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by 6-45
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Migrating from RedHat to SUSE Linux Enterprise Server 10
Apart from the previously mentioned tools, Postfix also has a whole
range of other useful administration tools that can make life
considerably easier for a postmaster.
6-46 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by Version 1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Configure Mail and Web Services
b For more information about these tools, see the man page man 1
Postfix-Tool.
Version 1 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by 6-47
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Migrating from RedHat to SUSE Linux Enterprise Server 10
6-48 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by Version 1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Configure Mail and Web Services
To run a basic Apache web server, you need to install the following
packages with YaST:
■ apache2. The basic web server software.
■ apache2-prefork. An additional Apache package that
influences the multiprocessing behavior of the web server.
■ apache2-example-pages. Sample HTML pages.
When you install the packages listed above, YaST prompts you to
also install one or more additional packages required by Apache.
Confirm the additional package installation by selecting OK to
resolve all dependencies of the Apache packages.
After installing the required software, you need to start the web
server. Do this as the root user by entering the following:
rcapache2 start
As with all services, enter the following to stop the web server:
rcapache2 stop
Version 1 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by 6-49
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Migrating from RedHat to SUSE Linux Enterprise Server 10
If you want the web server to start up at boot time, you need to enter
the following:
insserv apache2
http://localhost/
Figure 6-4
http://your_system_IP_address/
If your network provides a DNS server, you can use the hostname
instead of the IP address.
6-50 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by Version 1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Configure Mail and Web Services
http://your_server/name_of_subdirectory
Version 1 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by 6-51
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Migrating from RedHat to SUSE Linux Enterprise Server 10
(End of Exercise)
(End of Exercise)
6-52 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by Version 1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Configure Mail and Web Services
Version 1 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by 6-53
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Migrating from RedHat to SUSE Linux Enterprise Server 10
<Directory "/srv/www/htdocs">
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
rcapache2 reload
rcapache2 restart
6-54 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by Version 1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Configure Mail and Web Services
If you are not sure that your changes use the correct syntax, you can
verify the syntax of the configuration files by entering the
following:
apache2ctl configtest
Syntax OK
Version 1 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by 6-55
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Migrating from RedHat to SUSE Linux Enterprise Server 10
In most cases the default settings are suitable and don't need to be
changed.
To use the virtual host feature of Apache, you need to know the
following:
■ The Concept of Virtual Hosts
■ Configure a Virtual Host
With the default setup, the Apache server can be reached with a
browser using the following web addresses (URLs):
■ http://localhost (from the computer where the web server is
running)
■ http://web_server_IP_address
■ http://web_server_hostname
For all of these addresses, Apache serves the same files located in
the DocumentRoot directory.
6-56 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by Version 1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Configure Mail and Web Services
Using this setup, you would need a dedicated computer for every
domain of the Internet. To avoid this, Apache can be configured to
host multiple virtual web servers on one physical system. These
virtual web servers are called virtual hosts.
To access virtual hosts, a DNS entry is needed for every virtual host
of the Apache web server.
Version 1 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by 6-57
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Migrating from RedHat to SUSE Linux Enterprise Server 10
Figure 6-5
DNS Server
Requests IP address for
The same IP address for:
www.example.com
www.example.com
www2.example.com
www3.example.com
www4.example.com
For every virtual host you need to create a configuration file in the
directory /etc/apache2/vhosts.d/. The name of the configuration file
has to end with .conf.
6-58 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by Version 1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Configure Mail and Web Services
After customizing the template file, you need to reload the Apache
web server. You also need to make sure that the settings in DNS are
updated so that the hostname of your virtual host is resolved
correctly.
Version 1 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by 6-59
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Migrating from RedHat to SUSE Linux Enterprise Server 10
(End of Exercise)
6-60 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by Version 1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Configure Mail and Web Services
Summary
Objective Summary
Version 1 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by 6-61
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Migrating from RedHat to SUSE Linux Enterprise Server 10
Objective Summary
6-62 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by Version 1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Configure Mail and Web Services
Objective Summary
Version 1 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by 6-63
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Migrating from RedHat to SUSE Linux Enterprise Server 10
6-64 Copyright © 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by Version 1
a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.