When you’re evaluating netbooks, you have to weigh the convenience of their small form factor against a variety of limitations. Erik Eckel explains several key considerations that will help you find a suitable middle ground.
Who saw this coming? In the day and age of quad-core CPUs, 17-inch laptop displays, and terabyte hard disks, who’d have thought small laptops with slow CPUs and little storage would set the world afire. But that’s just what’s happened.
Wired magazine took note in its February article, in which it said that netbooks “violate all the laws of the computer hardware business.” These small computers, designed mainly for e-mail and Internet use, are not potent systems. With smaller and slower hard disks, little RAM, energy-sipping processors, tiny keyboards, and inexpensive price tags, netbooks can’t even run many mainline applications (such as graphics arts programs, audio/video editing applications, and numerous 3D games).
Yet manufacturers are discovering that many users don’t care. Sales are up, and the category’s hot, with companies tripping over themselves to introduce new netbook models.
Why? Many users seek simple devices they can use to access the Internet, send and receive e-mail, and edit basic office documents and spreadsheets. That’s it. They don’t need expensive features they’ll never really need or use. They just want access to the much heralded “cloud.”
However, not every netbook is right for every user. Before you join the ranks of 8.9-inch, 1.33GHz-CPU, 1GB-RAM netbook users, here are 10 elements to consider.
Note: This article is also available as a PDF download.
1: Operating system
To cut costs and enable aggressive pricing, many netbooks are powered by Linux. Stable and reliable, Linux is also less expensive than Windows. With many netbooks selling for $400 or less, and OEM copies of Windows XP still selling for approximately $100 or more, it’s easy to see how many manufacturers are tempted to pad margins by replacing Windows with Linux.
Further, many of the netbook models featuring Windows have XP Home builds. Those systems can’t host remote connections using Microsoft’s Remote Desktop Connection technology, nor can they properly join Windows server-powered domains, as can Windows XP Professional and Windows Vista Business systems.
2: Display size
Netbooks are designed to be small, lightweight, and portable. One significant tradeoff is screen size. Many of the most popular models feature only seven- or nine-inch screens. Your best bet, before committing to a purchase, is to test using a sample or evaluation unit at a local retailer. Otherwise, you may be underwhelmed when such a small box arrives in the mail.
Many users find ~nine-inch displays the smallest they can comfortably use. Dell’s Inspiron Mini 9- and Asus’ Eee PC 8.9-inch screens, for example, support 1024×600 resolution. While that doesn’t match the 1024×768 resolution that has essentially become the de facto standard for PCs, it’s a tolerable exchange for portability and convenience.
3: Battery life
Netbooks grew from initiatives to build simple laptops that could be used by children in developing countries. As a result, these systems have an energy-conscious heritage, which is doubly important considering most netbooks are used away from homes and offices.
Due to differences in batteries, CPUs, hard disks (solid state versus traditional hard disk drives), and display technologies, battery life varies widely by manufacturer and model. For example, Asus Eee PC 1000HE users can receive as many as five hours of service from a single charge, whereas Wired tests found the HP Mini 2140 lasted only 2.5 hours.
4: Keyboard and pointer buttons
Small is the resounding netbook theme, and that applies to keyboards and track pad options, too. Don’t expect systems with 8.9-inch displays to include full-size keyboards. Keys can actually prove alarmingly small (yet another reason you should test a potential new purchase before buying).
When trying to stuff critical features inside small footprints, designers’ pointer (integrated track pad) options are limited. Most leading netbook brands (Acer, Asus, Dell, HP, Lenovo, and MSI Wind) feature reasonably sized, well-working track pads. Don’t assume, though, that all models’ pointer options or selection buttons are well-designed. Be sure to review a netbook’s pointer configuration carefully to make sure it meets your preferences.
5: Storage space
Many users are accustomed to 80GB, 160GB, or even 250GB notebook hard drives these days. With such vast storage capacity, they haven’t had to limit the number of songs, graphic files, and videos they store on their personal computers. But netbooks are different. Some leading styles include only 16GB solid state drives that, once Windows is loaded, don’t leave acres of space for file storage. Consider your needs and plan accordingly.
Netbook analysis and reviews
* Are netbooks quietly driving us to thin clients and cloud computing?
* Three reasons to pause before deploying netbooks in business
* Product Spotlight reviews:
Lenovo S10 netbook
HP Mini 2140 Notebook PC
Acer Aspire One
ASUS N10 ultraportable notebook
Eee PC 900 netbook running Eeebuntu
6: Optical drive
Remember how a netbook’s theme is small and portable? One of the casualties of the low-cost/lightweight/small form factor profile is the loss of the optical drive. Most netbooks don’t have a CD-ROM or DVD drive. Instead, users must purchase a standalone USB optical drive or transfer CD or DVD images to flash memory drives or over a network to install software on a netbook.
7: Weight
Portability is the key with netbooks. Many of the most popular 8.9-inch display models weigh only two-and-a-half pounds or so. But some may sneak up on you. Rethink machines weighing more than three pounds — too many sub three-pound options are available for you to settle for needless deadweight.
8: Expansion capacity
Many users, when not traveling, want to leverage their netbook as another office system. Some netbooks are more cooperative than others. Review the specifications of the models you’re considering to verify that they have sufficient USB ports and the appropriate video and network connections for your needs.
9: CPU
Don’t be distressed when you review a netbook’s technical specs. The CPU details are not misprints. While your desktop PC may boast a 2.83GHz quad-core CPU, netbooks are anemic by comparison.
The Intel Atom is often the CPU of choice. The Z520 (1.33GHz) and Z530 (1.60GHz) CPUs are among the most popular. Although these chips can’t power demanding graphic editing programs, most 3D games, or engineering applications, they’re more than adequate for accessing e-mail, surfing the Internet, and reviewing and editing most documents, spreadsheets, and presentations.
When reviewing CPU specifications, keep in mind that faster-running chips typically diminish battery life. Thus, it’s a never-ending tradeoff: performance versus battery service.
10: Integrated wireless options
If netbooks are to connect you to the cloud, they must have wireless connectivity. Any more, that doesn’t just mean connecting to 802.11g Wi-Fi networks. Many users require 802.11n or Bluetooth connectivity, while still others need their netbooks to connect to cellular networks.
Fortunately, netbook manufacturers are paying attention. Most leading brands include Bluetooth connectivity, at least as an optional component. Still others offer customers the choice of adding integrated cellular mobile broadband adapters.
If these options are important to you, hold out for a model that has the proper wireless options. The alternative is to become dependent upon a bulky dongle, and that’s quickly become old-fashioned.
Finally: 10 Things… the newsletter!
Get the key facts on a wide range of technologies, techniques, strategies, and skills with the help of the concise need-to-know lists featured in TechRepublic’s 10 Things newsletter, delivered every Friday
Wednesday, April 22
Thursday, April 16
another FreeBSD postfix
Contents
* Introduction
* Resources
* Installing postfix from cvs
* Post-Installation Requirements for postfix
* Configuring postfix as a Null Client
* Starting and Testing postfix
Introduction
The previous articles in this series have got you as far as installing perl-5.8 from source, and now we're ready to do some serious work. So why do we need to install an email system on the server first?
Your server is going to run headless which means you don't use it for everyday stuff. You don't need a keyboard, mouse, or display to control it, because that's happening though the ssh interface via PuTTY. In fact, your server is going to sit in a closet and you won't even know it's there.
Which brings us back to email. Your server is going to email you stuff like security reports and daily system checks. Once you get the bug tracker installed, it's going to email team members bug reports and other useful information.
So why not stick with the default sendmail system that ships with FreeBSD? After all, it reportedly handles about 50% of the Internet's email. The reason is that a casual system administrator (you) has little or no chance of really understanding the arcane syntax of the sendamil config file(s). So we're not even going to try. We're going to use postfix instead.
In this article, we'll get postfix installed from source, and learn a bit about figuring out build dependencies. I'll show you how to set up the mailer as a null client, which means it does not receive or route any local mail. It just sends mail to your local mail host or directly to the Internet.
Resources
The postfix program has a wide following, so natuarally it has its own web site with an excellent summary of existing .
The O'Reilly OnLamp website also has a decent article on basic installation and configuration.
For those that really want to dig deep on the internals of postfix, there is the obligatory O'Relly postfix book.
Installing postfix from cvs
Installing postfix from source is relatively straightforward. The first thing to do is figure out if the port requires any other libraries or applications. This is relatively easy if you use the FreeBSD Posts Search page to look for ports with "postfix" in the package name. Here's clickable query link...
http://www.freebsd.org/cgi/ports.cgi?query=postfix&stype=name
We're lucky here, there aren't too many packages with "postfix" in the name. A quick look at the list tells us that the available ports are:
* postfix-2.2.20040504 - which is really called postfix-current
* postfix-2.1.4 - which is really called postfix
Depending on how risk averse you are, I'd pick postfix over postfix-current, unless you absolutely need the latest bleeding edge updates - and for our system, I'm not sure we do.
Either way, have a look at the "Requires" line for the port, and you'll see that pcre-4.5 is needed to build and run postfix. Click on the link for pcre-4.5 and you'll see that it's in the devel category. And it looks like pcre-4.5 has a requirement for libtool-1.5.6_1 which is also in the devel category.
In short, postfix has the following dependencies:
mail/postfix
+- devel/pcre
+- devel/libtool15
Remember that you figure out the download name of the port by clicking on the "Description" link and checking the title of the page you end up on. After a while, you'll figure out that you can just hover the mouse over the "Description" link and get the name from the status bar of your browser.
Now we have enough information to go and get the relevant port files to build postfix. Here are the commands I used to get postfix, as root of course.
setenv CVSROOT :pserver:anoncvs@anoncvs.fr.FreeBSD.org:/home/ncvs
cd /usr
cvs login
cvs checkout -A -P -r RELEASE_4_10_0 ports/devel/libtool15
cvs checkout -A -P -r RELEASE_4_10_0 ports/devel/pcre
cvs checkout -A -P -r RELEASE_4_10_0 ports/mail/postfix
cvs logout
Building postfix is now simply a matter of:
cd /usr/ports/mail/postfix
make install
The postfix install script is interactive. Don't change anything and just tab over to the "OK" and hit return to accept all the defaults. As the build porgresses, you may (depending on how long ago this was written) see the following scary looking bit of output:
===> postfix-2.0.19,1 depends on shared library: pcre.0 - not found
===> Verifying install for pcre.0 in /usr/ports/devel/pcre
===> pcre-4.5 is marked as broken: unknown LIBTOOL version: 14.
Don't panic. It's just telling us we actually need libtool14 instead of libtool15. So all we need to do is download that port, like this:
setenv CVSROOT :pserver:anoncvs@anoncvs.fr.FreeBSD.org:/home/ncvs
cd /usr
cvs login
cvs checkout -A -P -r RELEASE_4_10_0 ports/devel/libtool14
cvs logout
and restart the build...
cd /usr/ports/postfix
make install
A little while later, you'll get the following prompts if everything goes well:
Would you like to activate Postfix in /etc/mail/mailer.conf [n]?
Answer "y" and hit Enter. Then you'll see this prompt:
You need user "postfix" added to group "mail".
Would you like me to add it [y]?
Again, answer "y" and hit Enter. That's all the interactive stuff until the installation is complete.
Post-Installation Requirements for postfix
Assuming postfix installed well, and that everything worked, now we need to do some post-install configuration before going much further.
Here's a copy of some important information that scolls by near the the end of the install procedure. I've broken down into useful chunks for discussion...
If you have postfix configured in your /etc/mail/mailer.conf (answered yes to
the previous question) and would like to enable postfix to start at boot time,
please set these variables in your /etc/rc.conf file:
sendmail_enable="YES"
sendmail_flags="-bd"
sendmail_pidfile="/var/spool/postfix/pid/master.pid"
sendmail_outbound_enable="NO"
sendmail_submit_enable="NO"
sendmail_msp_queue_enable="NO"
This will disable Sendmail completely.
Alternatively to the above settings, you can enable postfix to start with
the other local services, for example, after your database server starts if
you need it to be running for postfix. To do this, set in your rc.conf file:
sendmail_enable="NONE"
Then make the following symbolic link:
cd /usr/local/etc/rc.d
ln -s /usr/local/sbin/postfix postfix.sh
For my installation, I copied the first set of variables and pasted them into my /etc/rc.conf file.
Also, you will want to disable some Sendmail-specific daily maintenance
routines in your /etc/periodic.conf file:
daily_clean_hoststat_enable="NO"
daily_status_mail_rejects_enable="NO"
daily_status_include_submit_mailq="NO"
daily_submit_queuerun="NO"
This turned out ot be unnecessary as there is no /etc/periodic.conf file yet on our minimal server, and besides, we disabled sendmail as part of the initial installation of FreeBSD.
If you are using SASL, you need to make sure that postfix has access to read
the sasldb file. This is accomplished by adding postfix to group mail and
making the /usr/local/etc/sasldb* file(s) readable by group mail (this should
be the default for new installs).
We're not using SASL, so don't do anything. That's all there is for the post-install step, now let's move on to configuring postfix.
Configuring postfix as a Null Client
Our minimal embedded development team server is not going to be a complete mail system. In fact, it's only ever going to send mail to others. We won't enable it to receive email until later, if at all. A server that only sends mail is acalled a null client in postfix terminology.
So the first thing to do is to disable the ability of postfix to pick up mail. You do that by editing your configuration files as suggested in this section on setting up a null client. Wait. Slow down. Let's figure out what this really means. Especially the part about disabling local mail delivery. Exactly what do we touch in the master.cf file to make this happen?
Here's a copy of the relevant parts of my master.cf file that ends up disabling the mail receive and distribute capability of postfix:
# ==========================================================================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ==========================================================================
#smtp inet n - n - - smtpd
#submission inet n - n - - smtpd
# -o smtpd_etrn_restrictions=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
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
See how the smtp and local services are commented out by prefixing them with a "#" - that's all there is to it. Save the file, and now we can figure out the setup for the rest of the system.
I'm running my server on my local network. I've got a Linksys wireless router that handles all the traffic inside the house, and it's connected to my DSL modem. My DSL modem gets an IP address assigned by my local ISP.
To make things even more complicated, I do happen to have a real domain name, but it's hosted by a company across the country. Finally, my ISP (like many others) will not accept email unless it can verify that the domain name that the mail appears to be coming from is in fact real.
On a default setup of postfix, you need to touch exactly three things to send mail out the door. Here's the relevant section from my main.cf file:
# INTERNET HOST AND DOMAIN NAMES
#
# The myhostname parameter specifies the internet hostname of this
# mail system. The default is to use the fully-qualified domain name
# from gethostname(). $myhostname is used as a default value for many
# other configuration parameters.
#
#myhostname = host.domain.tld
#myhostname = virtual.domain.tld
myhostname = funkenfanger
# The mydomain parameter specifies the local internet domain name.
# The default is to use $myhostname minus the first component.
# $mydomain is used as a default value for many other configuration
# parameters.
#
#mydomain = domain.tld
mydomain = hempeldesigngroup.com
# SENDING MAIL
#
# The myorigin parameter specifies the domain that locally-posted
# mail appears to come from. The default is to append $myhostname,
# which is fine for small sites. If you run a domain with multiple
# machines, you should (1) change this to $mydomain and (2) set up
# a domain-wide alias database that aliases each user to
# user@that.users.mailhost.
#
# For the sake of consistency between sender and recipient addresses,
# myorigin also specifies the default domain name that is appended
# to recipient addresses that have no @domain part.
#
#myorigin = $myhostname
#myorigin = $mydomain
myorigin = $mydomain
All I've done here is added lines to specify myhostname, mydomain and myorigin to reasonable values. The most important one is myorigin, because it needs to be a real domain name or else your mail host is likely to bounce it right back, or worse silently ignore it.
So, to recap, just set myhostname, mydomain and myorigin, makeing sure that myorigin is a real domain. If you are unsure of what to put there for now, use example.com which is reserved for documentation but does actually resolve to an address.
Starting and Testing postfix
Hold on, we're almost done. If you haven't rebooted since we started this article (and why would you) you'll need to start postfix manually. This is accomplished as follows:
postfix start
Any time you make changes to a currently running postfix installation, you'll need to let postfix know so it can parse the changes. Here's how:
postfix reload
Testing your system is as easy as sending yourself some email. I'm assuming that if you are reading this, you have acess to email. We haven't got a fancy GUI installed on our box, and we're using PuTTY to access it, so how are we going to send email?
Well, back in the deep dark past of the early Internet, the hackers of the stone-age were able to send email using a command line interface! Yes, it's true!
Here's a transcript of my test email session....
funkenfanger# mail
Mail version 8.1 6/6/93. Type ? for help.
"/var/mail/sysadmin": 0 messages
& m rhempel@bmts.com
Subject: Test Message
Postfix is up and running on funkenfanger!
.
EOT
& q
funkenfanger#
Pretty primitive, huh? The "&" is mail's idea of a prompt. The "m" followed by an email address is how youstart an email, then you are prompted for a subject line. After that comes the body of your email. The end of the email is signified by a single "." on a line all by itself, which then returns you to the "&" prompt and the "q" gets us back to the standard command prompt.
Of course, you'll use your own email address when testing your postfix installation! Although I'll be happy to get email form you describing how easy it was to get this far, I really don't want to see all of your test emails.
Once you're back at the command prompt, you can check to see if the mail went out as follows:
funkenfanger# mailq
Mail queue is empty
funkenfanger#
In a few minutes, fire up your email client and check your mail. You should get an email from "Charlie Root" with the subject and body you just typed in. If not, yo umight want to check the last few lines of /var/log/maillog to see if there are any error messages that can help you figure out what went wrong.
Well, that's it! We're done with the postfix setup. You'll be getting at least two emails a day from your server. One is the daily run output, and the other is the security run output. They'll give you a basic idea of how your box is doing, how many times other folks tried to hack it, and other useful stuff like disk usage statistics.
Now we can move on to getting Apache 2 up and running. See you at the next article.
* Introduction
* Resources
* Installing postfix from cvs
* Post-Installation Requirements for postfix
* Configuring postfix as a Null Client
* Starting and Testing postfix
Introduction
The previous articles in this series have got you as far as installing perl-5.8 from source, and now we're ready to do some serious work. So why do we need to install an email system on the server first?
Your server is going to run headless which means you don't use it for everyday stuff. You don't need a keyboard, mouse, or display to control it, because that's happening though the ssh interface via PuTTY. In fact, your server is going to sit in a closet and you won't even know it's there.
Which brings us back to email. Your server is going to email you stuff like security reports and daily system checks. Once you get the bug tracker installed, it's going to email team members bug reports and other useful information.
So why not stick with the default sendmail system that ships with FreeBSD? After all, it reportedly handles about 50% of the Internet's email. The reason is that a casual system administrator (you) has little or no chance of really understanding the arcane syntax of the sendamil config file(s). So we're not even going to try. We're going to use postfix instead.
In this article, we'll get postfix installed from source, and learn a bit about figuring out build dependencies. I'll show you how to set up the mailer as a null client, which means it does not receive or route any local mail. It just sends mail to your local mail host or directly to the Internet.
Resources
The postfix program has a wide following, so natuarally it has its own web site with an excellent summary of existing .
The O'Reilly OnLamp website also has a decent article on basic installation and configuration.
For those that really want to dig deep on the internals of postfix, there is the obligatory O'Relly postfix book.
Installing postfix from cvs
Installing postfix from source is relatively straightforward. The first thing to do is figure out if the port requires any other libraries or applications. This is relatively easy if you use the FreeBSD Posts Search page to look for ports with "postfix" in the package name. Here's clickable query link...
http://www.freebsd.org/cgi/ports.cgi?query=postfix&stype=name
We're lucky here, there aren't too many packages with "postfix" in the name. A quick look at the list tells us that the available ports are:
* postfix-2.2.20040504 - which is really called postfix-current
* postfix-2.1.4 - which is really called postfix
Depending on how risk averse you are, I'd pick postfix over postfix-current, unless you absolutely need the latest bleeding edge updates - and for our system, I'm not sure we do.
Either way, have a look at the "Requires" line for the port, and you'll see that pcre-4.5 is needed to build and run postfix. Click on the link for pcre-4.5 and you'll see that it's in the devel category. And it looks like pcre-4.5 has a requirement for libtool-1.5.6_1 which is also in the devel category.
In short, postfix has the following dependencies:
mail/postfix
+- devel/pcre
+- devel/libtool15
Remember that you figure out the download name of the port by clicking on the "Description" link and checking the title of the page you end up on. After a while, you'll figure out that you can just hover the mouse over the "Description" link and get the name from the status bar of your browser.
Now we have enough information to go and get the relevant port files to build postfix. Here are the commands I used to get postfix, as root of course.
setenv CVSROOT :pserver:anoncvs@anoncvs.fr.FreeBSD.org:/home/ncvs
cd /usr
cvs login
cvs checkout -A -P -r RELEASE_4_10_0 ports/devel/libtool15
cvs checkout -A -P -r RELEASE_4_10_0 ports/devel/pcre
cvs checkout -A -P -r RELEASE_4_10_0 ports/mail/postfix
cvs logout
Building postfix is now simply a matter of:
cd /usr/ports/mail/postfix
make install
The postfix install script is interactive. Don't change anything and just tab over to the "OK" and hit return to accept all the defaults. As the build porgresses, you may (depending on how long ago this was written) see the following scary looking bit of output:
===> postfix-2.0.19,1 depends on shared library: pcre.0 - not found
===> Verifying install for pcre.0 in /usr/ports/devel/pcre
===> pcre-4.5 is marked as broken: unknown LIBTOOL version: 14.
Don't panic. It's just telling us we actually need libtool14 instead of libtool15. So all we need to do is download that port, like this:
setenv CVSROOT :pserver:anoncvs@anoncvs.fr.FreeBSD.org:/home/ncvs
cd /usr
cvs login
cvs checkout -A -P -r RELEASE_4_10_0 ports/devel/libtool14
cvs logout
and restart the build...
cd /usr/ports/postfix
make install
A little while later, you'll get the following prompts if everything goes well:
Would you like to activate Postfix in /etc/mail/mailer.conf [n]?
Answer "y" and hit Enter. Then you'll see this prompt:
You need user "postfix" added to group "mail".
Would you like me to add it [y]?
Again, answer "y" and hit Enter. That's all the interactive stuff until the installation is complete.
Post-Installation Requirements for postfix
Assuming postfix installed well, and that everything worked, now we need to do some post-install configuration before going much further.
Here's a copy of some important information that scolls by near the the end of the install procedure. I've broken down into useful chunks for discussion...
If you have postfix configured in your /etc/mail/mailer.conf (answered yes to
the previous question) and would like to enable postfix to start at boot time,
please set these variables in your /etc/rc.conf file:
sendmail_enable="YES"
sendmail_flags="-bd"
sendmail_pidfile="/var/spool/postfix/pid/master.pid"
sendmail_outbound_enable="NO"
sendmail_submit_enable="NO"
sendmail_msp_queue_enable="NO"
This will disable Sendmail completely.
Alternatively to the above settings, you can enable postfix to start with
the other local services, for example, after your database server starts if
you need it to be running for postfix. To do this, set in your rc.conf file:
sendmail_enable="NONE"
Then make the following symbolic link:
cd /usr/local/etc/rc.d
ln -s /usr/local/sbin/postfix postfix.sh
For my installation, I copied the first set of variables and pasted them into my /etc/rc.conf file.
Also, you will want to disable some Sendmail-specific daily maintenance
routines in your /etc/periodic.conf file:
daily_clean_hoststat_enable="NO"
daily_status_mail_rejects_enable="NO"
daily_status_include_submit_mailq="NO"
daily_submit_queuerun="NO"
This turned out ot be unnecessary as there is no /etc/periodic.conf file yet on our minimal server, and besides, we disabled sendmail as part of the initial installation of FreeBSD.
If you are using SASL, you need to make sure that postfix has access to read
the sasldb file. This is accomplished by adding postfix to group mail and
making the /usr/local/etc/sasldb* file(s) readable by group mail (this should
be the default for new installs).
We're not using SASL, so don't do anything. That's all there is for the post-install step, now let's move on to configuring postfix.
Configuring postfix as a Null Client
Our minimal embedded development team server is not going to be a complete mail system. In fact, it's only ever going to send mail to others. We won't enable it to receive email until later, if at all. A server that only sends mail is acalled a null client in postfix terminology.
So the first thing to do is to disable the ability of postfix to pick up mail. You do that by editing your configuration files as suggested in this section on setting up a null client. Wait. Slow down. Let's figure out what this really means. Especially the part about disabling local mail delivery. Exactly what do we touch in the master.cf file to make this happen?
Here's a copy of the relevant parts of my master.cf file that ends up disabling the mail receive and distribute capability of postfix:
# ==========================================================================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ==========================================================================
#smtp inet n - n - - smtpd
#submission inet n - n - - smtpd
# -o smtpd_etrn_restrictions=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
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
See how the smtp and local services are commented out by prefixing them with a "#" - that's all there is to it. Save the file, and now we can figure out the setup for the rest of the system.
I'm running my server on my local network. I've got a Linksys wireless router that handles all the traffic inside the house, and it's connected to my DSL modem. My DSL modem gets an IP address assigned by my local ISP.
To make things even more complicated, I do happen to have a real domain name, but it's hosted by a company across the country. Finally, my ISP (like many others) will not accept email unless it can verify that the domain name that the mail appears to be coming from is in fact real.
On a default setup of postfix, you need to touch exactly three things to send mail out the door. Here's the relevant section from my main.cf file:
# INTERNET HOST AND DOMAIN NAMES
#
# The myhostname parameter specifies the internet hostname of this
# mail system. The default is to use the fully-qualified domain name
# from gethostname(). $myhostname is used as a default value for many
# other configuration parameters.
#
#myhostname = host.domain.tld
#myhostname = virtual.domain.tld
myhostname = funkenfanger
# The mydomain parameter specifies the local internet domain name.
# The default is to use $myhostname minus the first component.
# $mydomain is used as a default value for many other configuration
# parameters.
#
#mydomain = domain.tld
mydomain = hempeldesigngroup.com
# SENDING MAIL
#
# The myorigin parameter specifies the domain that locally-posted
# mail appears to come from. The default is to append $myhostname,
# which is fine for small sites. If you run a domain with multiple
# machines, you should (1) change this to $mydomain and (2) set up
# a domain-wide alias database that aliases each user to
# user@that.users.mailhost.
#
# For the sake of consistency between sender and recipient addresses,
# myorigin also specifies the default domain name that is appended
# to recipient addresses that have no @domain part.
#
#myorigin = $myhostname
#myorigin = $mydomain
myorigin = $mydomain
All I've done here is added lines to specify myhostname, mydomain and myorigin to reasonable values. The most important one is myorigin, because it needs to be a real domain name or else your mail host is likely to bounce it right back, or worse silently ignore it.
So, to recap, just set myhostname, mydomain and myorigin, makeing sure that myorigin is a real domain. If you are unsure of what to put there for now, use example.com which is reserved for documentation but does actually resolve to an address.
Starting and Testing postfix
Hold on, we're almost done. If you haven't rebooted since we started this article (and why would you) you'll need to start postfix manually. This is accomplished as follows:
postfix start
Any time you make changes to a currently running postfix installation, you'll need to let postfix know so it can parse the changes. Here's how:
postfix reload
Testing your system is as easy as sending yourself some email. I'm assuming that if you are reading this, you have acess to email. We haven't got a fancy GUI installed on our box, and we're using PuTTY to access it, so how are we going to send email?
Well, back in the deep dark past of the early Internet, the hackers of the stone-age were able to send email using a command line interface! Yes, it's true!
Here's a transcript of my test email session....
funkenfanger# mail
Mail version 8.1 6/6/93. Type ? for help.
"/var/mail/sysadmin": 0 messages
& m rhempel@bmts.com
Subject: Test Message
Postfix is up and running on funkenfanger!
.
EOT
& q
funkenfanger#
Pretty primitive, huh? The "&" is mail's idea of a prompt. The "m" followed by an email address is how youstart an email, then you are prompted for a subject line. After that comes the body of your email. The end of the email is signified by a single "." on a line all by itself, which then returns you to the "&" prompt and the "q" gets us back to the standard command prompt.
Of course, you'll use your own email address when testing your postfix installation! Although I'll be happy to get email form you describing how easy it was to get this far, I really don't want to see all of your test emails.
Once you're back at the command prompt, you can check to see if the mail went out as follows:
funkenfanger# mailq
Mail queue is empty
funkenfanger#
In a few minutes, fire up your email client and check your mail. You should get an email from "Charlie Root" with the subject and body you just typed in. If not, yo umight want to check the last few lines of /var/log/maillog to see if there are any error messages that can help you figure out what went wrong.
Well, that's it! We're done with the postfix setup. You'll be getting at least two emails a day from your server. One is the daily run output, and the other is the security run output. They'll give you a basic idea of how your box is doing, how many times other folks tried to hack it, and other useful stuff like disk usage statistics.
Now we can move on to getting Apache 2 up and running. See you at the next article.
FreeBSD postfix
Apache22
cd /usr/ports/www/apache22
make install
echo 'apache22_enable="YES"' >> /etc/rc.conf
PHP4
cd /usr/ports/lang/php4
make install
* CLI
* CGI
* Apache module
* Suhosin (?)
* IPV6 (?)
* FastCGI
* Pathinfo
* OpenSSL
* Zlib
Add the typehandler to apache config.
ee /usr/local/etc/apache22/httpd.conf
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
DirectoryIndex index.html index.php
Mysql 5.0
cd /usr/ports/databases/mysql50-server
make install
echo 'mysql_enable="YES"' >> /etc/rc.conf
mysqladmin -u root password
phpMyAdmin
cd /usr/ports/databases/phpmyadmin
make install
* All except MysqlI (only php5)
Configuration of phpmyadmin:
cd /usr/local/www/phpMyAdmin
cp libraries/config.default.php config.inc.php
ee config.inc.php
$cfg['Servers'][$i]['auth_type'] = 'http';
$cfg['Servers'][$i]['user'] = '';
Add phpmyadmin to the apache config.
ee /usr/local/etc/apache22/httpd.conf
Insert:
Alias /phpmyadmin/ "/usr/local/www/phpMyAdmin/"
Options none
AllowOverride Limit
Order Allow,Deny
Allow from all
Subversion
whereis subversion
cd
make install WITHOUT_BDB=yes
Proftpd
cd /usr/ports/ftp/proftpd
make install
echo 'proftpd_enable="YES"' >> /etc/rc.conf
Additions to the config file.
ee /usr/local/etc/proftpd.conf
AllowRetrieveRestart on
AllowStoreRestart on
Mail server
Postfix
First I install the postfix
cd /usr/ports/mail/postfix
make install
* SASL 2
* TLS
* MySQL
If you not need sendmail anymore, please add in your rc.conf:
sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
And you can disable some sendmail specific daily maintenance routines in your
/etc/periodic.conf file:
daily_clean_hoststat_enable="NO"
daily_status_mail_rejects_enable="NO"
daily_status_include_submit_mailq="NO"
daily_submit_queuerun="NO"
Add the user to the virtual dirs
pw groupadd vmail -g 5001
pw useradd vmail -u 5001 -g 5001 -s/sbin/nologin -d/dev/null
mkdir /usr/local/vmail
chown -R vmail:vmail /usr/local/vmail
chmod -R ug+rwx,o-rwx /usr/local/vmail
The database table layout files
ee /usr/local/etc/postfix/mysql_virtual_alias_maps.cf
user = postfix
password = postfix
hosts = localhost
dbname = postfix
query = SELECT goto FROM alias WHERE address='%s' AND active = 1
ee /usr/local/etc/postfix/mysql_virtual_domains_maps.cf
user = postfix
password = postfix
hosts = localhost
dbname = postfix
query = SELECT domain FROM domain WHERE domain='%s'
#optional query to use when relaying for backup MX
#query = SELECT domain FROM domain WHERE domain='%s' and backupmx = '0' and active = '1'
ee /usr/local/etc/postfix/mysql_virtual_mailbox_maps.cf
user = postfix
password = postfix
hosts = localhost
dbname = postfix
query = SELECT maildir FROM mailbox WHERE username='%s' AND active = 1
ee /usr/local/etc/postfix/mysql_virtual_mailbox_limit_maps.cf
user = postfix
password = postfix
hosts = localhost
dbname = postfix
query = SELECT quota FROM mailbox WHERE username='%s'
ee /usr/local/etc/postfix/mysql_relay_domains_maps.cf
user = postfix
password = postfix
hosts = localhost
dbname = postfix
query = SELECT domain FROM domain WHERE domain='%s' and backupmx = '1'
chown root:postfix /usr/local/etc/postfix/mysql_*.cf
chmod 640 /usr/local/etc/postfix/mysql_*.cf
Edit the postfix main.cf config file
ee /usr/local/etc/postfix/main.cf
myhostname = teststar.nickit.dk
mydomain = nickit.dk
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost
local_recipient_maps = proxy:unix:passwd.byname $alias_maps
mynetworks = $config_directory/mynetworks
relay_domains = mysql:/usr/local/etc/postfix/mysql_relay_domains_maps.cf
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
header_checks = regexp:/usr/local/etc/postfix/header_checks
# Next, add all these to the bottom of the file :
#
# Virtual Mail Mysql settings
#
virtual_alias_maps = mysql:/usr/local/etc/postfix/mysql_virtual_alias_maps.cf
virtual_uid_maps = static:5001
virtual_gid_maps = static:5001
virtual_mailbox_base = /usr/local/vmail
virtual_mailbox_domains = mysql:/usr/local/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_limit = 51200000
virtual_mailbox_maps = mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 5001
# Who handles the mail delivery?
# POSTFIX = virtual
# MAILDROP = maildrop
#
#virtual_transport = virtual
virtual_transport = maildrop
maildrop_destination_recipient_limit = 1
# Transport map
transport_maps = hash:/usr/local/etc/postfix/transport
vacation_destination_recipient_limit = 1
# Additional for quota support
virtual_create_maildirsize = yes
virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = Sorry, the user's maildir has overdrawn his diskspace quota, please try again later.
###################################################################################
### ENABLE SASL SUPPORT ( SMTP-AUTH )
# smtpd_sasl_auth_enable = yes
# Enable SASL support in postfix
# smtpd_sasl_security_options = noanonymous
# Anonymous logins will not be permitted
# broken_sasl_auth_clients = yes
# Allow RFC-broken mail clients like Outlook Express4 to use SMTP AUTH
# smtpd_sasl_path = smptd
# Tells SASL to get the config from /usr/lib64/sasl2/smptd.conf
# smtpd_sasl_local_domain =
# If the user fails to nominate a domain, don't auto append one
# smtpd_sasl_authenticated_header = yes
# Include the authenticated username in the message headers.
# Having this on will make it easier if a spammer cracks one of your user's weak passwords,
# and starts using SMTP-AUTH to relay spam through your server
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_path = smtpd
smtpd_sasl_local_domain =
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_non_fqdn_hostname,reject_non_fqdn_sender,reject_non_fqdn_recipient,reject_unauth_destination,reject_unauth_pipelining,reject_invalid_hostname,reject_rbl_client opm.blitzed.org,reject_rbl_client list.dsbl.org,reject_rbl_client bl.spamcop.net,reject_rbl_client sbl-xbl.spamhaus.org
##################################################################################
### ENABLE TLS SUPPORT ( "STARTTLS" ... enables SSL to be negotiated during a SMTP connection )
# smtp_use_tls = no
# dont enable TLS for outbound SMTP connections
# smtpd_use_tls = yes
# announce TLS availability for incoming SMTP connections
# smtpd_tls_auth_only = no :
# TLS is optional, not enforced
# smtpd_tls_key_file :
# specify the private key ( must not be encrypted - ie no password)
# smtpd_tls_cert_file :
# specify the certificate
# smtpd_tls_session_cache_database :
# nominate a server-side TLS session cache. Improves performance.
# smtpd_tls_loglevel = 1 :
# log basic TLS handshake and cert info
# smtpd_tls_received_header = yes
# record some protocol/cipher etc info in the Received header smtp_use_tls = no
smtp_use_tls = no
smtpd_use_tls = yes
smtpd_tls_auth_only = no
smtpd_tls_key_file = /usr/local/ssl/mail.yourdomain.com.key
smtpd_tls_cert_file = /usr/local/ssl/mail.yourdomain.com.crt
smtpd_tls_session_cache_database = btree:/usr/local/etc/postfix/tls_smtpd_scache
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
Populate the mynetworks file
echo '# Localhost' > /usr/local/etc/postfix/mynetworks
echo '127.0.0.0/8' >>/usr/local/etc/postfix/mynetworks
echo '' >>/usr/local/etc/postfix/mynetworks
Addition to the sasl config
ee /usr/local/lib/sasl2/smtpd.conf
pwcheck_method: authdaemond
log_level: 3
mech_list: PLAIN LOGIN
authdaemond_path:/var/run/authdaemond/socket
chown root:vmail /usr/local/lib/sasl2/smtpd.conf
chmod 640 /usr/local/lib/sasl2/smtpd.conf
ee /usr/local/etc/postfix/master.cf
smtp inet n - n - - smtpd
567 inet n - n - - smtpd
smtps inet n - n - - smtpd
-o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes
Aliases
ee /etc/aliases
root: someone@yourdomain.com
newaliases
PostfixAdmin
cd /usr/ports/mail/postfixadmin
make install
* MySQL
Configuration of the apache
ee /usr/local/etc/apache22/httpd.conf
Alias /mailadmin/ "/usr/local/www/postfixadmin/"
#AllowOverride AuthConfig
Options Indexes
AllowOverride ALL
Order allow,deny
Allow from all
Configuration of the database tables
cd /usr/local/www/postfixadmin
mysql -u root [-p] < DATABASE_MYSQL.TXT
cd /usr/local/www/postfixadmin
chmod 640 *.php *.css
cd /usr/local/www/postfixadmin/admin/
chmod 640 *.php .ht*
cd /usr/local/www/postfixadmin/images/
chmod 640 *.gif *.png
cd /usr/local/www/postfixadmin/languages/
chmod 640 *.lang
cd /usr/local/www/postfixadmin/templates/
chmod 640 *.tpl
cd /usr/local/www/postfixadmin/users/
chmod 640 *.php
ee /usr/local/www/postfixadmin/config.inc.php
// Mailboxes
// If you want to store the mailboxes per domain set this to 'YES'.
// Example: /usr/local/virtual/domain.tld/username@domain.tld
$CONF['domain_path'] = 'YES';
// If you don't want to have the domain in your mailbox set this to 'NO'.
// Example: /usr/local/virtual/domain.tld/username
$CONF['domain_in_mailbox'] = 'NO';
Courier - Imap
cd /usr/ports/mail/courier-imap
make install
* Mysql
echo 'courier_authdaemond_enable="YES"' >> /etc/rc.conf
echo 'courier_imap_imapd_enable="YES"' >> /etc/rc.conf
echo 'courier_imap_pop3d_enable="YES"' >> /etc/rc.conf
echo 'courier_imap_pop3d_ssl_enable="YES"' >> /etc/rc.conf
echo 'courier_imap_imapd_ssl_enable="YES"' >> /etc/rc.conf
chmod 755 /var/run/authdaemond/
Configuration
ee /usr/local/etc/authlib/authdaemonrc
authmodulelist="authmysql
ee /usr/local/etc/authlib/authmysqlrc
MYSQL_SERVER localhost
MYSQL_USERNAME postfix
MYSQL_PASSWORD postfix
MYSQL_SOCKET /tmp/mysql.sock
MYSQL_PORT 0
MYSQL_OPT 0
MYSQL_DATABASE postfix
MYSQL_USER_TABLE mailbox
MYSQL_CRYPT_PWFIELD password
MYSQL_CLEAR_PWFIELD password
#you can optionally enable this next setting if you want
#a particular domain to be appended when users haven't
#specified a domain during authentication
#DEFAULT_DOMAIN yourdomain.com
MYSQL_UID_FIELD '5001'
MYSQL_GID_FIELD '5001'
MYSQL_LOGIN_FIELD username
MYSQL_HOME_FIELD '/usr/local/vmail'
MYSQL_NAME_FIELD name
MYSQL_MAILDIR_FIELD CONCAT("/usr/local/vmail/",maildir)
MYSQL_QUOTA_FIELD concat(quota,'S')
Maildrop
cd /usr/ports/mail/maildrop
make install WITH_AUTHLIB=yes
* Mysql
Vacation
This is a tool to set vacation messages.
cd /usr/ports/databases/p5-DBI
make install
cd /usr/ports/databases/p5-DBD-mysql
make
make install
pw groupadd vacation -g 5002
pw useradd vacation -u 5002 -g 5002 -s/sbin/nologin -d/dev/null
mkdir /var/spool/postfix/vacation
cp /usr/local/www/postfixadmin/VIRTUAL_VACATION/vacation.pl /var/spool/postfix/vacation/
chown -R vacation:vacation /var/spool/postfix/vacation/
chmod 700 /var/spool/postfix/vacation/*
#
# VIRTUAL VACATION
#
vacation unix - n n - - pipe
flags=DRhu user=vacation:vacation argv=/var/spool/postfix/vacation/vacation.pl -f ${sender} -- ${recipient}
ee /usr/local/etc/postfix/transport
autoreply.yourdomain.com vacation
postmap /usr/local/etc/postfix/transport
ee /usr/local/www/postfixadmin/config.inc.php
$CONF['vacation'] = 'YES';
$CONF['vacation_domain'] = 'autoreply.yourdomain.com';
MailDrop - PostfixAdmin maildir creations files
ee /usr/local/sbin/maildirmake.sh
#!/usr/local/bin/bash
set -e
mail_home="/usr/local/vmail"
if [ ! -d $mail_home/$1 ] ; then
mkdir $mail_home/$1
chown -R vmail:vmail $mail_home/$1
chmod -R 700 $mail_home/$1
#echo "$mail_home/$1 CREATED"
fi
if [ -d $mail_home/$1 ] ; then
cd "$mail_home/$1"
/usr/local/bin/maildirmake $2
#echo "$mail_home/$1/$2 CREATED"
/usr/local/bin/maildirmake -q "$3S" $2
#echo "$3S $2 QUOTA CREATED"
chown -R vmail:vmail $mail_home/$1/$2
chmod -R 700 $mail_home/$1/$2
fi
ee /usr/local/sbin/maildirdel.sh
#!/usr/local/bin/bash
set -e
mail_home="/usr/local/vmail"
if [ -d $mail_home/$1/$2 ] ; then
rm -Rf mkdir $mail_home/$1/$2
#echo "$mail_home/$1/$2 DELETED"
fi
chmod +x maildirdel.sh
chmod +x maildirmake.sh
ee /usr/local/www/postfixadmin/create-mailbox.php
system("/usr/local/bin/sudo /usr/local/sbin/maildirmake.sh ".$fDomain." ".$_POST['fUsername']. " ". $quota);
db_log ($SESSID_USERNAME, $fDomain, "create mailbox", "$fUsername");
ee /usr/local/www/postfixadmin/admin/create-mailbox.php
system("/usr/local/bin/sudo /usr/local/sbin/maildirmake.sh ".$fDomain." ".$_POST['fUsername']. " ". $quota);
db_log ($SESSID_USERNAME, $fDomain, "create mailbox", "$fUsername");
ee /usr/local/www/postfixadmin/admin/delete.php
system("/usr/local/bin/sudo /usr/local/sbin/maildirdel.sh ".$domain." ".$user);
db_log ($CONF['admin_email'], $fDomain, "delete mailbox", $fDelete);
ee /usr/local/www/postfixadmin/delete.php
system("/usr/local/bin/sudo /usr/local/sbin/maildirdel.sh ".$domain." ".$user);
db_log ($CONF['admin_email'], $fDomain, "delete mailbox", $fDelete);
Sudo
cd /usr/ports/security/sudo
make install
ee /usr/local/etc/sudoers
www ALL = NOPASSWD: /usr/local/sbin/maildirmake.sh
www ALL = NOPASSWD: /usr/local/sbin/maildirdel.sh
Mailscanner
cd /usr/ports/mail/mailscanner
make initial-config
make install
echo 'mailscanner_enable="YES"' >> /etc/rc.conf
mkdir /var/spool/MailScanner/incoming
mkdir /var/spool/MailScanner/quarantine
mkdir /var/spool/MailScanner/spamassassin
chown postfix:postfix /var/spool/MailScanner/spamassassin
chown postfix:postfix /var/spool/MailScanner/incoming
chown postfix:postfix /var/spool/MailScanner/quarantine
cd /usr/local/etc/MailScanner/
cp MailScanner.conf.sample MailScanner.conf
ee MailScanner.conf
Run As User = postfix
Run As Group = postfix
Incoming Queue Dir = /var/spool/postfix/hold
Outgoing Queue Dir = /var/spool/postfix/incoming
MTA = postfix
Sign Clean Messages = no
# Enable Spam Bounce = %rules-dir%/bounce.rules
Log Spam = yes
SpamAssassin User State Dir = /var/spool/MailScanner/spamassassin
#Maximum Message Size = %rules-dir%/max.message.size.rules
cd /usr/local/etc/MailScanner/mcp
cp mcp.spam.assassin.prefs.conf.sample mcp.spam.assassin.prefs.conf
cd /usr/local/www
svn checkout https://svn.roundcube.net/trunk
mv trunk/roundcubemail .
rm -rf trunk
cd roundcubemail
chown -R www:www temp logs
# mysql
> create database 'roundcubemail';
> GRANT ALL PRIVILEGES ON roundcubemail.* TO roundcube@localhost
IDENTIFIED BY '$PASSWORD';
> quit
cd config
cp db.inc.php.dist db.inc.php
cp main.inc.php.dist main.inc.php
Alias /mail "/usr/local/www/roundcubemail"
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from All
1) As root, change to the webroot of Apache
cd /usr/local/www/data-dist
2) Login to the Sourceforge Roundcubemail CVS server (when prompted for a password, just press ENTER)
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/roundcubemail login
2) Checkout Roundcubemail from the Sourceforge SVN server (when prompted, choose ‘p’ to accept the encrypted key permanantly)
svn checkout https://svn.roundcube.net/trunk
3) Change into the roundcubemail directory
cd roundcubemail
3) Move the roundcubemail directory to your webroot, remove the ‘trunk’ directory, and then change into the roundcubemail directory
mv trunk/roundcubemail .
rm -rf trunk
cd roundcubemail
4) Set permissions of the temp and logs dir so that the web user can read/write to them
chown -R www:www temp logs
5) Create a database for storage of Roundcubemail data, replace $PASSWORD with the password you want the roundcube user to use to access mySQL
# mysql
> create database 'roundcubemail';
> GRANT ALL PRIVILEGES ON roundcubemail.* TO roundcube@localhost
IDENTIFIED BY '$PASSWORD';
> quit
6) Import the inital Roundcubemail SQL
# mysql roundcubemail < SQL/mysql.initial.sql
7) Change into the config directory
cd config
8) Copy the config *php.dist files to *.php
cp db.inc.php.dist db.inc.php
cp main.inc.php.dist main.inc.php
9) Modify the config files to suit your environment. In db.inc.php you only need to change the database definition line, add your password in place of $PASSWORD
$rcmail_config['db_dsnw'] = 'mysql://roundcube:PASSWORD@localhost/roundcubemail';
Assuming your mailserver is running on the same physical box as the webserver, disable database caching
$rcmail_config['enable_caching'] = FALSE;
define the host as localhost
$rcmail_config['default_host'] = 'localhost';
define smtp as localhost
$rcmail_config['smtp_server'] = 'localhost';
and increase the session lifetime from 5 to something more reasonable (optional)
$rcmail_config['session_lifetime'] = 30;
Launch a web browser and point it to
http://some.url/roundcubemail
Then login with a valid/existing IMAP username and password.
To debug problems just tail -f (or multitail if you’re cool like me) /var/log/maillog to see what’s happening behind the scenes. Consult the mailing lists for issues and feel free to give feedback below. Since this app is under heavy development I expect this HOWTO to change as the app does.
Debugging
Courier authtest
/usr/local/sbin/authtest someuser@yourdomain.com somepassword
ee /usr/local/etc/authlib/authdaemonrc
DEBUG_LOGIN=1 # turn on authentication debugging
DEBUG_LOGIN=2 # turn on authentication debugging AND show passwords
Debug Maildrop
maildrop -V9 -d someone@yourdomain.com
maildrop: authlib: groupid=1001
maildrop: authlib: userid=1001
maildrop: authlib: logname=someone@yourdomain.com, home=/var/vmail, mail=yourdomain.com/s/someone/Maildir/
maildrop: Changing to /opt/mail
make install
Cacti is now installed. If you intall it for the first time,
you may have to follow this steps to make it work correctly:
1. Create the MySQL database:
# mysqladmin --user=root create cacti
2. Create a mysql user/password for cacti:
(change user and/or password if requered)
# echo "GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'cactiuser'; FLUSH PRIVILEGES;" | mysql
3. Import the default cacti database:
# mysql cacti < /usr/local/share/cacti/cacti.sql
4. Edit /usr/local/share/cacti/include/db-settings.php.
5. Add a line to your /etc/crontab file similar to:
*/5 * * * * cacti /usr/local/bin/php /usr/local/share/cacti/poller.php > /dev/null 2>&1
6. Add alias in apache config for the cacti dir:
Alias /cacti "/usr/local/share/cacti/"
7. Be sure apache gives an access to the directory ('Allow from' keywords).
8. Open a cacti login page in your web browser and login with admin/admin.
If you update cacti, open a login page, an updating process
will start automatically.
If you are using PLUGIN option set, in file
/usr/local/share/cacti/include/config.php
change the follow line
$config["url_path"] = '/';
with location where your cacti is available. E.g.:
$config["url_path"] = '/cacti/';
if your URL is http://yoursite.com/cacti
cd /usr/ports/www/apache22
make install
echo 'apache22_enable="YES"' >> /etc/rc.conf
PHP4
cd /usr/ports/lang/php4
make install
* CLI
* CGI
* Apache module
* Suhosin (?)
* IPV6 (?)
* FastCGI
* Pathinfo
* OpenSSL
* Zlib
Add the typehandler to apache config.
ee /usr/local/etc/apache22/httpd.conf
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
DirectoryIndex index.html index.php
Mysql 5.0
cd /usr/ports/databases/mysql50-server
make install
echo 'mysql_enable="YES"' >> /etc/rc.conf
mysqladmin -u root password
phpMyAdmin
cd /usr/ports/databases/phpmyadmin
make install
* All except MysqlI (only php5)
Configuration of phpmyadmin:
cd /usr/local/www/phpMyAdmin
cp libraries/config.default.php config.inc.php
ee config.inc.php
$cfg['Servers'][$i]['auth_type'] = 'http';
$cfg['Servers'][$i]['user'] = '';
Add phpmyadmin to the apache config.
ee /usr/local/etc/apache22/httpd.conf
Insert:
Alias /phpmyadmin/ "/usr/local/www/phpMyAdmin/"
Options none
AllowOverride Limit
Order Allow,Deny
Allow from all
Subversion
whereis subversion
cd
make install WITHOUT_BDB=yes
Proftpd
cd /usr/ports/ftp/proftpd
make install
echo 'proftpd_enable="YES"' >> /etc/rc.conf
Additions to the config file.
ee /usr/local/etc/proftpd.conf
AllowRetrieveRestart on
AllowStoreRestart on
Mail server
Postfix
First I install the postfix
cd /usr/ports/mail/postfix
make install
* SASL 2
* TLS
* MySQL
If you not need sendmail anymore, please add in your rc.conf:
sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
And you can disable some sendmail specific daily maintenance routines in your
/etc/periodic.conf file:
daily_clean_hoststat_enable="NO"
daily_status_mail_rejects_enable="NO"
daily_status_include_submit_mailq="NO"
daily_submit_queuerun="NO"
Add the user to the virtual dirs
pw groupadd vmail -g 5001
pw useradd vmail -u 5001 -g 5001 -s/sbin/nologin -d/dev/null
mkdir /usr/local/vmail
chown -R vmail:vmail /usr/local/vmail
chmod -R ug+rwx,o-rwx /usr/local/vmail
The database table layout files
ee /usr/local/etc/postfix/mysql_virtual_alias_maps.cf
user = postfix
password = postfix
hosts = localhost
dbname = postfix
query = SELECT goto FROM alias WHERE address='%s' AND active = 1
ee /usr/local/etc/postfix/mysql_virtual_domains_maps.cf
user = postfix
password = postfix
hosts = localhost
dbname = postfix
query = SELECT domain FROM domain WHERE domain='%s'
#optional query to use when relaying for backup MX
#query = SELECT domain FROM domain WHERE domain='%s' and backupmx = '0' and active = '1'
ee /usr/local/etc/postfix/mysql_virtual_mailbox_maps.cf
user = postfix
password = postfix
hosts = localhost
dbname = postfix
query = SELECT maildir FROM mailbox WHERE username='%s' AND active = 1
ee /usr/local/etc/postfix/mysql_virtual_mailbox_limit_maps.cf
user = postfix
password = postfix
hosts = localhost
dbname = postfix
query = SELECT quota FROM mailbox WHERE username='%s'
ee /usr/local/etc/postfix/mysql_relay_domains_maps.cf
user = postfix
password = postfix
hosts = localhost
dbname = postfix
query = SELECT domain FROM domain WHERE domain='%s' and backupmx = '1'
chown root:postfix /usr/local/etc/postfix/mysql_*.cf
chmod 640 /usr/local/etc/postfix/mysql_*.cf
Edit the postfix main.cf config file
ee /usr/local/etc/postfix/main.cf
myhostname = teststar.nickit.dk
mydomain = nickit.dk
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost
local_recipient_maps = proxy:unix:passwd.byname $alias_maps
mynetworks = $config_directory/mynetworks
relay_domains = mysql:/usr/local/etc/postfix/mysql_relay_domains_maps.cf
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
header_checks = regexp:/usr/local/etc/postfix/header_checks
# Next, add all these to the bottom of the file :
#
# Virtual Mail Mysql settings
#
virtual_alias_maps = mysql:/usr/local/etc/postfix/mysql_virtual_alias_maps.cf
virtual_uid_maps = static:5001
virtual_gid_maps = static:5001
virtual_mailbox_base = /usr/local/vmail
virtual_mailbox_domains = mysql:/usr/local/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_limit = 51200000
virtual_mailbox_maps = mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 5001
# Who handles the mail delivery?
# POSTFIX = virtual
# MAILDROP = maildrop
#
#virtual_transport = virtual
virtual_transport = maildrop
maildrop_destination_recipient_limit = 1
# Transport map
transport_maps = hash:/usr/local/etc/postfix/transport
vacation_destination_recipient_limit = 1
# Additional for quota support
virtual_create_maildirsize = yes
virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = Sorry, the user's maildir has overdrawn his diskspace quota, please try again later.
###################################################################################
### ENABLE SASL SUPPORT ( SMTP-AUTH )
# smtpd_sasl_auth_enable = yes
# Enable SASL support in postfix
# smtpd_sasl_security_options = noanonymous
# Anonymous logins will not be permitted
# broken_sasl_auth_clients = yes
# Allow RFC-broken mail clients like Outlook Express4 to use SMTP AUTH
# smtpd_sasl_path = smptd
# Tells SASL to get the config from /usr/lib64/sasl2/smptd.conf
# smtpd_sasl_local_domain =
# If the user fails to nominate a domain, don't auto append one
# smtpd_sasl_authenticated_header = yes
# Include the authenticated username in the message headers.
# Having this on will make it easier if a spammer cracks one of your user's weak passwords,
# and starts using SMTP-AUTH to relay spam through your server
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_path = smtpd
smtpd_sasl_local_domain =
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_non_fqdn_hostname,reject_non_fqdn_sender,reject_non_fqdn_recipient,reject_unauth_destination,reject_unauth_pipelining,reject_invalid_hostname,reject_rbl_client opm.blitzed.org,reject_rbl_client list.dsbl.org,reject_rbl_client bl.spamcop.net,reject_rbl_client sbl-xbl.spamhaus.org
##################################################################################
### ENABLE TLS SUPPORT ( "STARTTLS" ... enables SSL to be negotiated during a SMTP connection )
# smtp_use_tls = no
# dont enable TLS for outbound SMTP connections
# smtpd_use_tls = yes
# announce TLS availability for incoming SMTP connections
# smtpd_tls_auth_only = no :
# TLS is optional, not enforced
# smtpd_tls_key_file :
# specify the private key ( must not be encrypted - ie no password)
# smtpd_tls_cert_file :
# specify the certificate
# smtpd_tls_session_cache_database :
# nominate a server-side TLS session cache. Improves performance.
# smtpd_tls_loglevel = 1 :
# log basic TLS handshake and cert info
# smtpd_tls_received_header = yes
# record some protocol/cipher etc info in the Received header smtp_use_tls = no
smtp_use_tls = no
smtpd_use_tls = yes
smtpd_tls_auth_only = no
smtpd_tls_key_file = /usr/local/ssl/mail.yourdomain.com.key
smtpd_tls_cert_file = /usr/local/ssl/mail.yourdomain.com.crt
smtpd_tls_session_cache_database = btree:/usr/local/etc/postfix/tls_smtpd_scache
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
Populate the mynetworks file
echo '# Localhost' > /usr/local/etc/postfix/mynetworks
echo '127.0.0.0/8' >>/usr/local/etc/postfix/mynetworks
echo '' >>/usr/local/etc/postfix/mynetworks
Addition to the sasl config
ee /usr/local/lib/sasl2/smtpd.conf
pwcheck_method: authdaemond
log_level: 3
mech_list: PLAIN LOGIN
authdaemond_path:/var/run/authdaemond/socket
chown root:vmail /usr/local/lib/sasl2/smtpd.conf
chmod 640 /usr/local/lib/sasl2/smtpd.conf
ee /usr/local/etc/postfix/master.cf
smtp inet n - n - - smtpd
567 inet n - n - - smtpd
smtps inet n - n - - smtpd
-o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes
Aliases
ee /etc/aliases
root: someone@yourdomain.com
newaliases
PostfixAdmin
cd /usr/ports/mail/postfixadmin
make install
* MySQL
Configuration of the apache
ee /usr/local/etc/apache22/httpd.conf
Alias /mailadmin/ "/usr/local/www/postfixadmin/"
#AllowOverride AuthConfig
Options Indexes
AllowOverride ALL
Order allow,deny
Allow from all
Configuration of the database tables
cd /usr/local/www/postfixadmin
mysql -u root [-p] < DATABASE_MYSQL.TXT
cd /usr/local/www/postfixadmin
chmod 640 *.php *.css
cd /usr/local/www/postfixadmin/admin/
chmod 640 *.php .ht*
cd /usr/local/www/postfixadmin/images/
chmod 640 *.gif *.png
cd /usr/local/www/postfixadmin/languages/
chmod 640 *.lang
cd /usr/local/www/postfixadmin/templates/
chmod 640 *.tpl
cd /usr/local/www/postfixadmin/users/
chmod 640 *.php
ee /usr/local/www/postfixadmin/config.inc.php
// Mailboxes
// If you want to store the mailboxes per domain set this to 'YES'.
// Example: /usr/local/virtual/domain.tld/username@domain.tld
$CONF['domain_path'] = 'YES';
// If you don't want to have the domain in your mailbox set this to 'NO'.
// Example: /usr/local/virtual/domain.tld/username
$CONF['domain_in_mailbox'] = 'NO';
Courier - Imap
cd /usr/ports/mail/courier-imap
make install
* Mysql
echo 'courier_authdaemond_enable="YES"' >> /etc/rc.conf
echo 'courier_imap_imapd_enable="YES"' >> /etc/rc.conf
echo 'courier_imap_pop3d_enable="YES"' >> /etc/rc.conf
echo 'courier_imap_pop3d_ssl_enable="YES"' >> /etc/rc.conf
echo 'courier_imap_imapd_ssl_enable="YES"' >> /etc/rc.conf
chmod 755 /var/run/authdaemond/
Configuration
ee /usr/local/etc/authlib/authdaemonrc
authmodulelist="authmysql
ee /usr/local/etc/authlib/authmysqlrc
MYSQL_SERVER localhost
MYSQL_USERNAME postfix
MYSQL_PASSWORD postfix
MYSQL_SOCKET /tmp/mysql.sock
MYSQL_PORT 0
MYSQL_OPT 0
MYSQL_DATABASE postfix
MYSQL_USER_TABLE mailbox
MYSQL_CRYPT_PWFIELD password
MYSQL_CLEAR_PWFIELD password
#you can optionally enable this next setting if you want
#a particular domain to be appended when users haven't
#specified a domain during authentication
#DEFAULT_DOMAIN yourdomain.com
MYSQL_UID_FIELD '5001'
MYSQL_GID_FIELD '5001'
MYSQL_LOGIN_FIELD username
MYSQL_HOME_FIELD '/usr/local/vmail'
MYSQL_NAME_FIELD name
MYSQL_MAILDIR_FIELD CONCAT("/usr/local/vmail/",maildir)
MYSQL_QUOTA_FIELD concat(quota,'S')
Maildrop
cd /usr/ports/mail/maildrop
make install WITH_AUTHLIB=yes
* Mysql
Vacation
This is a tool to set vacation messages.
cd /usr/ports/databases/p5-DBI
make install
cd /usr/ports/databases/p5-DBD-mysql
make
make install
pw groupadd vacation -g 5002
pw useradd vacation -u 5002 -g 5002 -s/sbin/nologin -d/dev/null
mkdir /var/spool/postfix/vacation
cp /usr/local/www/postfixadmin/VIRTUAL_VACATION/vacation.pl /var/spool/postfix/vacation/
chown -R vacation:vacation /var/spool/postfix/vacation/
chmod 700 /var/spool/postfix/vacation/*
#
# VIRTUAL VACATION
#
vacation unix - n n - - pipe
flags=DRhu user=vacation:vacation argv=/var/spool/postfix/vacation/vacation.pl -f ${sender} -- ${recipient}
ee /usr/local/etc/postfix/transport
autoreply.yourdomain.com vacation
postmap /usr/local/etc/postfix/transport
ee /usr/local/www/postfixadmin/config.inc.php
$CONF['vacation'] = 'YES';
$CONF['vacation_domain'] = 'autoreply.yourdomain.com';
MailDrop - PostfixAdmin maildir creations files
ee /usr/local/sbin/maildirmake.sh
#!/usr/local/bin/bash
set -e
mail_home="/usr/local/vmail"
if [ ! -d $mail_home/$1 ] ; then
mkdir $mail_home/$1
chown -R vmail:vmail $mail_home/$1
chmod -R 700 $mail_home/$1
#echo "$mail_home/$1 CREATED"
fi
if [ -d $mail_home/$1 ] ; then
cd "$mail_home/$1"
/usr/local/bin/maildirmake $2
#echo "$mail_home/$1/$2 CREATED"
/usr/local/bin/maildirmake -q "$3S" $2
#echo "$3S $2 QUOTA CREATED"
chown -R vmail:vmail $mail_home/$1/$2
chmod -R 700 $mail_home/$1/$2
fi
ee /usr/local/sbin/maildirdel.sh
#!/usr/local/bin/bash
set -e
mail_home="/usr/local/vmail"
if [ -d $mail_home/$1/$2 ] ; then
rm -Rf mkdir $mail_home/$1/$2
#echo "$mail_home/$1/$2 DELETED"
fi
chmod +x maildirdel.sh
chmod +x maildirmake.sh
ee /usr/local/www/postfixadmin/create-mailbox.php
system("/usr/local/bin/sudo /usr/local/sbin/maildirmake.sh ".$fDomain." ".$_POST['fUsername']. " ". $quota);
db_log ($SESSID_USERNAME, $fDomain, "create mailbox", "$fUsername");
ee /usr/local/www/postfixadmin/admin/create-mailbox.php
system("/usr/local/bin/sudo /usr/local/sbin/maildirmake.sh ".$fDomain." ".$_POST['fUsername']. " ". $quota);
db_log ($SESSID_USERNAME, $fDomain, "create mailbox", "$fUsername");
ee /usr/local/www/postfixadmin/admin/delete.php
system("/usr/local/bin/sudo /usr/local/sbin/maildirdel.sh ".$domain." ".$user);
db_log ($CONF['admin_email'], $fDomain, "delete mailbox", $fDelete);
ee /usr/local/www/postfixadmin/delete.php
system("/usr/local/bin/sudo /usr/local/sbin/maildirdel.sh ".$domain." ".$user);
db_log ($CONF['admin_email'], $fDomain, "delete mailbox", $fDelete);
Sudo
cd /usr/ports/security/sudo
make install
ee /usr/local/etc/sudoers
www ALL = NOPASSWD: /usr/local/sbin/maildirmake.sh
www ALL = NOPASSWD: /usr/local/sbin/maildirdel.sh
Mailscanner
cd /usr/ports/mail/mailscanner
make initial-config
make install
echo 'mailscanner_enable="YES"' >> /etc/rc.conf
mkdir /var/spool/MailScanner/incoming
mkdir /var/spool/MailScanner/quarantine
mkdir /var/spool/MailScanner/spamassassin
chown postfix:postfix /var/spool/MailScanner/spamassassin
chown postfix:postfix /var/spool/MailScanner/incoming
chown postfix:postfix /var/spool/MailScanner/quarantine
cd /usr/local/etc/MailScanner/
cp MailScanner.conf.sample MailScanner.conf
ee MailScanner.conf
Run As User = postfix
Run As Group = postfix
Incoming Queue Dir = /var/spool/postfix/hold
Outgoing Queue Dir = /var/spool/postfix/incoming
MTA = postfix
Sign Clean Messages = no
# Enable Spam Bounce = %rules-dir%/bounce.rules
Log Spam = yes
SpamAssassin User State Dir = /var/spool/MailScanner/spamassassin
#Maximum Message Size = %rules-dir%/max.message.size.rules
cd /usr/local/etc/MailScanner/mcp
cp mcp.spam.assassin.prefs.conf.sample mcp.spam.assassin.prefs.conf
cd /usr/local/www
svn checkout https://svn.roundcube.net/trunk
mv trunk/roundcubemail .
rm -rf trunk
cd roundcubemail
chown -R www:www temp logs
# mysql
> create database 'roundcubemail';
> GRANT ALL PRIVILEGES ON roundcubemail.* TO roundcube@localhost
IDENTIFIED BY '$PASSWORD';
> quit
cd config
cp db.inc.php.dist db.inc.php
cp main.inc.php.dist main.inc.php
Alias /mail "/usr/local/www/roundcubemail"
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from All
1) As root, change to the webroot of Apache
cd /usr/local/www/data-dist
2) Login to the Sourceforge Roundcubemail CVS server (when prompted for a password, just press ENTER)
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/roundcubemail login
2) Checkout Roundcubemail from the Sourceforge SVN server (when prompted, choose ‘p’ to accept the encrypted key permanantly)
svn checkout https://svn.roundcube.net/trunk
3) Change into the roundcubemail directory
cd roundcubemail
3) Move the roundcubemail directory to your webroot, remove the ‘trunk’ directory, and then change into the roundcubemail directory
mv trunk/roundcubemail .
rm -rf trunk
cd roundcubemail
4) Set permissions of the temp and logs dir so that the web user can read/write to them
chown -R www:www temp logs
5) Create a database for storage of Roundcubemail data, replace $PASSWORD with the password you want the roundcube user to use to access mySQL
# mysql
> create database 'roundcubemail';
> GRANT ALL PRIVILEGES ON roundcubemail.* TO roundcube@localhost
IDENTIFIED BY '$PASSWORD';
> quit
6) Import the inital Roundcubemail SQL
# mysql roundcubemail < SQL/mysql.initial.sql
7) Change into the config directory
cd config
8) Copy the config *php.dist files to *.php
cp db.inc.php.dist db.inc.php
cp main.inc.php.dist main.inc.php
9) Modify the config files to suit your environment. In db.inc.php you only need to change the database definition line, add your password in place of $PASSWORD
$rcmail_config['db_dsnw'] = 'mysql://roundcube:PASSWORD@localhost/roundcubemail';
Assuming your mailserver is running on the same physical box as the webserver, disable database caching
$rcmail_config['enable_caching'] = FALSE;
define the host as localhost
$rcmail_config['default_host'] = 'localhost';
define smtp as localhost
$rcmail_config['smtp_server'] = 'localhost';
and increase the session lifetime from 5 to something more reasonable (optional)
$rcmail_config['session_lifetime'] = 30;
Launch a web browser and point it to
http://some.url/roundcubemail
Then login with a valid/existing IMAP username and password.
To debug problems just tail -f (or multitail if you’re cool like me) /var/log/maillog to see what’s happening behind the scenes. Consult the mailing lists for issues and feel free to give feedback below. Since this app is under heavy development I expect this HOWTO to change as the app does.
Debugging
Courier authtest
/usr/local/sbin/authtest someuser@yourdomain.com somepassword
ee /usr/local/etc/authlib/authdaemonrc
DEBUG_LOGIN=1 # turn on authentication debugging
DEBUG_LOGIN=2 # turn on authentication debugging AND show passwords
Debug Maildrop
maildrop -V9 -d someone@yourdomain.com
maildrop: authlib: groupid=1001
maildrop: authlib: userid=1001
maildrop: authlib: logname=someone@yourdomain.com, home=/var/vmail, mail=yourdomain.com/s/someone/Maildir/
maildrop: Changing to /opt/mail
make install
Cacti is now installed. If you intall it for the first time,
you may have to follow this steps to make it work correctly:
1. Create the MySQL database:
# mysqladmin --user=root create cacti
2. Create a mysql user/password for cacti:
(change user and/or password if requered)
# echo "GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'cactiuser'; FLUSH PRIVILEGES;" | mysql
3. Import the default cacti database:
# mysql cacti < /usr/local/share/cacti/cacti.sql
4. Edit /usr/local/share/cacti/include/db-settings.php.
5. Add a line to your /etc/crontab file similar to:
*/5 * * * * cacti /usr/local/bin/php /usr/local/share/cacti/poller.php > /dev/null 2>&1
6. Add alias in apache config for the cacti dir:
Alias /cacti "/usr/local/share/cacti/"
7. Be sure apache gives an access to the directory ('Allow from' keywords).
8. Open a cacti login page in your web browser and login with admin/admin.
If you update cacti, open a login page, an updating process
will start automatically.
If you are using PLUGIN option set, in file
/usr/local/share/cacti/include/config.php
change the follow line
$config["url_path"] = '/';
with location where your cacti is available. E.g.:
$config["url_path"] = '/cacti/';
if your URL is http://yoursite.com/cacti
Subscribe to:
Posts (Atom)