BumQ

วันเสาร์ที่ 7 เมษายน พ.ศ. 2555

ติดตั้ง SMF ใน SMEServer

Description

Simple Machines Forum — SMF in short — is a free, professional grade software package that allows you to set up your own online community within minutes.
Its powerful custom made template engine puts you in full control of the lay-out of your message board and with our unique SSI - or Server Side Includes - function you can let your forum and your website interact with each other.
SMF is written in the popular language PHP and uses a MySQL database. It is designed to provide you with all the features you need from a bulletin board while having an absolute minimal impact on the resources of the server. SMF is the next generation of forum software - and best of all it is and will always remain completely free!
For more information see http://www.simplemachines.org/.

Installation and Uninstall

For installation just hit the following command
yum install smeserver-smf --enablerepo=smecontribs
For uninstall just hit the following command
yum remove smeserver-smf
You can ignore the yum-comments signal event post-upgrade and signal-event reboot.

Languages support

There are 6 languages supported by default: English, French, German, Italian, Spanish and Swedish.
The install will set the default language according to your SME language settings (English if not autodetected)
You can download other languages here. Please choose UTF-8 langpacks.
Untar the downloaded langpack in /opt/SMF/ (this should update the 'Themes' folder)
Then you need to set the rights of the files you added for security reasons. Copy/paste the following at the prompt:
cd /opt/SMF
find Themes -type d -exec chmod 555 {} \;
find Themes -type f -exec chmod 444 {} \;
chown -R root:root /opt/SMF/Themes/
chown root:www /opt/SMF/Themes/
chmod 775 /opt/SMF/Themes/

Use

To use SMF, start your favorite browser at http://yourdomain.com/forum.
The administration panel will be available once you're connected as an admin.


Warning.png Warning:
For security-reasons, change the admin password as soon as possible! User: admin
Pass: admin



Changing the Forum Base URL

If your server is only reachable with the FQHN like sme.mydomain.com, the theme style sheets are not loaded and you will not be able to login. You must change the forum base URL as follows:
Edit /opt/SMF/Settings.php and set
$boardurl = 'http://sme.mydomain.com/forum';
The log into SMF as admin and browse to
"Configuration"->"Themes and Layout"->"Themes and Settings Tab"
Set "Forum URL" to "http://sme.mydomain.com/forum" and save.

Backup

Include the file '/opt/SMF/Settings.php' and the folder '/opt/SMF/attachments.php' into your backup. The MySQL Database is already included in SME standard backup. If you have created new themes you should them include into backup, too. The themes are stored in '/opt/SMF/Themes/'.

การเปิดใช้ Recycle Bin สำหรับการแชร์ไฟล์

Enable Recycle Bin for ibays

db accounts setprop ibayname RecycleBin enabled
db accounts setprop ibayname KeepVersions enabled 
signal-event ibay-modify ibayname
The first property enables the Recycle Bin feature. The second property KeepVersions ensures that when a file is deleted with the same name as one that was previously deleted the latest deleted file will be called “Copy #x of filename”.

Enable Recycle Bin for users

db configuration setprop smb RecycleBin enabled
db configuration setprop smb KeepVersions enabled 

Expand the template...
/sbin/e-smith/expand-template /etc/samba/smb.conf Remember to restart service...
/etc/rc7.d/S91smb restart
 
The Recycle Bin folder will be created automatically the first time a file is deleted, so you will not see the folder until you delete something.
An admin can then go and retrieve the files on the server.
 

How to use SSH to remotely access Server-Manager

On SME v5.5 SSH X11 forwarding is enabled by default but on 5.6 you have to modify the SSH configuration.
[root@e-smith ]# mkdir -p /etc/e-smith/templates-custom/etc/ssh/sshd_config
[root@e-smith ]# echo "X11Forwarding yes" > /etc/e-smith/templates-custom/etc/ssh/sshd_config/X11Forwarding
[root@e-smith ]# /sbin/e-smith/expand-template /etc/ssh/sshd_config


Now restart the SSH deamon
[root@e-smith ]# service sshd restart
Download and install TTSH Telnet / SSH client
Read this section: How to Obtain and Install TTSSH
Make a shortcut to c:\program files\TTTERMPRO\ttssh.exe on your desktop.

Open TTSH | Setup | SSH Forwarding and configure like so:

Set Terminal Window Size: Setup | Terminal | check Term size=win size
Make sure you save it by doing Setup | Save Setup

File | New Connection and put in your remote IP to connection.


When prompted login as either admin or root and supply password (same for both)
admin gets your the console and can admin it via lynx text browser, etc.
root gets your the shell ...check diskspace df -h, change config files, etc.

Open up your broswer and type http://localhost:8000 (you need the http:// part)
It'll prompt you for authentication. Again login either as admin or root and voila
you should now be able to use web browser to admin your e-smith server remotely.

How to setup a backup mail server

This Howto describes how you can setup a backup mail server that can spool your email when/if your server is down.

Configuration related to main mail server

First you need to change your DNS configuration for the main mail server. Please be aware that this is not on the SME box but on your DNS provider such as DynDNS or, GratisDNS.

Add a new MX record with a higher preference number that you main mail server with the name of your backup mail server.

MX (@host -> A record mailserver)
Host Mail Exchange Preference TTL
swerts-knudsen.com swerts-knudsen.com 10 43200
swerts-knudsen.com backup-mail-server.com 15 43200


Configuration related to backup mail server

First you need to inform allow SMTP request from the main domain to be relayed/spooled on the backup server. This is done by adding domain entries on the rcpthosts file. You need to add the portion of the mail address with comes after the "@". In my case this is "swerts-knudsen.dk" and "swerts-knudsen.com". This naturally has to done by use of templates.


[root@e-smith]# mkdir -p /etc/e-smith/templates-custom/var/qmail/control/rcpthosts
[root@e-smith]# cd /etc/e-smith/templates-custom/var/qmail/control/rcpthosts
[root@e-smith]# echo "domain_name.com" > domain_name
[root@e-smith]# /sbin/e-smith/expand-template /var/qmail/control/rcpthosts

Please be careful with this file - it controls the relay functions. If it is mis-configurred your SMTP server could be used for spamming.
Now as the last thing you need to restart qmail.
[root@e-smith]# /etc/rc.d/init.d/smtpfront-qmail restart

Then you should be done. If you want to check whether it actually works you can temporarily close down qmail and monitor the qmail log file on the backup-mail-server. 

Issue this command on the main mail server.
[root@e-smith]# /etc/rc.d/init.d/smtpfront-qmail stop

Send an email to an existing address in your domain and then check the following log file for new entries on both servers:

[root@e-smith]# tail -f /var/log/qmail/current

When you see everything is being queued on the backup-mai-server then restart qmail on the main mail server again by doing:
[root@e-smith]# /etc/rc.d/init.d/smtpfront-qmail start

How to retrieve emails from a POP3 account(s)

If you for example would like to retrieve emails from some external POP3 accounts and drop them in individual user mailboxes then fetchmail is just the solution for you.

SME 5.5


SME 5.6

SME 6.0/6.0.1
Have a look at this excellent site http://www.schirrms.net/sme/SMEFetchMail.php

SME 5.5 and 5.6 you now have a server-manager panel called "Mail Users" but first you need to configure your SME server in its "Email" panel". Set  "E-mail retrieval" to "multi-drop" and make sure to change the secondary mail server to a valid address (suggestion: type your own host name). Configure the check interval and then go to the "Mail Users" section in the server manager main menu. Choose "Individual mailbox" and configure the POP3 name, username and password.
If you do not want to use the Multi-Drop feature, but only want to fetch mail to your users from e.g. POP3 accounts, then can clear the content of the following template file created by the above installation.
[root@e-smith ]# echo -n "" > /etc/e-smith/templates-custom/etc/fetchmail/50multi-drop
[root@e-smith ]# /sbin/e-smith/expand-template /etc/fetchmail

This way you avoid having your log files filled up with POP3 errors.

How to enable HTML emails for webmail (Horde/IMP)

Edit the file /home/httpd/html/horde/imp/config/mime_drivers.php to enable inline support for the mime types you wish to have displayed inline. Simply set the 'inline' array element for that mime type to 'true' to enable a type. As noted above, not all mime types can be shown inline; if there is no 'inline' array element for a mime type than that type can not be viewed inline.
For example, to enable inline html support you would set:
$mime_drivers['imp']['html']['inline'] = true;

Monitor SpamAssassin with MRTG

If you want to monitor how many e-mails are tagged SPAM you can use MRTG (which I love). First install MRTG as mentioned in the guide. You need to place two statistics gathering "programs" in your /etc/mrtg directory. An example of SpamAssassin MRTG statistics can be seen here.

[root@e-smith]# cd /etc/mrtg
[root@e-smith]# chmod 755 spamstats.pl
[root@e-smith]# chmod 755 spam-stats


if you want to use my spamassassin MRTG config file then also download that


You now need to create the output directory where MRTG will place result data. This directory is configured in the spamassassin.cfg file and in my case /home/e-smith/files/ibays/mrtg

[root@e-smith]# mkdir /home/e-smith/files/ibays/mrtg/html/spamassassin

You should now be able to run MRTG (notice that you get warnings in the first two runs)

[root@e-smith]# mrtg spamassassin.cfg

You would properly like to have this added to your existing MRTG cron job so add a line in the all-ip file (also located in /etc/mrtg)
[root@e-smith ]# pico all-ip
Insert the following line in the bottom and press CTRL-X, Y, to save:
/usr/bin/mrtg /etc/mrtg/spamassassin.cfg;
If you want to verify that you get data from your log files you can run both programs (spam-stats and spamstats.pl) from the command line.
ex.
[root@e-smith ]# ./spam-stats
spam: 4
clean: 19
skipped: 0
total: 23
processed: 23
[root@e-smith ]# perl spamstats.pl localhost spam
4
23

Howto pass eMule/eDonkey traffic through SME

Port forwarding is different on SE 5.5, SME 5.6 and SME 6.0. On SME 5.5 you can configure masquerade whereas on SME 5.6 you need to install a port forwarding contribution. On SME 6.0 port forwarding is already in stalled and you only need to configure. Common for all is the fact that you need to open up for incoming requests on certain ports.
eDonkey and eMule uses three ports:
Protocol Port Description
TCP 4661 To connect with a server
TCP 4662 To connect with other clients
UDP 4665 To communicate with servers other than the one you are connected to.
TCP 4663 Is also used with the command line client when it is configured to allow remote connections. This is the case when using a Graphical Interface (such as the Java Interface) with the client.

SME 5.5
Use port forwarding to forward traffic from the relevant TCP/UDP ports from the SME box to a PC inside your own network.
[root@e-smith ]# ipmasqadm portfw -a -P tcp -L SME_IP  4661 -R PC_IP 4661
[root@e-smith ]# ipmasqadm portfw -a -P tcp -L SME_IP  4662 -R PC_IP 4662
[root@e-smith ]# ipmasqadm portfw -a -P tcp -L SME_IP  4663 -R PC_IP 4663
[root@e-smith ]# ipmasqadm portfw -a -P udp -L SME_IP  4665 -R PC_IP 4665
List your port forwardings to make sure that your entered the information correctly. 
[root@e-smith ]# ipmasqadm portfw -l
SME 5.6
On 5.6 you need to install port forwarding, since it is not part of the standard installation.
[root@e-smith ]# rpm -Uvh http://sme.swerts-knudsen.dk/downloads/e-smith-packetfilter-1.13.0-04.noarch.rpm
[root@e-smith ]# rpm -Uvh http://sme.swerts-knudsen.dk/downloads/e-smith-portforwarding-0.1.0-20.noarch.rpm
[root@e-smith ]# /sbin/e-smith/signal-event post-upgrade
[root@e-smith ]# /sbin/e-smith/signal-event reboot
After the reboot you can use the server-manager to configure your port forwarding (Configuration -> Port Forwarding).
For eMule you need the following (as a minimum):
Protocol Source Port Destination Host IP Address Destination Port Action
TCP 4662 192.168.x.x 4662 Remove
UDP 4662 192.168.x.x 4662 Remove
where X is the last part of the local IP address of the PC with the eMule client.
You should now have a high ID in eDonkey/eMule. Note that this setup only allow for a SINGLE eDonkey/eMule client on your network!

How to Install Hardware Sensor Support with MRTG monitoring

I have decided to include most of Ian's Howto in this for the sake of completeness.
Most modern mainboards have sensors to monitor temperature, fan speed, and other items. The sensor information can normally be seen from the BIOS. This guide shows how to install lm_sensors which can read the sensor information for you.

Warning:
Running the sensor-detect script can crash your machine, read documentation for further details.
On my machine there was no problem - but be aware of this possibility.
First you need to install the MRTG package
[root@e-smith ]# rpm -Uvh http://sme.swerts-knudsen.dk/downloads/MRTG/mrtg-2.9.17-3.i386.rpm
Then you need to install the LM Sensor package
[root@e-smith ]# rpm -Uvh http://sme.swerts-knudsen.dk/downloads/MRTG/lm_sensors-2.6.1-1.i386.rpm
Detect the sensors on your mainboard, (run as root)
[root@e-smith ]# /usr/sbin/sensors-detect
For my mainboard, I just hit enter for all questions, which then uses the defaults which can be seen as CAPs.
Note down the lines it suggests to put into /etc/modules.conf, for my mainboard it indicated
#----cut here----
# I2C module options
alias char-major-89 i2c-dev
#----cut here----
Note down the modprobe lines it suggests, for my mainboard it indicated
#----cut here----
# I2C adapter drivers
modprobe i2c-viapro
modprobe i2c-isa
# I2C chip drivers
modprobe eeprom
modprobe via686a
#----cut here----
 
Modify /etc/modules.conf via a template fragment. First make the templates-custom directory.
[root@e-smith ]# mkdir -p /etc/e-smith/templates-custom/etc/modules.conf
Create a new template for i2c, using pico or your favorite editor.
[root@e-smith ]# pico /etc/e-smith/templates-custom/etc/modules.conf/10i2c
Copy the lines from step 3 into this file, for my mainboard this file contains
{
    foreach my $line
        (
            "alias char-major-89 i2c-dev"
        )
    {
        unless (exists $lines{$line})
        {
            push @lines, $line;
        }
    }
    "";
}
Now expand the custom template.
[root@e-smith ]# /sbin/e-smith/expand-template  /etc/modules.conf
Create a Initialization file /etc/e-smith/events/local/start_lmsensors, with permissions 744 root root
This will load the required modules and initialize the sensors whenever your server boots up. The contents is naturally based on the out of the "sensors-detect" command issue above.
[root@e-smith ]# pico /etc/e-smith/events/local/start_lmsensors
Now inserts the correct text and press CTRL-X, Y, to save.
#!/bin/sh

# Boot-up initialization lm_sensors

# I2C adapter drivers
/sbin/modprobe i2c-viapro
/sbin/modprobe i2c-isa

# I2C chip drivers
/sbin/modprobe eeprom
/sbin/modprobe via686a

/usr/bin/sensors -s
Initialize the sensors.
At this point you can initialize the sensors manually, rather than rebooting.
[root@e-smith ]# chmod 744 /etc/e-smith/events/local/start_lmsensors
[root@e-smith ]# /etc/e-smith/events/local/start_lmsensors
You can now check you sensors by issuing the sensor command
[root@e-smith ]# sensors
The output from my server is:
w83782d-i2c-0-2d
Adapter: SMBus AMD7X6 adapter at 50e0
Algorithm: Non-I2C SMBus adapter
VCore 1:   +1.61 V  (min =  +1.52 V, max =  +1.68 V)              
VCore 2:   +3.34 V  (min =  +1.52 V, max =  +1.68 V)              
+3.3V:     +3.36 V  (min =  +3.13 V, max =  +3.45 V)              
+5V:       +5.11 V  (min =  +4.72 V, max =  +5.24 V)              
+12V:     +12.20 V  (min = +10.79 V, max = +13.19 V)              
-12V:     -12.13 V  (min = -10.90 V, max = -13.21 V)              
-5V:       -5.07 V  (min =  -4.76 V, max =  -5.26 V)              
V5SB:      +5.02 V  (min =  +4.72 V, max =  +5.24 V)              
VBat:      +3.28 V  (min =  +2.40 V, max =  +3.60 V)              
fan1:        0 RPM  (min = 3000 RPM, div = 2)                     
fan2:     4141 RPM  (min = 3000 RPM, div = 2)                     
fan3:        0 RPM  (min =  750 RPM, div = 8)                     
temp1:     +29.0°C  (limit =  +60°C, hysteresis =  +50°C) sensor = thermistor           
temp2:       +40°C  (limit =  +60°C, hysteresis =  +50°C) sensor = thermistor           
temp3:      +128°C  (limit =  +60°C, hysteresis =  +50°C) sensor = PII/Celeron diode           
vid:      +1.60 V
alarms:   Chassis intrusion detection                      ALARM  
beep_enable:
          Sound alarm disabled

Now its about time to see some MRTG graphs. I have created a small perl script that provided output the way MRTG wants it. This script is available here. You can test its functionality by simply issuing it from the command line.
[root@e-smith ]# cd /etc/mrtg
[root@e-smith ]# ./mrtg_sensor.pl fan2
I my case I get an output like:
4141
4141


You now need to create MRTG config files for your various LM Sensors. First make sure that the output directory exists. I presume that you have an iBay called MRTG.
[root@e-smith ]# mkdir -p /home/e-smith/files/ibays/mrtg/html/lm_sensors
[root@e-smith ]# cd /etc/mrtg
[root@e-smith ]# pico lm_sensors.cfg
Now inserts the following text  (or download from the link above) and press CTRL-X, Y, to save.
workdir: /home/e-smith/files/ibays/mrtg/html/lm_sensors

#--------------------------------------------------------------- 
# 
# MRTG Configuration file for LM Sensors
# By Jesper Knudsen
# 
Target[temp1]: `/etc/mrtg/mrtg_sensor.pl temp1`
MaxBytes[temp1]: 200 
Options[temp1]: gauge,nopercent 
Title[temp1]: System Temperature 
PageTop[temp1]: <H1> System Temperature</H1> 
WithPeak[temp1]: dwmy 
YLegend[temp1]: Temperature 
ShortLegend[temp1]: Celcius 
LegendI[temp1]: &nbsp;Temp: 
LegendO[temp1]: 


Target[temp2]: `/etc/mrtg/scripts/mrtg_sensor.pl temp2`
MaxBytes[temp2]: 200
Options[temp2]: gauge,nopercent
Title[temp2]: System Temperature                                                                               
PageTop[temp2]: <H1> System 1 Temperature</H1>                                                                  
WithPeak[temp2]: dwmy
YLegend[temp2]: Temperature
ShortLegend[temp2]: Celcius
LegendI[temp2]: &nbsp;Temp:
LegendO[temp2]: 

Target[temp3]: `/etc/mrtg/scripts/mrtg_sensor.pl temp3`
MaxBytes[temp3]: 200
Options[temp3]: gauge,nopercent
Title[temp3]: CPU Temperature                                                                               
PageTop[temp3]: <H1> CPU Temperature</H1>                                                                  
WithPeak[temp3]: dwmy
YLegend[temp3]: Temperature
ShortLegend[temp3]: Celcius
LegendI[temp3]: &nbsp;Temp:
LegendO[temp3]: 

Target[fan2]: `/etc/mrtg/scripts/mrtg_sensor.pl fan2`
MaxBytes[fan2]: 5000
Options[fan2]: gauge,nopercent
Title[fan2]: System Fan Speed
PageTop[fan2]: <H1> System Fan Speed</H1>
WithPeak[fan2]: dwmy
YLegend[fan2]: RPM
ShortLegend[fan2]: RPM
LegendI[fan2]: &nbsp;Speed:
LegendO[fan2]:

Now we just need to make sure this new MRTG config file is run every 5 minutes. Inserts a new line in the all-ip file crated by during the "How to Install MRTG system monitoring with SNMP Support" Howto.
[root@e-smith ]# pico all-ip
Insert the following line in the bottom and press CTRL-X, Y, to save:
/usr/bin/mrtg /etc/mrtg/lm_sensors.cfg;
Now wait 5 minutes and then try to look at

http://server.domain.com/mrtg/lm_sensors
An example of MRTG can be seen here

How to install YAPPA Photo Album

First install the Freetype package (check rpmfind.net for updates)
SME 5.5

SME 5.6

Then install/update the GD graphics library

Then create an ibay to hold your pictures

Information bay name: Yappa
Description: Online Photo Album
Group: everyone
User access: Write=group, Read=everyone
Public access: (As you like it)
Execution of dynamic content: enabled
Now download the Yappa package from SourceForge.Net (http://sourceforge.net/projects/yappa/) and Unzip in the HTML directory
Now edit the config.inc.php file so that the Photo_root variable is set to the path of the images.
 /* directory where album dirs are stored */
    "photo_root" => "/home/e-smith/files/ibays/yappa/html/photos",
Also make sure to set the Image_Module to use the GD package with is already installed on the SME 5.5
 /* Image module: Magick, gd */
    "image_module" => 'gd',
In order to use the latest version 1.7 you need to alter a line in the "image-gd.class.php" file or you will not have auto generated thumbnails.
Change the line as indicated below (the ImageCreateTruecolor and ImageCopyResampled are part of the GD version 2 which is not yet available and functional on SME 5.5.
function ImageUtil(&$config)
{
    // $this->_can_truecolor = (function_exists("ImageCreateTruecolor") && function_exists("ImageCopyResampled")) ? 1 : 0;
    $this->_can_truecolor = 0;
}

How to Install Gallery in an Ibay on SME

Gallery which is a project on SourceForge.net is an excellent choice for online photo galleries. First you need to create an ibay in which Gallery should be installed. This can be done by use of the server-manager. The default ibay is "gallery", but any ibay can be used.
This new updated script allows you to install Gallery in multiple ibays specified on the command line. If you do not specify anything, the script assumes the default ibay which is "gallery".
 

Information bay name gallery
Description Networked Picture Gallery
Group Admin
User access Write=group, Read=everyone
Public access As you like it
Execution of dynamic content enabled
 

Now you're ready to install Gallery itself.  Download and run the script from my web site.


Add the ibay as parameter to this command line (this example "gallery")
[root@e-smith ]# sh gallery_install.sh gallery


There are numerous places (marked with red) where you have to remember to change the ibay name according to your install ibay. 
[root@e-smith ]# chmod -R 777 /home/e-smith/files/ibays/gallery/html/albums
[root@e-smith ]# chmod -R 777 /home/e-smith/files/ibays/gallery/html/temp

Now you're just about ready to install and configure Gallery. 
 
Now point your favorite web browser to http://yourhost.yourdomain/gallery/setup. Go ahead and click the "Configure Gallery" button at the bottom of this page.
On the next page, there are a few items you'll need to enter.  First is the admin password; you may set this to anything you like.  Other things that need setting:

PNM to JPEG converter ppmtojpeg
Album directory:  /home/e-smith/files/ibays/gallery/html/albums
Albums URL: http://yourhost.yourdomain/gallery/albums
Temporary directory: /home/e-smith/files/ibays/gallery/html/temp

 
The rest of the defaults should be fine.  Click on the "Album Defaults " button to proceed to the next screen when you can either configure or press “Save Settings”. At this screen, if there are any errors, they will appear in red text.  If there's no red, scroll down to the bottom of the page and click on "Save Config".  At this point, your configuration is complete.  Return to the console (or telnet/ssh app) and do

[root@e-smith html]# sh secure.sh

You're done!  Point your browser to http://yourhost.yourdomain/gallery, log in as "admin" with the admin password you chose previously, and create some galleries.  Upload some pictures.  Enjoy!

How to install PhpSysInfo in an IBay

1) create a <new> ibay using the server-manager
2) download the latest PhpSysInfo version from http://sourceforge.net/projects/phpsysinfo/ into the newly created ibay. If you are using version 2.1 then issue the following commands:
[root@e-smith ]# cd /home/e-smith/files/ibays/<new>/html
[root@e-smith ]# wget  http://belnet.dl.sourceforge.net/sourceforge/phpsysinfo/phpSysInfo-2.1.tar.gz
[root@e-smith ]# tar -zxvf phpSysInfo-2.1.tar.gz
A new directory will be created (phpsysinfo-2.1) where an index.php is located.
3)  enable the PHP script to access the /proc directory (where all the fun is...)
[root@e-smith ]# /sbin/e-smith/db accounts setprop <new> PHPBaseDir /home/e-smith/files/ibays/<new>/:/proc:/bin
[root@e-smith ]# /sbin/e-smith/signal-event ibay-modify <new>
4) try it out... (http://your.domain.com/<new>/phpsysinfo-2.1/index.php)
An example of PhpSysInfo can be seen here

HylaFAX is a fax deamon for sending and receiving faxes from Linux. I have setup HylaFAX specifically to RECEIVE faxes and to have them delivered by email as attached Adobe PDF files. If you wants to be able to send faxes via HylaFAX you need to install a client package. With this setup faxes are emailed to one user (or pseudonym) and subsequently forwarded to the appropriate user via email. To accomplish this, you have to add a fax user called `faxmaster´ or create a pseudonym called ‘faxmaster’ to one of your existing users from within the server-manager. All administrative emails and received faxes will be mailed to ‘faxmaster’. The best modem tested so far by Chaloner Hale is the USR Couriere V.Everything 33k or 56k with latest flash. This allows one person or a group of people to receive all faxes via email, decide who they should go to, and forward them on by email to their ultimate destination. I have created a script that takes you through all the SME server specific portions. Download and run the script from my web site. [root@e-smith ]# wget http://sme.swerts-knudsen.dk/downloads/Hylafax/hf_install.sh [root@e-smith ]# sh hf_install.sh As a part of the installation script you need to configure HylaFAX. “faxsetup”, which is launched automatically is over before you know it. I accepted all defaults. Once setup ends, the script will prompt you to run “faxaddmodem” for all available devices. You can choose yes, or just type faxaddmodem at the root prompt. Modem configuration using faxaddmodem: “faxaddmodem” which is the configuration script for the modem, will ask which “Serial port that modem is connected to [ ]?”. For modems connected to COM1: use ttyS0, and for modems connected to COM2: use ttyS1. In general, if you don't know the answer to a configuration question, just use the default setting that is provided. I accepted the defaults for all but the following fields when running “faxsetup”. If you just want to be able to send faxes via HylaFAX and ensure it doesn't pick up the phone then make sure to set the "Rings to wait before answering" to 0. Serial port that modem is connected to [ ]? ttyS0 Area code [403]? Phone number of fax modem [246.0300]? Local identification string (for TSI/CIG) ["Swerts-Knudsen"]? Protection mode for received facsimile [0644]? See below * Protection mode for session logs [0644]? See below * Protection mode for ttyS0 [0666]? See below * Rings to wait before answering [2]? * Cypheus recommends these settings but the defaults also seems to work It will then present a recap of your input and ask if it is OK. Once you accept, it goes on to probe your modem. Once if finds your modem, it may or may not prompt you with a choice for modem class. My advice would be to use class 2.0 and avoid class 1. Once this program terminates, the worst is over. Test of the HylaFAX Server Be sure to have added either a pseudonym or user in server-manager for HylaFAX with the name of ‘faxmaster’. Have someone send you a fax, then check your email. If nothing comes in review the HylaFAX logs found in /var/spool/hylafax/log and files in /var/spool/hylafax/recvq. Open you reader and you should find an email from your HylaFAX server. It will/should have an Adobe PDF file attached. As long as you have the Adobe Acrobat Reader installed, you should find a very clean fax starring you in the face after clicking on the attachment. Microsoft Client Installation You can install client software on the Windows workstations if you like. There are multiple options where some are free and others are GPL Windows HylaFax Client (WHFC) is GPL You can use Cypheus for this as well RelayFax client is what many prefer but this one requires additional configuration of the SME server. See www.hylafax.org/howto/clients/RelayFax.html.

The DP-500 from KISS is a DVD player which can steam MP3 and DivX via a 10/100Mbps Ethernet Connection. The DP-500 only comes with a MS Windows application to do the configuration and act like the gateway between the DP-500 and your music and video archive. Fortunately someone has created an alternative application which can run on your SME box.

First you need to install Java which can be downloaded from SUN at (http://java.sun.com/getjava/manual.html) or the RPM directly from me. Then you create a symlink for ease of use.

[root@e-smith]# rpm -ivh j2re-1_4_2_01-linux-i586.rpm 
[root@e-smith]# ln -s /usr/java/j2re1.4.2_01/bin/java /usr/bin/java

Now we are ready to install the HellLink Java application. I have placed the un-tared archive in /home/dp-500

[root@e-smith]# cd /home
[root@e-smith]# mkdir dp-500
[root@e-smith]# cd dp-500
[root@e-smith]# unzip HellLinkv02.zip

Now in order to get HellLink to create an initial configuration file you should active HellLink. It will generate errors as no config file exists. When loaded press CTRL-C to terminate HellLnk

[root@e-smith]# java -cp /home/dp-500/HellLink/ sf.jlink.JLink -nolaf -g
Hell Link 0.2
Error: Error loading configfile HLink.conf

Time to alter the newly generated configuration file (HLink.conf) which contains information on where you have your pictures, music and films located. Add the following entries in the bottom of the file with your preferred editor (e.g. PICO). You can have multiple mounts of each type if you wish.

mount0=/AUDIO;/home/e-smith/files/ibays/music/files;-
mount1=/VIDEO;/home/e-smith/files/ibays/films/files;-
mount2=/PICTURE;/home/e-smith/files/ibays/pictures/files;-
Press CTRL-X and y (for yes) to save and exit.

Now you should be able to start HellLink without errors:

[root@e-smith]# java -cp /home/dp-500/HellLink/ sf.jlink.JLink -nolaf -g
Hell Link 0.48

(you can now test your installation and press CTRL-C when done)

Now create a "batch" file where we can place all the parameters needed to launch the HellLink Java script. Paste the following text into a batch file (ex. DP-500). The "&" ensures that the program is issued as a background task.

[root@e-smith]# pico /root/dp-500 

cd /home/dp-500/HellLink
java -cp /home/dp-500/HellLink/ sf.jlink.JLink -nolaf -g &

Press CTRL-X and y (for yes) to save and exit.
Now you just need to execute the file
[root@e-smith]# chmod 755 dp-500 

[root@e-smith]# ./dp-500

How to Install HylaFax on SME


HylaFAX is a fax deamon for sending and receiving faxes from Linux. I have setup HylaFAX specifically to RECEIVE faxes and to have them delivered by email as attached Adobe PDF files. If you wants to be able to send faxes via HylaFAX you need to install a client package. With this setup  faxes are emailed to one user (or pseudonym) and subsequently forwarded to the appropriate user via email. To accomplish this, you have to add a fax user called `faxmaster´ or create a pseudonym called  ‘faxmaster’ to one of your existing users from within the server-manager. All administrative emails and received faxes will be mailed to ‘faxmaster’. 
 
The best modem tested so far by Chaloner Hale is the USR Couriere V.Everything 33k or 56k with latest flash.

This allows one person or a group of people to receive all faxes via email, decide who they should go to, and forward them on by email to their ultimate destination.
 
I have created a script that takes you through all the SME server specific portions.  Download and run the script from my web site.

[root@e-smith ]# sh hf_install.sh

As a part of the installation script you need to configure HylaFAX. “faxsetup”, which is launched automatically is over before you know it. I accepted all defaults. Once setup ends, the script will prompt you to run “faxaddmodem” for all available devices. You can choose yes, or just type faxaddmodem at the root prompt.

Modem configuration using faxaddmodem:



“faxaddmodem” which is the configuration script for the modem, will ask which “Serial port that modem is connected to [ ]?”. For modems connected to COM1: use ttyS0, and for modems connected to COM2: use ttyS1.

In general, if you don't know the answer to a configuration question, just use the default setting that is provided. I accepted the defaults for all but the following fields when running “faxsetup”. If you just want to be able to send faxes via HylaFAX and ensure it doesn't pick up the phone then make sure to set the "Rings to wait before answering" to 0.

Serial port that modem is connected to [ ]? ttyS0
Area code [403]?
Phone number of fax modem [246.0300]?
Local identification string (for TSI/CIG) ["Swerts-Knudsen"]?
Protection mode for received facsimile [0644]? See below *
Protection mode for session logs [0644]? See below *
Protection mode for ttyS0 [0666]? See below *
Rings to wait before answering [2]?


* Cypheus recommends these settings but the defaults also seems to work

It will then present a recap of your input and ask if it is OK. Once you accept, it goes on to probe your modem. Once if finds your modem, it may or may not prompt you with a choice for modem class. My advice would be to use class 2.0 and avoid class 1. Once this program terminates, the worst is over.

Test of the HylaFAX Server

Be sure to have added either a pseudonym or user in server-manager for HylaFAX with the name of ‘faxmaster’. Have someone send you a fax, then check your email. If nothing comes in review the HylaFAX logs found in /var/spool/hylafax/log and files in /var/spool/hylafax/recvq.

Open you reader and you should find an email from your HylaFAX server. It will/should have an Adobe PDF file attached. As long as you have the Adobe Acrobat Reader installed, you should find a very clean fax starring you in the face after clicking on the attachment.

Microsoft Client Installation


You can install client software on the Windows workstations if you like. There are multiple options where some are free and others are GPL

How to install SpamFilter

The SME SpamFilter uses the new SpamAssassinV3 engine and has updated Razor2, and DCC network test modules associated. In the new Server-Manager panel  it has been made very simple to configure Real Time Block/Black Lists (RBLs), White/Black Lists (WBLs) and other Spamassassin functions. The installation script will migrate RBL if configured as per Ray Mitchell's HowTo and WBL settings if configured in the old Spamassassin server manager module. See RBL information below for details on this.

[root@e-smith]# cd /root
[root@e-smith]# sh spamfilter_install.sh


When installation is complete you should now configure and enable the Spam Filter via the Spam Filter configuration menu in the Server Manager. Please notice that the admin account is not being scanned by the Spam Filter. If you get spam on this account (properly via postmaster or another alias) then I recommend that you redirect admin email to a "real" user via server-manager->Configuration->E-mail->forwarding address.

Quite often spammer are trying to reach all kinds of non-existing account on your server from potentially also non-existing email accounts. This can result in many double bounce messages to your postmaster account. Use the "How to delete double bounce messages" to avoid this.

See FAQ below if you have any questions before mailing me.


Real Time Block/Black List (RBL) Information



Using more lists will result in more queries being sent & received over your Internet connection but should result in more spam being rejected. Some lists are included on other lists so be careful not to include "double listings" as these only result in extra unnecessary queries, potentially slowing down the list servers response times. Choose RBL lists carefully to ensure they meet your needs. Some lists are very aggressive in the implementation of their "inclusion" policy, and while using those lists may block more spam they will also block legitimate messages. You can read the "criteria for inclusion policies" on each list at the list owners web site. The web site addresses are readily discernible from the list names. See Web sites section below.
For example using the bl.spamcop.net list will result in email messages from yahoo, hotmail and earthlink accounts being rejected. If you have legitimate users sending messages from those types of accounts, then do not use the bl.spamcop.net list. This also applies to some other lists.
Inclusion on a list can happen for many reasons, including being a known spammer or having a dynamic dial up IP number or sending via open relay servers or having incorrect address information or being listed by a system admin after receiving a spate of unsolicited email. Inclusion on "conservative" lists usually requires a positive identification of spamming or similar type activity. It is possible for legitimate users to be listed as part of a "block listing" of an IP number range such as has happened with Telstra Bigpond, AOL & other "large" ISP's etc. These listings are generally temporary until the specific spam culprit is identified and has their account cancelled by the ISP.
Here is a list of what appear to be "conservative & safe" lists ie there is justifiable or provable reason for being included on these lists. This is by no means an exhaustive list but is the result of my own investigations and conclusions.
Note that all the lists except spamhaus.org include open relays, so using these lists will block email sent via open relays.

Conservative lists
  • sbl-xbl.spamhaus.org - (a combination of cbl.abuseat.org and opm.blitzed.org)
  • dsn.rfc-ignorant.org
  • postmaster.rfc-ignorant.org
  • abuse.rfc-ignorant.org
  • whois.rfc-ignorant.org
  • ipwhois.rfc-ignorant.org
  • bogusmx.rfc-ignorant.org
  • dnsbl.njabl.org
  • relays.ordb.org
  • dnsbl.sorbs.net
  • contacts.abuse.net
  • list.dsbl.org
Registration required/Commercial list
  • blackholes.mail-abuse.org
  • relays.mail-abuse.org
  • dialups.mail-abuse.org
Aggressive lists
  • dynablock.njabl.org - (was dynablock.easynet.nl)
  • bl.spamcop.net
Web sites for further information

Howto install a Dshield.org Client

ข้อมูลสรุปนี้ไม่พร้อมใช้งาน โปรด คลิกที่นี่เพื่อดูโพสต์

How to install the Antivirus Panel

The SME Server Antivirus installation based on Clam Antivirus enables automatic email virus scanning of all incoming/outgoing emails and ensures that the virus definition database is automatically kept up to date. The Panel provides an option for daily statistics as well as automatic deletion of old email stored and Quarantined (usually virus infected) and Problems. 

If you have installed by use of an older version of this script you can now run it again for upgrade (also if you are currently using the version from pagefault.org). Be aware that older versions of ClamAV (0.65) had DoS vulnerabilities and that the ClamAV database has changed dramatically from version 0.80 with new mirror functionality so an upgrade might be a very good idea.


[root@e-smith]# sh antivirus_install.sh

You can now try to send a test "virus" email by attaching one of the signatures you can find at eicar.org. This enables you to see whether the system detects this signature file and whether your admin account (postmaster@yourdomain.com) receives the virus notification email.

See FAQ below if you have any questions before mailing me.
 
 

Frequently Asked Questions (FAQ):

 
Question Answer
What do I do if I get the error message when I initially activate the panel from the server-manager
 
Can't call method "props" on an undefined value at /etc/e-smith/web/panels/manager/cgi-bin/spamfilter line 206.
For help, please send mail to the webmaster (admin), giving this error message and the time and date of the error.
Problem is that the auto generated configuration file has invalid content (a bug). Do the following from shell:
#cd /home/e-smith/
#mv spamassassin_V3 spamassassin_V3.old
#wget -N http://sme.swerts-knudsen.dk/downloads/SpamFilter/spamassassin_V3
What if I am currently using the panel from pagefault.org - can I run this install script? Yes. This script will detect the pagefault.org version and do an upgrade.
I get error message to my admin account with following content: /usr/bin/antivirus-stats.pl
Can't locate Date/Manip.pm in @INC (@INC contains:
/usr/lib/perl5/5.6.1/i386-linux /usr/lib/perl5/5.6.1
/usr/lib/perl5/site_perl/5.6.1/i386-linux /usr/lib/perl5/site_perl/5.6.1
/usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0
/usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.6.1/i386-linux
/usr/lib/perl5/vendor_perl/5.6.1 /usr/lib/perl5/vendor_perl .) at
/usr/bin/antivirus-stats.pl line 22.
BEGIN failed--compilation aborted at /usr/bin/antivirus-stats.pl line 22.
Early installation script did not install needed Perl module. Install: # rpm -Uvh http://sme.swerts-knudsen.dk/downloads/AntiVirus/perl-DateManip-5.40-15.i386.rpm

I get error message to my admin account with following subject "/usr/bin/freshclam --quiet -
l /var/log/clamav/freshclam.log
" and this message:
ERROR: CVD file not found on remote server
ERROR: Can't read main.cvd header from database.clamav.net (64.18.103.6)
Usually this happens if your system is trying to update virus database while a new is being uploaded on the database server by the Clam team. The error message should not happen the next time the antivirus panel updates.
Where are the Quarantined and Problems emails located?
Quarantined emails will be quarantined in /var/spool/amavis-ng/quarantine and Problems emails in
/var/spool/amavis-ng/problems
My server is behind a firewall or in DMZ and the Clam databases is not being updated. Configure the Proxy setting in the Antivirus Panel
 

How to install Network Information Service (NIS)

NIS or Network Information Service, is a service that provides information, that has to be known throughout the network, to all machines on the network. NIS is a system that becomes very usefull when you have more than one SME server in your network and you want to be able to log into all with the same username. First we need to install the NIS Master Server and secondary the NIS Client.


NIS Master Server Installation:

First Collect and install the rpm`s from the NIS directory.
[root@sme ]# cd /root
[root@sme ]# mkdir NIS_SERVER
[root@sme ]# cd NIS_SERVER
[root@sme ]# wget http://sme.swerts-knudsen.dk/downloads/NIS/ypserv-2.2-9.i386.rpm
[root@sme ]# wget http://sme.swerts-knudsen.dk/downloads/NIS/portmap-4.0-41.i386.rpm
[root@sme ]# rpm -ivh *.rpm
Then create a template file where you specify from which network the portmapper can be accessed (change 192.168.100.0 to your network)
[root@sme ]# mkdir -p /etc/e-smith/templates-custom/etc/hosts.allow
[root@sme ]# echo "portmap: 192.168.100.0/255.255.255.0" > /etc/e-smith/templates-custom/etc/hosts.allow/portmap
[root@sme ]# /sbin/e-smith/expand-template /etc/hosts.allow  
Start the portmap service and ensure that it as well as the NIS server (ypserv) start on reboot
[root@sme ]# chkconfig portmap on
[root@sme ]# service portmap start
[root@sme ]# cd /etc/rc.d/rc7.d
[root@sme ]# ln -s /etc/init.d/portmap S92portmap
[root@sme ]# ln -s /etc/init.d/ypserv S93ypserv

We need to inform the NIS Server on which domain it acts. Create a template and add your domain name in "yourdomain.com" and start the NIS Server.
[root@sme ]# echo "NISDOMAIN=yourdomain.com" > /etc/e-smith/templates/etc/sysconfig/network/60NISDOMAIN
[root@sme ]# /sbin/e-smith/expand-template /etc/sysconfig/network
[root@sme ]# /bin/domainname yourdomain.com
[root@sme ]# service ypserv start

Now we have to make sure the NIS Server is running. The following command should return this output.
[root@sme ]# rpcinfo -u localhost ypserv
program 100004 version 1 ready and waiting
program 100004 version 2 ready and waiting
Now were are almost ready to generate the NIS (YP) database but the Makefile needs to be altered a little for the SME Server. Open the /var/yp/Makefile and change the the following statements:

all: passwd group hosts rpc services netid protocols mail \
to
all: passwd group shadow  \

and Mimimum UID and GID to 5000 which is where the SME server starts

MINUID=5000
MINGID=5000


Now on the NIS Master run:
[root@sme ]# /usr/lib/yp/ypinit -m

Now we need to ensure that the NIS database is updated when new users and groups are added/deleted/locked or change password.
[root@sme ]# cd /etc/e-smith/events/actions
[root@sme ]# chmod ugo=rx,o-x nis-update-db
[root@sme ]# ln -s ../actions/nis-update-db ../user-create/S95NIS-Update
[root@sme ]# ln -s ../actions/nis-update-db ../user-delete/S95NIS-Update
[root@sme ]# ln -s ../actions/nis-update-db ../user-lock/S95NIS-Update
[root@sme ]# ln -s ../actions/nis-update-db ../user-modify/S95NIS-Update
[root@sme ]# ln -s ../actions/nis-update-db ../group-create/S95NIS-Update
[root@sme ]# ln -s ../actions/nis-update-db ../group-delete/S95NIS-Update
[root@sme ]# ln -s ../actions/nis-update-db ../group-modify/S95NIS-Update
[root@sme ]# ln -s ../actions/nis-update-db ../password-modify/S95NIS-Update

That's it, your NIS Master server is up and running. Now its time to get the NIS Client running.

NIS Client Installation:

Log into your client SME Server and download the needed modules from the NIS directory.
[root@sme ]# cd /root
[root@sme ]# mkdir NIS_CLIENT
[root@sme ]# cd NIS_CLIENT
[root@sme ]# rpm -ivh *.rpm

Then create a template file where you specify from which network the portmapper can be accessed (change 192.168.100.0 to your network)
[root@sme ]# mkdir -p /etc/e-smith/templates-custom/etc/hosts.allow
[root@sme ]# echo "portmap: 192.168.100.0/255.255.255.0" > /etc/e-smith/templates-custom/etc/hosts.allow/portmap
[root@sme ]# /sbin/e-smith/expand-template /etc/hosts.allow  

First we need to ensure that the services start after a reboot.
[root@sme ]# cd /etc/rc.d/rc7.d
[root@sme ]# ln -s /etc/init.d/portmap S92portmap
[root@sme ]# ln -s /etc/init.d/ypbind S94ypbind
Then we need to configure the NIS Client. Open the /etc/yp.conf file and add your NIS domain in the "domain" section.
#domain NISDOMAIN broadcast
# Use broadcast on the local net for domain NISDOMAIN
#
domain yourdomain.com broadcast

We need to inform the NIS Client on which domain it shall listen. Create a template and add your domain name in "yourdomain.com". When that is done we can start the NIS Client.
[root@sme ]# echo "NISDOMAIN=yourdomain.com" > /etc/e-smith/templates/etc/sysconfig/network/60NISDOMAIN
[root@sme ]# /sbin/e-smith/expand-template /etc/sysconfig/network
[root@sme ]# /bin/domainname yourdomain.com

[root@sme ]# service portmap start
[root@sme ]# service ypbind start
Binding to the NIS domain: [ OK ]
Listening for an NIS domain server.

Now check whether the Client is running properly. Issue the command and expect the following output.
[root@sme ]# rpcinfo -p localhost
program vers proto   port
        100000    2   tcp    111  portmapper
        100000    2   udp    111  portmapper
        100007    2   udp    758  ypbind
        100007    1   udp    758  ypbind
        100007    2   tcp    761  ypbind
        100007    1   tcp    761  ypbind
You may also run rpcinfo -u localhost ypbind. This command should produce something like:
[root@sme ]# rpcinfo -u localhost ypbind
        program 100007 version 1 ready and waiting
        program 100007 version 2 ready and waiting


At this point you should be able to use NIS client programs like ypcat, etc... For example, ypcat passwd.byname will give you the entire NIS password database. Now we need to make sure that the SME server uses NIS when validating. All this is configured in the /etc/nsswitch.conf file. This file is already in a SME template and we need to modify it a little. Open /etc/e-smith/templates/etc/nsswitch.conf/10files and modify to match the following lines to ensure users, groups and their respective passwords are checked by NIS.

passwd: nis files
shadow: nis files
group: nis files
 
hosts: { ($AccessType eq "off") ? "files" : "files dns" }
services: files
networks: files
protocols: files
rpc: files
ethers: files
netmasks: files
bootparams: files
automount: files
aliases: files

Now we just need to expand the template and restart the NIC Client.
[root@sme home]# /sbin/e-smith/expand-template /etc/nsswitch.conf
[root@sme ]# service ypbind restart
Shutting down NIS services: [ OK ]
Binding to the NIS domain: [ OK ]
Listening for an NIS domain server.
 


Your NIS installation is now complete and you should now be able to log into the Client server with UserIDs and Password stored and distributed from the NIS master. Now you should only add new users on the NIS master and whenever you add or modify a user on the NIS master server.