<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>songshu.org &#187; IT</title>
	<atom:link href="http://www.songshu.org/index.php/category/it/feed" rel="self" type="application/rss+xml" />
	<link>http://www.songshu.org</link>
	<description>Just another collection of nuts</description>
	<lastBuildDate>Mon, 22 Mar 2010 13:16:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Replacing a failing disk</title>
		<link>http://www.songshu.org/index.php/replacing-a-failing-disk</link>
		<comments>http://www.songshu.org/index.php/replacing-a-failing-disk#comments</comments>
		<pubDate>Sun, 08 Mar 2009 14:11:31 +0000</pubDate>
		<dc:creator>randall</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[all posts]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[disk failure]]></category>
		<category><![CDATA[mdadm]]></category>
		<category><![CDATA[raid]]></category>
		<category><![CDATA[software raid]]></category>

		<guid isPermaLink="false">http://www.songshu.org/?p=1473</guid>
		<description><![CDATA[&#60;div id=“dw”&#62; S.M.A.R.T. giving warnings http://manpages.songshu.org/manpages/lenny/en/man8/smartctl.8.html lately I&#039;ve been receiving S.M.A.R.T. warnings by mail about one of the disks in a RAID10 array, the mails came in pairs like below. SMART error (CurrentPendingSector) detected on host: host This email was generated by the smartd daemon running on: host name: host DNS domain: cipar.net NIS domain: (none) The following warning/error was logged by the smartd daemon: Device: /dev/sde, 1 Currently unreadable (pending) sectors For details see host&#039;s SYSLOG (default: /var/log/syslog). You can also use the smartctl utility for further investigation. The original email about this issue was sent at Fri Feb 20 20:30:43 2009 CET Another email message will be sent in 24 hours if the problem persists. SMART error (OfflineUncorrectableSector) detected on host: host this email was generated by the smartd daemon running on: host name: host DNS domain: cipar.net NIS domain: (none) The following warning/error was logged by the smartd daemon: Device: /dev/sde, 1 Offline uncorrectable sectors For details see host&#039;s SYSLOG (default: /var/log/syslog). You can also use the smartctl utility for further investigation. The original email about this issue was sent at Fri Feb 20 20:30:44 2009 CET Another email message will be sent in 24 hours if [...]]]></description>
			<content:encoded><![CDATA[<p><!-- begin Dokuwiki generated code--></p>
<div class="dokuwiki">
<p>&lt;div id=“dw”&gt;</p>
<h3><a name="s.m.a.r.t._giving_warnings" id="s.m.a.r.t._giving_warnings">S.M.A.R.T. giving warnings</a></h3>
<div class="level3">
<p><a href="http://manpages.songshu.org/manpages/lenny/en/man8/smartctl.8.html" class="urlextern" title="http://manpages.songshu.org/manpages/lenny/en/man8/smartctl.8.html"  rel="nofollow">http://manpages.songshu.org/manpages/lenny/en/man8/smartctl.8.html</a>
</p>
<p>
lately I&#039;ve been receiving S.M.A.R.T. warnings by mail about one of the disks in a RAID10 array,<br />
the mails came in pairs like below.
</p>
<pre class="code">SMART error (CurrentPendingSector) detected on host: host
This email was generated by the smartd daemon running on:

   host name: host
  DNS domain: cipar.net
  NIS domain: (none)

The following warning/error was logged by the smartd daemon:

Device: /dev/sde, 1 Currently unreadable (pending) sectors

For details see host&#039;s SYSLOG (default: /var/log/syslog).

You can also use the smartctl utility for further investigation.
The original email about this issue was sent at Fri Feb 20 20:30:43 2009 CET
Another email message will be sent in 24 hours if the problem persists.</pre>
<pre class="code">SMART error (OfflineUncorrectableSector) detected on host: host

this email was generated by the smartd daemon running on:

   host name: host
  DNS domain: cipar.net
  NIS domain: (none)

The following warning/error was logged by the smartd daemon:

Device: /dev/sde, 1 Offline uncorrectable sectors

For details see host&#039;s SYSLOG (default: /var/log/syslog).

You can also use the smartctl utility for further investigation.
The original email about this issue was sent at Fri Feb 20 20:30:44 2009 CET
Another email message will be sent in 24 hours if the problem persists.</pre>
<p>
Issuing</p>
<pre class="code">smartctl -a /dev/sde</pre>
<p>gave me the following summary by the smartmontools
</p>
<pre class="code">smartctl version 5.38 [x86_64-unknown-linux-gnu] Copyright (C) 2002-8 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF INFORMATION SECTION ===
Model Family:     Seagate Barracuda 7200.11
Device Model:     ST3500320AS
Serial Number:    5QM056TH
Firmware Version: SD04
User Capacity:    500,107,862,016 bytes
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   7
ATA Standard is:  Exact ATA specification draft version not indicated
Local Time is:    Sun Mar  8 11:00:53 2009 CET
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x82)    Offline data collection activity
                   was completed without error.
                   Auto Offline Data Collection: Enabled.
Self-test execution status:      ( 113)    The previous self-test completed having
                   the read element of the test failed.
Total time to complete Offline
data collection:          ( 634) seconds.
Offline data collection
capabilities:              (0x7b) SMART execute Offline immediate.
                   Auto Offline data collection on/off support.
                   Suspend Offline collection upon new
                   command.
                   Offline surface scan supported.
                   Self-test supported.
                   Conveyance Self-test supported.
                   Selective Self-test supported.
SMART capabilities:            (0x0003)    Saves SMART data before entering
                   power-saving mode.
                   Supports SMART auto save timer.
Error logging capability:        (0x01)    Error logging supported.
                   General Purpose Logging supported.
Short self-test routine
recommended polling time:      (   1) minutes.
Extended self-test routine
recommended polling time:      ( 106) minutes.
Conveyance self-test routine
recommended polling time:      (   2) minutes.
SCT capabilities:            (0x003b)    SCT Status supported.
                   SCT Feature Control supported.
                   SCT Data Table supported.

SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
 1 Raw_Read_Error_Rate     0x000f   114   099   006    Pre-fail  Always       -       132023209
 3 Spin_Up_Time            0x0003   093   092   000    Pre-fail  Always       -       0
 4 Start_Stop_Count        0x0032   100   100   020    Old_age   Always       -       159
 5 Reallocated_Sector_Ct   0x0033   100   100   036    Pre-fail  Always       -       35
 7 Seek_Error_Rate         0x000f   074   060   030    Pre-fail  Always       -       21613621419
 9 Power_On_Hours          0x0032   089   089   000    Old_age   Always       -       9858
10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
12 Power_Cycle_Count       0x0032   100   037   020    Old_age   Always       -       159
184 Unknown_Attribute       0x0032   100   100   099    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   082   082   000    Old_age   Always       -       18
188 Unknown_Attribute       0x0032   100   098   000    Old_age   Always       -       4295032838
189 High_Fly_Writes         0x003a   001   001   000    Old_age   Always       -       344
190 Airflow_Temperature_Cel 0x0022   071   048   045    Old_age   Always       -       29 (Lifetime Min/Max 27/31)
194 Temperature_Celsius     0x0022   029   052   000    Old_age   Always       -       29 (0 21 0 0)
195 Hardware_ECC_Recovered  0x001a   028   021   000    Old_age   Always       -       132023209
197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       1
198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       1
199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0

SMART Error Log Version: 1
ATA Error Count: 18 (device log contains only the most recent five errors)
   CR = Command Register [HEX]
   FR = Features Register [HEX]
   SC = Sector Count Register [HEX]
   SN = Sector Number Register [HEX]
   CL = Cylinder Low Register [HEX]
   CH = Cylinder High Register [HEX]
   DH = Device/Head Register [HEX]
   DC = Device Command Register [HEX]
   ER = Error register [HEX]
   ST = Status register [HEX]
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It &quot;wraps&quot; after 49.710 days.

Error 18 occurred at disk power-on lifetime: 9008 hours (375 days + 8 hours)
 When the command that caused the error occurred, the device was active or idle.

 After command completion occurred, registers were:
 ER ST SC SN CL CH DH
 -- -- -- -- -- -- --
 40 51 00 4b 10 95 00

 Commands leading to the command that caused the error were:
 CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
 -- -- -- -- -- -- -- --  ----------------  --------------------
 60 00 80 9f 0e 95 40 00  17d+17:02:58.471  READ FPDMA QUEUED
 ec 00 00 00 00 00 a0 00  17d+17:02:58.471  IDENTIFY DEVICE
 2f 00 01 10 00 00 a0 00  17d+17:02:58.348  READ LOG EXT
 60 00 80 9f 0e 95 40 00  17d+17:02:56.547  READ FPDMA QUEUED
 ec 00 00 00 00 00 a0 00  17d+17:02:56.546  IDENTIFY DEVICE

Error 17 occurred at disk power-on lifetime: 9008 hours (375 days + 8 hours)
 When the command that caused the error occurred, the device was active or idle.

 After command completion occurred, registers were:
 ER ST SC SN CL CH DH
 -- -- -- -- -- -- --
 40 51 00 4b 10 95 00

 Commands leading to the command that caused the error were:
 CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
 -- -- -- -- -- -- -- --  ----------------  --------------------
 60 00 80 9f 0e 95 40 00  17d+17:02:56.547  READ FPDMA QUEUED
 ec 00 00 00 00 00 a0 00  17d+17:02:56.546  IDENTIFY DEVICE
 2f 00 01 10 00 00 a0 00  17d+17:02:56.441  READ LOG EXT
 60 00 80 9f 0e 95 40 00  17d+17:02:54.640  READ FPDMA QUEUED
 ec 00 00 00 00 00 a0 00  17d+17:02:54.639  IDENTIFY DEVICE

Error 16 occurred at disk power-on lifetime: 9008 hours (375 days + 8 hours)
 When the command that caused the error occurred, the device was active or idle.

 After command completion occurred, registers were:
 ER ST SC SN CL CH DH
 -- -- -- -- -- -- --
 40 51 00 4b 10 95 00

 Commands leading to the command that caused the error were:
 CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
 -- -- -- -- -- -- -- --  ----------------  --------------------
 60 00 80 9f 0e 95 40 00  17d+17:02:54.640  READ FPDMA QUEUED
 ec 00 00 00 00 00 a0 00  17d+17:02:54.639  IDENTIFY DEVICE
 2f 00 01 10 00 00 a0 00  17d+17:02:54.534  READ LOG EXT
 60 00 80 9f 0e 95 40 00  17d+17:02:52.707  READ FPDMA QUEUED
 ec 00 00 00 00 00 a0 00  17d+17:02:52.707  IDENTIFY DEVICE

Error 15 occurred at disk power-on lifetime: 9008 hours (375 days + 8 hours)
 When the command that caused the error occurred, the device was active or idle.

 After command completion occurred, registers were:
 ER ST SC SN CL CH DH
 -- -- -- -- -- -- --
 40 51 00 4b 10 95 00

 Commands leading to the command that caused the error were:
 CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
 -- -- -- -- -- -- -- --  ----------------  --------------------
 60 00 80 9f 0e 95 40 00  17d+17:02:52.707  READ FPDMA QUEUED
 ec 00 00 00 00 00 a0 00  17d+17:02:52.707  IDENTIFY DEVICE
 2f 00 01 10 00 00 a0 00  17d+17:02:52.585  READ LOG EXT
 60 00 80 9f 0e 95 40 00  17d+17:02:50.792  READ FPDMA QUEUED
 ec 00 00 00 00 00 a0 00  17d+17:02:50.791  IDENTIFY DEVICE

Error 14 occurred at disk power-on lifetime: 9008 hours (375 days + 8 hours)
 When the command that caused the error occurred, the device was active or idle.

 After command completion occurred, registers were:
 ER ST SC SN CL CH DH
 -- -- -- -- -- -- --
 40 51 00 4b 10 95 00

 Commands leading to the command that caused the error were:
 CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
 -- -- -- -- -- -- -- --  ----------------  --------------------
 60 00 80 9f 0e 95 40 00  17d+17:02:50.792  READ FPDMA QUEUED
 ec 00 00 00 00 00 a0 00  17d+17:02:50.791  IDENTIFY DEVICE
 2f 00 01 10 00 00 a0 00  17d+17:02:50.677  READ LOG EXT
 60 00 80 9f 0e 95 40 00  17d+17:02:48.845  READ FPDMA QUEUED
 60 00 00 9f 0a 95 40 00  17d+17:02:48.845  READ FPDMA QUEUED

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Extended offline    Completed: read failure       10%      9849         917923767
# 2  Extended offline    Completed without error       00%      9685         -
# 3  Extended offline    Completed without error       00%      9594         -
# 4  Extended offline    Completed: read failure       90%      9512         9769035
# 5  Extended offline    Completed: read failure       90%      9344         9769035
# 6  Extended offline    Completed: read failure       90%      9176         9769035
# 7  Extended offline    Completed: read failure       90%      9008         9769035
# 8  Extended offline    Completed without error       00%      8842         -
# 9  Extended offline    Completed without error       00%      8674         -
#10  Extended offline    Completed: read failure       40%      8505         675183097
#11  Extended offline    Completed: read failure       40%      8342         675183097
#12  Extended offline    Completed: read failure       40%      8170         675183097
#13  Extended offline    Completed: read failure       40%      8002         675183097
#14  Extended offline    Completed without error       00%      7835         -
#15  Extended offline    Completed without error       00%      7673         -
#16  Extended offline    Completed without error       00%      7503         -
#17  Extended offline    Completed without error       00%      7333         -
#18  Extended offline    Completed without error       00%      7165         -
#19  Extended offline    Completed without error       00%      6997         -
#20  Extended offline    Completed without error       00%      6833         -
#21  Extended offline    Completed without error       00%      6660         -

SMART Selective self-test log data structure revision number 1
SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
   1        0        0  Not_testing
   2        0        0  Not_testing
   3        0        0  Not_testing
   4        0        0  Not_testing
   5        0        0  Not_testing
Selective self-test flags (0x0):
 After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay. </pre>
<p>
Actually i wasn&#039;t sure on how to read this but a quick e-mail to the debian-user mailinglist<br />
returned the following advice.
</p>
<pre class="code">
G&#039;Day.

&amp;gt; &amp;gt; smartctl --all /dev/sde
&amp;gt; &amp;gt; gives me the following, i&#039;ve been trying to google this but some sources say
&amp;gt; &amp;gt; replace the disk at once or don&#039;t wory, its harmless. Anybody can shed some
&amp;gt; &amp;gt; light?

&amp;gt; &amp;gt;  5 Reallocated_Sector_Ct   0x0033   100   100   036    Pre-fail  Always
&amp;gt; &amp;gt;   -       35

This one above indicates that you drive is developing bad sectors. All
drives come with &#039;spare&#039; sectors that can be remapped to the usable
space if ine or more becomes bad. Your drive has reallocated 35 bad
sectors and is most likely out of spares. Regardless the drive is
failing and must be replaced. In addition to that the data that was
stored on those 35 previously bad sectors is most likely irretrievably
lost. I hope that your raid setup has saved you from this data
corruption.

&amp;gt; &amp;gt; Num  Test_Description    Status                  Remaining  LifeTime(hours)
&amp;gt; &amp;gt;  LBA_of_first_error
&amp;gt; &amp;gt; # 1  Extended offline    Completed: read failure       10%      9849
&amp;gt; &amp;gt; 917923767

...

&amp;gt; &amp;gt; #13  Extended offline    Completed: read failure       40%      8002
&amp;gt; &amp;gt; 675183097

Your disc has been steadily failing for the last ~1800 hours.
Buy a replacement and swap it out asap.

Adrian</pre>
<p>
OK, seems like clear advice so i&#039;d better take it,<br />
actually i already ordered the new disk since smart gave me the first warning so its time to do some replacing.
</p>
</div>
<h3><a name="making_an_extra_backup" id="making_an_extra_backup">Making an extra backup</a></h3>
<div class="level3">
<p><a href="http://manpages.songshu.org/manpages/lenny/en/man1/rsync.1.html" class="urlextern" title="http://manpages.songshu.org/manpages/lenny/en/man1/rsync.1.html"  rel="nofollow">http://manpages.songshu.org/manpages/lenny/en/man1/rsync.1.html</a>
</p>
<p>
Before doing anything i decided to do the manual backup routine.
</p>
<p>
I have all my services and important data in a VServer set up on one big LVM partition<br />
so we stop the VServers first.
</p>
<pre class="code">/etc/init.d/util-vserver stop</pre>
<p>
And then make a LVM snapshot.
</p>
<p>
<a href="http://manpages.songshu.org/manpages/lenny/en/man8/lvm.8.html" class="urlextern" title="http://manpages.songshu.org/manpages/lenny/en/man8/lvm.8.html"  rel="nofollow">http://manpages.songshu.org/manpages/lenny/en/man8/lvm.8.html</a>
</p>
<pre class="code">lvcreate -L592M -s -n backup /dev/vg/VSERVERS</pre>
<p>
Normally you can start the VServers again at this point and then continue making the backup,<br />
but since this is a failing disk replacement and its sunday anyway i decided not too to risk any loss of data<br />
in case something did go wrong and accept the downtime.
</p>
<p>
First we mount the snapshot to a physical location.<br />
In this case the location is as follows.</p>
<pre class="code">mkdir /mnt/backup</pre>
<p>
And then mount it.
</p>
<pre class="code">mount /dev/vg/backup /mnt/backup</pre>
<p>As said this is not my usual rotating backup, so i could have used copy but I always use Rsync anyway.
</p>
<pre class="code">rsync -av /mnt/backup /BACKUP/backup</pre>
<p>
The /BACKUP location is on another seperate raid1 array on the same box,<br />
you could of course do it to another machine over the network,<br />
but since i have huge amounts of data this simply goes faster
</p>
<p>
After Rsync has done its job we can unmount the LVM snapshot.
</p>
<pre class="code">umount /mnt/backup</pre>
<p>
And then remove the snapshot alltogether.</p>
<pre class="code">lvremove /dev/vg/backup</pre>
</div>
<h3><a name="remove_the_disk_from_the_array" id="remove_the_disk_from_the_array">Remove the disk from the array</a></h3>
<div class="level3">
<p>Now we have a fresh backup lets remove the disk from the array.<br />
The array looks as follows, note this is a raid10 + a raid1 array on the same box so 6 disks in total.<br />
lets have a look with</p>
<pre class="code">cat /proc/mdstat</pre>
<p>the result looks like this.</p>
<pre class="code">Personalities : [raid1] [raid10]
md3 : active raid10 sdc6[0] sdd6[3] sdf6[2] sde6[1]
      966020096 blocks 256K chunks 2 far-copies [4/4] [UUUU]

md2 : active raid10 sdc5[0] sdf5[3] sde5[2] sdd5[1]
      979712 blocks 64K chunks 2 near-copies [4/4] [UUUU]

md1 : active raid10 sdc3[0] sdf3[3] sde3[2] sdd3[1]
      9574528 blocks 64K chunks 2 near-copies [4/4] [UUUU]

md0 : active raid1 sdc1[0] sdd1[3] sde1[2] sdf1[1]
      96256 blocks [4/4] [UUUU]

md4 : active raid1 sda1[0] sdb1[1]
      976759936 blocks [2/2] [UU]

unused devices: &amp;lt;none&amp;gt;
</pre>
<p>
The disk /dev/sde is used in ”/boot md0” ”/root md1” “swap md2” and the big ”/VSERVERS md3” partition.
</p>
<p>
We need to remove it from every md device and it takes 2 steps per device.<br />
First we set it to fail</p>
<pre class="code">mdadm --fail /dev/md0 /dev/sde1</pre>
<pre class="code">mdadm --fail /dev/md1 /dev/sde3</pre>
<pre class="code">mdadm --fail /dev/md2 /dev/sde5</pre>
<pre class="code">mdadm --fail /dev/md3 /dev/sde6</pre>
<p>This time</p>
<pre class="code">cat /proc/mdstat</pre>
<p>shows as follows</p>
<pre class="code">Personalities : [raid1] [raid10]
md3 : active raid10 sdc6[0] sdd6[3] sdf6[2] sde6[4](F)
      966020096 blocks 256K chunks 2 far-copies [4/3] [U_UU]

md2 : active raid10 sdc5[0] sdf5[3] sde5[4](F) sdd5[1]
      979712 blocks 64K chunks 2 near-copies [4/3] [UU_U]

md1 : active raid10 sdc3[0] sdf3[3] sde3[4](F) sdd3[1]
      9574528 blocks 64K chunks 2 near-copies [4/3] [UU_U]

md0 : active raid1 sdc1[0] sdd1[3] sde1[4](F) sdf1[1]
      96256 blocks [4/3] [UU_U]

md4 : active raid1 sda1[0] sdb1[1]
      976759936 blocks [2/2] [UU]

unused devices: &amp;lt;none&amp;gt;</pre>
<p>That looks about right, so now we completely remove it from the array
</p>
<pre class="code">mdadm --remove /dev/md0 /dev/sde1</pre>
<pre class="code">mdadm --remove /dev/md1 /dev/sde3</pre>
<pre class="code">mdadm --remove /dev/md2 /dev/sde5</pre>
<pre class="code">mdadm --remove /dev/md3 /dev/sde6</pre>
</div>
<h3><a name="identify_the_disk" id="identify_the_disk">Identify the disk</a></h3>
<div class="level3">
<p>
Now /dev/sde is completely removed from the array so we can physically remove the disk and replace it with the new disk.<br />
But how do we know which of the 6 disks is /dev/sde?<br />
Running</p>
<pre class="code">smartctl -a /dev/sde</pre>
<p>again will show the serial number as it is marked on the disk.</p>
<pre class="code">=== START OF INFORMATION SECTION ===
Model Family:     Seagate Barracuda 7200.11
Device Model:     ST3500320AS
Serial Number:    5QM056TH
Firmware Version: SD04
User Capacity:    500,107,862,016 bytes
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   7
ATA Standard is:  Exact ATA specification draft version not indicated
Local Time is:    Sun Mar  8 14:19:10 2009 CET
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
</pre>
<p>So in this case 5QM056TH, good to know.<br />
Lets shutdown the machine and replace the disk</p>
<pre class="code">shutdown -h now</pre>
</div>
<h3><a name="add_the_new_disk_to_the_array" id="add_the_new_disk_to_the_array">Add the new disk to the array</a></h3>
<div class="level3">
<p>After replacing the disk a new unformatted disk showed up when issuing
</p>
<pre class="code">fdisk -l</pre>
<pre class="code">Disk /dev/sde: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/sde doesn&#039;t contain a valid partition table</pre>
<p>
Great, so lets get this one with the program and add it to the RAID10 array.<br />
Firstly we need to make sure that the new /dev/sde has the exact same partition layout as the other 3 disks in the array.<br />
Lets copy the partition table of /dev/sdc to /dev/sde.</p>
<pre class="code">sfdisk -d /dev/sdc | sfdisk /dev/sde</pre>
<p>The result looked like this</p>
<pre class="code">Checking that no-one is using this disk right now ...
OK

Disk /dev/sde: 60801 cylinders, 255 heads, 63 sectors/track

sfdisk: ERROR: sector 0 does not have an msdos signature
 /dev/sde: unrecognized partition table type
Old situation:
No partitions found
New situation:
Units = sectors of 512 bytes, counting from 0

   Device Boot    Start       End   #sectors  Id  System
/dev/sde1   *        63    192779     192717  fd  Linux raid autodetect
/dev/sde2       9767520 976768064  967000545   5  Extended
/dev/sde3        192780   9767519    9574740  fd  Linux raid autodetect
/dev/sde4             0         -          0   0  Empty
/dev/sde5       9767583  10747484     979902  fd  Linux raid autodetect
/dev/sde6      10747548 976768064  966020517  fd  Linux raid autodetect
Successfully wrote the new partition table

Re-reading the partition table ...

If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes:  dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)</pre>
<p>
Once the partitions are OK, we can add the disk the same way as we failed it and removed it earlier</p>
<pre class="code">mdadm --add /dev/md0 /dev/sde1</pre>
<pre class="code">mdadm --add /dev/md1 /dev/sde3</pre>
<pre class="code">mdadm --add /dev/md2 /dev/sde5</pre>
<pre class="code">mdadm --add /dev/md3 /dev/sde6</pre>
<p>
Issuing the command</p>
<pre class="code">watch cat /proc/mdstat</pre>
<p>should show you that the new disk is part of the array and that the syncing is in progress.
</p>
<pre class="code">Every 2.0s: cat /proc/mdstat                                                             Sun Mar  8 15:01:52 2009

Personalities : [raid1] [raid10]
md3 : active raid10 sde6[4] sdd6[0] sdc6[3] sdf6[2]
      966020096 blocks 256K chunks 2 far-copies [4/3] [U_UU]
      [&amp;gt;....................]  recovery =  0.0% (196352/483010048) finish=122.9min speed=65450K/sec

md2 : active raid10 sde5[4] sdd5[0] sdf5[3] sdc5[1]
      979712 blocks 64K chunks 2 near-copies [4/3] [UU_U]
        resync=DELAYED

md1 : active raid10 sde3[2] sdd3[0] sdf3[3] sdc3[1]
      9574528 blocks 64K chunks 2 near-copies [4/4] [UUUU]

md0 : active raid1 sde1[2] sdd1[0] sdc1[3] sdf1[1]
      96256 blocks [4/4] [UUUU]

md4 : active raid1 sda1[0] sdb1[1]
      976759936 blocks [2/2] [UU]

unused devices: &amp;lt;none&amp;gt;</pre>
<p>
&lt;/div&gt;
</p>
</div>
</div>
<p><!-- end Dokuwiki generated code--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.songshu.org/index.php/replacing-a-failing-disk/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>avantfax_install_script</title>
		<link>http://www.songshu.org/index.php/avantfax_install_script</link>
		<comments>http://www.songshu.org/index.php/avantfax_install_script#comments</comments>
		<pubDate>Sat, 21 Feb 2009 11:25:10 +0000</pubDate>
		<dc:creator>randall</dc:creator>
				<category><![CDATA[Debian Lenny]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[avantfax]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[hylafax]]></category>
		<category><![CDATA[install script]]></category>
		<category><![CDATA[lenny]]></category>

		<guid isPermaLink="false">http://www.songshu.org/?p=1276</guid>
		<description><![CDATA[&#60;div id=“dw”&#62; Debian Avantfax install script improvement WORK IN PROGRESS!!!!! Avantfax works really well on Debian but it is not officially supported by Avantfax so the install script is lacking, i would like to improve that and any feedback would be appreciated. The first time i installed Avantfax on Debian Etch there was only an install script for Red Hat and SuSe so everything needed to be done manually, i made some notes at the time here http://www.songshu.org/index.php/avantfax-on-debian Since AvantFAX 3.1.0 there is a debian install script available that comes a long way but is not yet perfect and it requires some extra manual steps and tinkering, also an install script to set up mail2fax is missing for Debian. This is an attempt to improve the following Debian scripts that can be found in AvantFAX 3.1.6 http://www.songshu.org/index.php/old-avantfax-316-debian-install-script http://www.songshu.org/index.php/old-avantfax-316-debian-prefs http://www.songshu.org/index.php/old-avantfax-316-email2fax http://www.songshu.org/index.php/old-avantfax-316-setup-postfix debian install script This script comes a long way accept that the apache virtual host is not set up correctly. and the specified directory /etc/apache2/logs does not exist so apache will refuse to start. The following section needs improvement. cat &#38;gt;&#38;gt; /etc/apache2/sites-enabled/000-default &#38;lt;&#38;lt; EOF &#38;lt;VirtualHost *:80&#38;gt; DocumentRoot $INSTDIR ServerName avantfax ErrorLog logs/avantfax-error_log CustomLog logs/avantfax-access_log common &#38;lt;/VirtualHost&#38;gt; EOF What we see [...]]]></description>
			<content:encoded><![CDATA[<p><!-- begin Dokuwiki generated code--></p>
<div class="dokuwiki">
<p>&lt;div id=“dw”&gt;</p>
<h2><a name="debian_avantfax_install_script_improvement_work_in_progress" id="debian_avantfax_install_script_improvement_work_in_progress">Debian Avantfax install script improvement WORK IN PROGRESS!!!!!</a></h2>
<div class="level2">
<p>Avantfax works really well on Debian but it is not officially supported by Avantfax so the install script is lacking, i would like to improve that and any feedback would be appreciated.
</p>
<p>
The first time i installed Avantfax on Debian Etch there was only an install script for Red Hat and SuSe so everything needed to be done manually, i made some notes at the time here <a href="http://www.songshu.org/index.php/avantfax-on-debian" class="urlextern" title="http://www.songshu.org/index.php/avantfax-on-debian"  rel="nofollow">http://www.songshu.org/index.php/avantfax-on-debian</a>
</p>
<p>
Since AvantFAX 3.1.0 there is a debian install script available that comes a long way but is not yet perfect and it requires some extra manual steps and tinkering, also an install script to set up mail2fax is missing for Debian.
</p>
<p>
This is an attempt to improve the following Debian scripts that can be found in AvantFAX 3.1.6</p>
<ul>
<li class="level1">
<div class="li"> <a href="http://www.songshu.org/index.php/old-avantfax-316-debian-install-script" class="urlextern" title="http://www.songshu.org/index.php/old-avantfax-316-debian-install-script"  rel="nofollow">http://www.songshu.org/index.php/old-avantfax-316-debian-install-script</a></div>
</li>
<li class="level1">
<div class="li"> <a href="http://www.songshu.org/index.php/old-avantfax-316-debian-prefs" class="urlextern" title="http://www.songshu.org/index.php/old-avantfax-316-debian-prefs"  rel="nofollow">http://www.songshu.org/index.php/old-avantfax-316-debian-prefs</a></div>
</li>
<li class="level1">
<div class="li"> <a href="http://www.songshu.org/index.php/old-avantfax-316-email2fax" class="urlextern" title="http://www.songshu.org/index.php/old-avantfax-316-email2fax"  rel="nofollow">http://www.songshu.org/index.php/old-avantfax-316-email2fax</a></div>
</li>
<li class="level1">
<div class="li"> <a href="http://www.songshu.org/index.php/old-avantfax-316-setup-postfix" class="urlextern" title="http://www.songshu.org/index.php/old-avantfax-316-setup-postfix"  rel="nofollow">http://www.songshu.org/index.php/old-avantfax-316-setup-postfix</a></div>
</li>
</ul>
</div>
<h3><a name="debian_install_script" id="debian_install_script">debian install script</a></h3>
<div class="level3">
<p>This script comes a long way accept that the apache virtual host is not set up correctly. and the specified directory /etc/apache2/logs does not exist so apache will refuse to start.
</p>
<p>
The following section needs improvement.</p>
<pre class="code">cat &amp;gt;&amp;gt; /etc/apache2/sites-enabled/000-default &amp;lt;&amp;lt; EOF

&amp;lt;VirtualHost *:80&amp;gt;
    DocumentRoot $INSTDIR
    ServerName avantfax
    ErrorLog logs/avantfax-error_log
    CustomLog logs/avantfax-access_log common
&amp;lt;/VirtualHost&amp;gt;
EOF</pre>
<p>
What we see here is that the virtualhost is added below in the 000-default file, this does not work since the default will not be changed and a new virtual host is not added.<br />
Also we could move the avantfax logs to the debian default log section /var/logs/<br />
The suggestion is to have it add a separate new virtual host for the chosen domain name as specified in the debian-prefs.txt.</p>
<pre class="code">cat &amp;gt;&amp;gt; /etc/apache2/sites-available/$FAXDOMAIN &amp;lt;&amp;lt; EOF

&amp;lt;VirtualHost *:80&amp;gt;
    DocumentRoot $INSTDIR
    ServerName $FAXDOMAIN
    ErrorLog /var/log/avantfax-error_log
    CustomLog /var/log/avantfax-access_log common
&amp;lt;/VirtualHost&amp;gt;
EOF</pre>
<p>
After the new virtual host file is added to the sites-available we can add the following to have it added to the apache sites-enabled section.
</p>
<pre class="code">a2ensite $FAXDOMAIN
/etc/init.d/apache2 reload
a2dissite 000-default
/etc/init.d/apache2 reload</pre>
</div>
<h3><a name="debian-prefs" id="debian-prefs">debian-prefs</a></h3>
<div class="level3">
</div>
<h3><a name="email2fax" id="email2fax">email2fax</a></h3>
<div class="level3">
</div>
<h3><a name="setup-postfix" id="setup-postfix">setup-postfix</a></h3>
<div class="level3">
<p>This script is completely non-debian so i suggest to make ad a new debian-setup-postfix.sh script
</p>
<p>
The following section can be removed</p>
<pre class="code"># INSTALL REQUIRED APPS IF NOT ALREADY INSTALLED

echo “Installing required packages”

yast –install postfix</pre>
<p>
It mentions yast and that should be replaced with apt-get but AvantFax depends on a functioning hylafax and the installation of hylafax in its turn depends on an installed MTA so it will default to install exim4 if no other MTA is present, using this scripts means you want to use postfix as MTA so this should already be installed before Hylafax.
</p>
<p>
The following section is ment to stop postfix and alter the master.cf file
</p>
<pre class="code"># CONFIGURE POSTFIX

/sbin/service postfix stop

echo “Configuring Email to FAX for domain ${FAXDOMAIN}”

cat &amp;gt;&amp;gt; /etc/postfix/master.cf &amp;lt;&amp;lt; EOF
fax unix - n n - 1 pipe
flags= user=$FAXMAILUSER argv=/usr/bin/faxmail -d -n -NT ${user}

EOF</pre>
<p>Debian uses init so this section should read as follows</p>
<pre class="code"># CONFIGURE POSTFIX
/etc/init.d/postfix stop

echo “Configuring Email to FAX for domain ${FAXDOMAIN}”

cat &amp;gt;&amp;gt; /etc/postfix/master.cf &amp;lt;&amp;lt; EOF
fax unix - n n - 1 pipe
flags= user=$FAXMAILUSER argv=/usr/bin/faxmail -d -n -NT ${user}

EOF</pre>
<p>
Faxmail will start complaining it can not locate the fonts so we need to specify the ghostscript font directory to Hylafax</p>
<pre class="code">cat &amp;gt;&amp;gt; /etc/hylafax/hyla.conf &amp;lt;&amp;lt; EOF
FontMap: /usr/share/ghostscript/8.62/lib/
EOF</pre>
<p>The following section at the end of this script will start postfix after having it stopped at the beginning of the configuration, again we use init.</p>
<pre class="code">/sbin/chkconfig postfix on
/sbin/service postfix start</pre>
<p>
so we replace this with</p>
<pre class="code">/etc/init.d/postfix start</pre>
<p>&lt;/div&gt;
</p>
</div>
</div>
<p><!-- end Dokuwiki generated code--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.songshu.org/index.php/avantfax_install_script/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>hylafax lenny vserver</title>
		<link>http://www.songshu.org/index.php/hylafax-lenny-vserver</link>
		<comments>http://www.songshu.org/index.php/hylafax-lenny-vserver#comments</comments>
		<pubDate>Sat, 21 Feb 2009 10:47:02 +0000</pubDate>
		<dc:creator>randall</dc:creator>
				<category><![CDATA[Debian Lenny]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[all posts]]></category>
		<category><![CDATA[avantfax]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[hylafax]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[vserver]]></category>

		<guid isPermaLink="false">http://www.songshu.org/index.php/1258</guid>
		<description><![CDATA[&#60;div id=“dw”&#62; HylaFAX http://manpages.songshu.org/manpages/lenny/en/man5/hylafax-server.5.html Hylafax runs very well in a Vserver, all that needs to be done extra compared to a “normal” install is to copy the /dev/ttyS0 so Hylafx can reach it from within the Vserver. It is absolutely not needed to have Hylafax run in a Vserver but since this is a “low profile” setup for about a few dozen faxes a day and just as many users it does not need a dedicated box to run on, all you need is a cheap fax modem (in my case a a Emininet em5017) that i picked up for about 30,- Euro. Off course you need a server to attach it to, i already have one anyway, but you could use any old box. Add a nice front end like Avantfax, a printer and a scanner and you have a complete “small office” fax solution. Vserver installation newvserver --vsroot /VSERVERS --hostname fax --domain cipar.net --ip 192.168.1.10/24 --dist lenny --mirror http://192.168.1.12:3142/debian.apt-get.eu/debian --interface dummy0 vserver fax start vserver fax enter Since i use a lot of different Vserver installs on a single box (network) i make use of an apt-cacher to prevent having to download a lot of things over and [...]]]></description>
			<content:encoded><![CDATA[<p><!-- begin Dokuwiki generated code--></p>
<div class="dokuwiki">
<p>&lt;div id=“dw”&gt;</p>
<h2><a name="hylafax" id="hylafax">HylaFAX</a></h2>
<div class="level2">
<p><a href="http://manpages.songshu.org/manpages/lenny/en/man5/hylafax-server.5.html" class="urlextern" title="http://manpages.songshu.org/manpages/lenny/en/man5/hylafax-server.5.html"  rel="nofollow">http://manpages.songshu.org/manpages/lenny/en/man5/hylafax-server.5.html</a>
</p>
<p>
Hylafax runs very well in a Vserver, all that needs to be done extra compared to a “normal” install is to copy the /dev/ttyS0 so Hylafx can reach it from within the Vserver.
</p>
<p>
It is absolutely not needed to have Hylafax run in a Vserver but since this is a “low profile” setup for about a few dozen faxes a day and just as many users it does not need a dedicated box to run on, all you need is a cheap fax modem (in my case a a Emininet em5017) that i picked up for about 30,- Euro.
</p>
<p>
Off course you need a server to attach it to, i already have one anyway, but you could use any old box.<br />
Add a nice front end like Avantfax, a printer and a scanner and you have a complete “small office” fax solution.
</p>
</div>
<h3><a name="vserver_installation" id="vserver_installation">Vserver installation</a></h3>
<div class="level3">
<pre class="code">newvserver --vsroot /VSERVERS --hostname fax --domain cipar.net --ip 192.168.1.10/24 --dist lenny --mirror http://192.168.1.12:3142/debian.apt-get.eu/debian --interface dummy0</pre>
<pre class="code">vserver fax start
vserver fax enter</pre>
<p>
Since i use a lot of different Vserver installs on a single box (network) i make use of an apt-cacher to prevent having to download a lot of things over and over again, otherwise just use your normal sources.
</p>
<pre class="code"># nano /etc/apt/sources.list</pre>
<pre class="code">deb http://192.168.1.12:3142/security.debian.org/ lenny/updates main contrib
deb-src http://192.168.1.12:3142/security.debian.org/ lenny/updates main contrib
deb http://192.168.1.12:3142/debian.apt-get.eu/debian/ lenny main contrib non-free</pre>
<pre class="code">apt-get update &amp;amp;&amp;amp; apt-get upgrade
</pre>
</div>
<h3><a name="hylafax1" id="hylafax1">HylaFAX</a></h3>
<div class="level3">
<p>
<a href="http://www.howtoforge.com/build-a-hylafax-server-with-avantfax-on-debian-etch" class="urlextern" title="http://www.howtoforge.com/build-a-hylafax-server-with-avantfax-on-debian-etch"  rel="nofollow">http://www.howtoforge.com/build-a-hylafax-server-with-avantfax-on-debian-etch</a><br />
<a href="http://www.lucasmanual.com/mywiki/FaxServer" class="urlextern" title="http://www.lucasmanual.com/mywiki/FaxServer"  rel="nofollow">http://www.lucasmanual.com/mywiki/FaxServer</a><br />
<a href="http://www.avantfax.com/install.php" class="urlextern" title="http://www.avantfax.com/install.php"  rel="nofollow">http://www.avantfax.com/install.php</a>
</p>
<p>
Hylafax depends on a MTA so it will use Exim4 as the Debian default but i personally prefer to use Postfix so i install that one first.</p>
<pre class="code">apt-get install postfix</pre>
<pre class="code">choose internet site</pre>
<p>The system mail name, in my case i will go with the default fax.cipar.net since i use it on the local network only it does not really matter.
</p>
<pre class="code">nano /etc/aliases</pre>
<p>and add the following</p>
<pre class="code">root:   randall@smydomain.com</pre>
<pre class="code">newaliases</pre>
<pre class="code">
apt-get install hylafax-server</pre>
<p>The following is only needed because we have this running within a Vserver, otherwise Hylafax can not contact the fax modem.</p>
<pre class="code">exit
cp -a /dev/ttyS0 /VSERVERS/fax/dev/ttyS0
cp -aR /dev/null /VSERVERS/fax/var/spool/hylafax/dev
vserver fax enter</pre>
<pre class="code">faxsetup</pre>
<p>This will ask for a lot of questions, i go for the defaults except when specified below.</p>
<pre class="code"># Country code [1]? 31
# Area code [415]? 10
# Phone number of fax modem [+1.999.555.1212]? +31.10.1234567
# Local identification string (for TSI/CIG) [&quot;NothingSetup&quot;]? fax.cipar.net
# Long distance dialing prefix [1]? 0
# International dialing prefix [011]? 00
# Protection mode for received facsimile [0600]? 0644
# Protection mode for session logs [0600]? 0644
# Protection mode for ttyS0 [0600]? 0666
# Do you want to run faxaddmodem to configure another modem [yes]? no</pre>
<p>
Allow users from our subnet access to the fax service:</p>
<pre class="code">nano /etc/hylafax/hosts.hfaxd</pre>
<p>
on the bottom of the file
</p>
<pre class="code">192\.168\.:::</pre>
<pre class="code">exit
vserver fax restart
vserver fax enter</pre>
<pre class="code">faxstat -a -s</pre>
<p>should show something like this</p>
<pre class="code">HylaFAX scheduler on fax.cipar.net: Running
Modem ttyS0 (+**.**.*******): Running and idle</pre>
<p>
Add a fax user. This will create a user named “user” with userID 101 and no password.
</p>
<pre class="code">faxadduser -u 100 user</pre>
<p>Add an administrator. This will create a user named admin with admin password :</p>
<pre class="code">faxadduser -a password -p password -u 100 admin</pre>
<p>&lt;/div&gt;
</p>
</div>
</div>
<p><!-- end Dokuwiki generated code--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.songshu.org/index.php/hylafax-lenny-vserver/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting High with Lenny</title>
		<link>http://www.songshu.org/index.php/getting-high-with-lenny</link>
		<comments>http://www.songshu.org/index.php/getting-high-with-lenny#comments</comments>
		<pubDate>Sun, 15 Feb 2009 14:22:35 +0000</pubDate>
		<dc:creator>randall</dc:creator>
				<category><![CDATA[Debian Lenny]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[all posts]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[drbd]]></category>
		<category><![CDATA[failover]]></category>
		<category><![CDATA[heartbeat]]></category>
		<category><![CDATA[high availability]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[redundant]]></category>
		<category><![CDATA[vserver]]></category>

		<guid isPermaLink="false">http://www.songshu.org/?p=530</guid>
		<description><![CDATA[&#60;div id=“dw”&#62; Page not found! &#60;/div&#62;]]></description>
			<content:encoded><![CDATA[<p><!-- begin Dokuwiki generated code--></p>
<div class="dokuwiki">
<p>&lt;div id=“dw”&gt;<br />
Page not found!<br />
&lt;/div&gt;
</p>
</div>
<p><!-- end Dokuwiki generated code--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.songshu.org/index.php/getting-high-with-lenny/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>a webcache for the local network</title>
		<link>http://www.songshu.org/index.php/a-webcache-for-the-local-network</link>
		<comments>http://www.songshu.org/index.php/a-webcache-for-the-local-network#comments</comments>
		<pubDate>Sun, 15 Feb 2009 13:01:20 +0000</pubDate>
		<dc:creator>randall</dc:creator>
				<category><![CDATA[Debian Etch]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[all posts]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[etch]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[squid]]></category>
		<category><![CDATA[vserver]]></category>

		<guid isPermaLink="false">http://www.songshu.org/?p=528</guid>
		<description><![CDATA[&#60;div id=“dw”&#62; proxy.cipar.net (192.168.1.14) http://manpages.songshu.org/manpages/lenny/en/man8/squid.8.html a webcache for the local network http://blog.last.fm/2007/08/30/squid-optimization-guide not really sure in how far this optimalisations are optimal for this particulair setting, but it works with or without. and at least for a small office environment i can see no noticable difference with the naked eye. Installation newvserver --vsroot /VSERVERS --hostname proxy --domain cipar.net --ip 192.168.1.14/24 --dist etch --mirror http://192.168.1.12:3142/debian.apt-get.eu/debian --interface dummy0 Your current time zone is set to Unknown Do you want to change that? [n]: Enter for default Enable shadow passwords? &#38;lt;Yes&#38;gt; enter the root password Create a normal user account now? &#38;lt;No&#38;gt; Choose software to install: &#38;lt;Ok&#38;gt; nano /etc/vservers/proxy/apps/init/mark default vserver proxy start vserver proxy enter nano /etc/apt/sources.list deb http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib deb http://192.168.1.12:3142/ftp.nl.debian.org/debian/ etch main contrib non-free apt-get update apt-get upgrade apt-get install squid3 nano /etc/squid3/squid.conf dns_nameservers 192.168.1.17 cache_replacement_policy heap LFUDA memory_replacement_policy heap LFUDA maximum_object_size_in_memory 50 KB cache_mem 100 MB memory_pools off maximum_object_size 50 MB quick_abort_min 0 KB quick_abort_max 0 KB log_icp_queries off client_db off buffered_logs on half_closed_clients off http_port 3128 transparent acl our_networks src 192.168.0.0/24 http_access allow our_networks forwarded_for off /etc/init.d/squid3 restart &#60;/div&#62;]]></description>
			<content:encoded><![CDATA[<p><!-- begin Dokuwiki generated code--></p>
<div class="dokuwiki">
<p>&lt;div id=“dw”&gt;</p>
<h1><a name="proxy.cipar.net_192.168.1.14" id="proxy.cipar.net_192.168.1.14">proxy.cipar.net (192.168.1.14)</a></h1>
<div class="level1">
<p><a href="http://manpages.songshu.org/manpages/lenny/en/man8/squid.8.html" class="urlextern" title="http://manpages.songshu.org/manpages/lenny/en/man8/squid.8.html"  rel="nofollow">http://manpages.songshu.org/manpages/lenny/en/man8/squid.8.html</a>
</p>
<p>
a webcache for the local network<br />
<a href="http://blog.last.fm/2007/08/30/squid-optimization-guide" class="urlextern" title="http://blog.last.fm/2007/08/30/squid-optimization-guide"  rel="nofollow">http://blog.last.fm/2007/08/30/squid-optimization-guide</a> not really sure in how far this optimalisations are optimal for this particulair setting, but it works with or without. and at least for a small office environment i can see no noticable difference with the naked eye.
</p>
</div>
<h4><a name="installation" id="installation">Installation</a></h4>
<div class="level4">
<pre class="code">newvserver --vsroot /VSERVERS --hostname proxy --domain cipar.net --ip 192.168.1.14/24 --dist etch --mirror http://192.168.1.12:3142/debian.apt-get.eu/debian --interface dummy0</pre>
<pre class="code">Your current time zone is set to Unknown
Do you want to change that? [n]:

Enter for default</pre>
<pre class="code"> Enable shadow passwords?
&amp;lt;Yes&amp;gt; </pre>
<pre class="code">enter the root password</pre>
<pre class="code">Create a normal user account now?
 &amp;lt;No&amp;gt;    </pre>
<pre class="code">Choose software to install:
&amp;lt;Ok&amp;gt; </pre>
<pre class="code">nano /etc/vservers/proxy/apps/init/mark
default</pre>
<pre class="code">vserver proxy start
vserver proxy enter</pre>
<pre class="code">nano /etc/apt/sources.list
deb http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib
deb http://192.168.1.12:3142/ftp.nl.debian.org/debian/ etch main contrib non-free</pre>
<pre class="code">apt-get update
apt-get upgrade</pre>
<pre class="code">apt-get install squid3</pre>
<pre class="code">nano /etc/squid3/squid.conf
dns_nameservers 192.168.1.17
cache_replacement_policy heap LFUDA
memory_replacement_policy heap LFUDA
maximum_object_size_in_memory 50 KB
cache_mem 100 MB
memory_pools off
maximum_object_size 50 MB
quick_abort_min 0 KB
quick_abort_max 0 KB
log_icp_queries off
client_db off
buffered_logs on
half_closed_clients off
http_port 3128 transparent
acl our_networks src 192.168.0.0/24
http_access allow our_networks
forwarded_for off</pre>
<pre class="code">/etc/init.d/squid3 restart</pre>
<p>
&lt;/div&gt;
</p>
</div>
</div>
<p><!-- end Dokuwiki generated code--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.songshu.org/index.php/a-webcache-for-the-local-network/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>bind9 in a Vserver</title>
		<link>http://www.songshu.org/index.php/bind9-in-a-vserver</link>
		<comments>http://www.songshu.org/index.php/bind9-in-a-vserver#comments</comments>
		<pubDate>Sun, 15 Feb 2009 12:59:28 +0000</pubDate>
		<dc:creator>randall</dc:creator>
				<category><![CDATA[Debian Etch]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[all posts]]></category>
		<category><![CDATA[bind9]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[etch]]></category>
		<category><![CDATA[vserver]]></category>

		<guid isPermaLink="false">http://www.songshu.org/?p=526</guid>
		<description><![CDATA[&#60;div id=“dw”&#62; ns0.cipar.net (192.168.1.17) This will be the resolving nameserver available to the local network, and the authoritive for the domains. http://www.debian-administration.org/articles/355 Installation newvserver --vsroot /VSERVERS --hostname ns0 --domain cipar.net --ip 192.168.1.17/24 --dist etch --mirror http://192.168.1.12:3142/debian.apt-get.eu/debian --interface dummy0 Your current time zone is set to Unknown Do you want to change that? [n]: Enter for default Enable shadow passwords? &#38;lt;Yes&#38;gt; enter the root password Create a normal user account now? &#38;lt;No&#38;gt; Choose software to install: &#38;lt;Ok&#38;gt; some problems with bind9 in a vserver can be solved by setting the CAPS nano /etc/vservers/ns0/bcapabilities CAP_SYS_RESOURCE vserver ns0 start vserver ns0 enter nano /etc/apt/sources.list deb http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib deb http://192.168.1.12:3142/ftp.nl.debian.org/debian/ etch main contrib non-free apt-get update apt-get upgrade http://manpages.songshu.org/manpages/lenny/en/man8/named.8.html apt-get install bind9 dnsutils To set up the external part we do as follows: nano /etc/bind/named.conf.local // // Do any local configuration here // // Consider adding the 1918 zones here, if they are not used in your // organization //include &#34;/etc/bind/zones.rfc1918&#34;; acl internals { 127.0.0.0/8; 192.168.1.0/24; 192.168.0.0/24; }; //acl slaves { // 195.234.42.0/24; // XName // 193.218.105.144/28; // XName // 193.24.212.232/29; // XName //}; view &#34;internal&#34; { match-clients { internals; }; recursion yes; zone &#34;cipar.net&#34; { type master; file &#34;/etc/bind/db.cipar.net&#34;; }; // [...]]]></description>
			<content:encoded><![CDATA[<p><!-- begin Dokuwiki generated code--></p>
<div class="dokuwiki">
<p>&lt;div id=“dw”&gt;</p>
<h1><a name="ns0.cipar.net_192.168.1.17" id="ns0.cipar.net_192.168.1.17">ns0.cipar.net (192.168.1.17)</a></h1>
<div class="level1">
<p>
This will be the resolving nameserver available to the local network, and the authoritive for the domains.<br />
<a href="http://www.debian-administration.org/articles/355" class="urlextern" title="http://www.debian-administration.org/articles/355"  rel="nofollow">http://www.debian-administration.org/articles/355</a>
</p>
</div>
<h4><a name="installation" id="installation">Installation</a></h4>
<div class="level4">
<pre class="code">newvserver --vsroot /VSERVERS --hostname ns0 --domain cipar.net --ip 192.168.1.17/24 --dist etch --mirror http://192.168.1.12:3142/debian.apt-get.eu/debian  --interface dummy0 </pre>
<pre class="code">Your current time zone is set to Unknown
Do you want to change that? [n]:

Enter for default</pre>
<pre class="code"> Enable shadow passwords?
&amp;lt;Yes&amp;gt; </pre>
<pre class="code">enter the root password</pre>
<pre class="code">Create a normal user account now?
 &amp;lt;No&amp;gt;    </pre>
<pre class="code">Choose software to install:
&amp;lt;Ok&amp;gt; </pre>
<p>
some problems with bind9 in a vserver can be solved by setting the CAPS
</p>
<pre class="code">nano /etc/vservers/ns0/bcapabilities
CAP_SYS_RESOURCE</pre>
<pre class="code">vserver ns0 start
vserver ns0 enter</pre>
<pre class="code">nano /etc/apt/sources.list
deb http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib
deb http://192.168.1.12:3142/ftp.nl.debian.org/debian/ etch main contrib non-free</pre>
<pre class="code">apt-get update
apt-get upgrade</pre>
<p>
<a href="http://manpages.songshu.org/manpages/lenny/en/man8/named.8.html" class="urlextern" title="http://manpages.songshu.org/manpages/lenny/en/man8/named.8.html"  rel="nofollow">http://manpages.songshu.org/manpages/lenny/en/man8/named.8.html</a>
</p>
<pre class="code">apt-get install bind9 dnsutils</pre>
<p>
To set up the external part we do as follows:</p>
<pre class="code">nano /etc/bind/named.conf.local
//
// Do any local configuration here
//

// Consider adding the 1918 zones here, if they are not used in your
// organization
//include &quot;/etc/bind/zones.rfc1918&quot;;
acl internals {
    127.0.0.0/8;
    192.168.1.0/24;
    192.168.0.0/24;
};
//acl slaves {
//    195.234.42.0/24;    // XName
//    193.218.105.144/28; // XName
//    193.24.212.232/29;  // XName
//};

view &quot;internal&quot; {
    match-clients { internals; };
        recursion yes;
        zone &quot;cipar.net&quot; {
        type master;
        file &quot;/etc/bind/db.cipar.net&quot;;
        };
// prime the server with knowledge of the root servers
zone &quot;.&quot; {
        type hint;
        file &quot;/etc/bind/db.root&quot;;
        };

// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912

        zone &quot;localhost&quot; {
        type master;
        file &quot;/etc/bind/db.local&quot;;
        };

        zone &quot;127.in-addr.arpa&quot; {
        type master;
        file &quot;/etc/bind/db.127&quot;;
        };

        zone &quot;0.in-addr.arpa&quot; {
        type master;
        file &quot;/etc/bind/db.0&quot;;
        };
        zone &quot;255.in-addr.arpa&quot; {
        type master;
        file &quot;/etc/bind/db.255&quot;;
        };
};

//view &quot;external&quot; {
//    match-clients { any; };
//    recursion no;
//    zone &quot;songshu.org&quot; {
//    type master;
//    file &quot;/etc/bind/external/db.songshu.org&quot;;
//    allow-transfer { slaves; };
//};
</pre>
<pre class="code">nano /etc/bind/db.example.com
; example.com
$TTL    604800
@       IN      SOA     ns1.example.com. root.example.com. (
                     2006020201 ; Serial
                         604800 ; Refresh
                          86400 ; Retry
                        2419200 ; Expire
                         604800); Negative Cache TTL
;
@       IN      NS      ns1
        IN      MX      10 mail
        IN      A       192.0.2.1
ns1     IN      A       192.0.2.1
mail    IN      A       192.0.2.128 ; We have our mail server somewhere else.
www     IN      A       192.0.2.1
client1 IN      A       192.0.2.201 ; We connect to client1 very often.</pre>
<p>
&lt;/div&gt;
</p>
</div>
</div>
<p><!-- end Dokuwiki generated code--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.songshu.org/index.php/bind9-in-a-vserver/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>setup a debian apt-mirror</title>
		<link>http://www.songshu.org/index.php/setup-a-debian-apt-mirror</link>
		<comments>http://www.songshu.org/index.php/setup-a-debian-apt-mirror#comments</comments>
		<pubDate>Sun, 15 Feb 2009 12:58:12 +0000</pubDate>
		<dc:creator>randall</dc:creator>
				<category><![CDATA[Debian Etch]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[all posts]]></category>
		<category><![CDATA[apt-mirror]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[etch]]></category>

		<guid isPermaLink="false">http://www.songshu.org/?p=524</guid>
		<description><![CDATA[&#60;div id=“dw”&#62; mirror.cipar.net (192.168.1.18) http://manpages.songshu.org/manpages/lenny/en/man1/apt-mirror.1.html a local mirror for debian and ubuntu Installation newvserver --vsroot /VSERVERS --hostname mirror --domain cipar.net --ip 192.168.1.18/24 --dist etch --mirror http://192.168.1.12:3142/debian.apt-get.eu/debian --interface dummy0 Your current time zone is set to Unknown Do you want to change that? [n]: Enter for default Enable shadow passwords? &#38;lt;Yes&#38;gt; enter the root password Create a normal user account now? &#38;lt;No&#38;gt; Choose software to install: &#38;lt;Ok&#38;gt; nano /etc/vservers/mirror/apps/init/mark default vserver mirror start vserver mirror enter nano /etc/apt/sources.list deb http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib deb http://192.168.1.12:3142/ftp.nl.debian.org/debian/ etch main contrib non-free apt-get update apt-get upgrade apt-get install apt-mirror apache2 nano /etc/apt/mirror.list # apt-mirror configuration file ## ## The default configuration options (uncomment and change to override) ## # # set base_path /var/spool/apt-mirror # set mirror_path $base_path/mirror # set skel_path $base_path/skel # set var_path $base_path/var # # set defaultarch # set nthreads 20 # ## ## Example sources ## # etch section deb-amd64 http://ftp.nl.debian.org/debian etch main contrib non-free deb-amd64 http://security.debian.org/ etch/updates main contrib non-free # Ubuntu Hardy Heron deb-i386 http://archive.ubuntu.com/ubuntu/ hardy main restricted universe multiverse deb-i386 http://security.ubuntu.com/ubuntu hardy-security main restricted universe multiverse deb-i386 http://archive.ubuntu.com/ubuntu/ hardy-updates main restricted universe multiverse deb-i386 http://packages.medibuntu.org/ hardy free non-free ## ## Cleaner configuration example ## # # set cleanscript [...]]]></description>
			<content:encoded><![CDATA[<p><!-- begin Dokuwiki generated code--></p>
<div class="dokuwiki">
<p>&lt;div id=“dw”&gt;</p>
<h1><a name="mirror.cipar.net_192.168.1.18" id="mirror.cipar.net_192.168.1.18">mirror.cipar.net (192.168.1.18)</a></h1>
<div class="level1">
<p><a href="http://manpages.songshu.org/manpages/lenny/en/man1/apt-mirror.1.html" class="urlextern" title="http://manpages.songshu.org/manpages/lenny/en/man1/apt-mirror.1.html"  rel="nofollow">http://manpages.songshu.org/manpages/lenny/en/man1/apt-mirror.1.html</a>
</p>
<p>
a local mirror for debian and ubuntu
</p>
</div>
<h4><a name="installation" id="installation">Installation</a></h4>
<div class="level4">
<pre class="code">newvserver --vsroot /VSERVERS --hostname mirror --domain cipar.net --ip 192.168.1.18/24 --dist etch --mirror http://192.168.1.12:3142/debian.apt-get.eu/debian  --interface dummy0 </pre>
<pre class="code">Your current time zone is set to Unknown
Do you want to change that? [n]:

Enter for default</pre>
<pre class="code"> Enable shadow passwords?
&amp;lt;Yes&amp;gt; </pre>
<pre class="code">enter the root password</pre>
<pre class="code">Create a normal user account now?
 &amp;lt;No&amp;gt;    </pre>
<pre class="code">Choose software to install:
&amp;lt;Ok&amp;gt; </pre>
<pre class="code">nano /etc/vservers/mirror/apps/init/mark
default</pre>
<pre class="code">vserver mirror start
vserver mirror enter</pre>
<pre class="code">nano /etc/apt/sources.list
deb http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib
deb http://192.168.1.12:3142/ftp.nl.debian.org/debian/ etch main contrib non-free</pre>
<pre class="code">apt-get update
apt-get upgrade</pre>
<pre class="code">apt-get install apt-mirror apache2</pre>
<pre class="code">nano /etc/apt/mirror.list
# apt-mirror configuration file

##
## The default configuration options (uncomment and change to override)
##
#
# set base_path    /var/spool/apt-mirror
# set mirror_path  $base_path/mirror
# set skel_path    $base_path/skel
# set var_path     $base_path/var
#
# set defaultarch
# set nthreads     20
#

##
## Example sources
##

# etch section
deb-amd64 http://ftp.nl.debian.org/debian etch main contrib non-free
deb-amd64 http://security.debian.org/ etch/updates main contrib non-free

# Ubuntu Hardy Heron
deb-i386 http://archive.ubuntu.com/ubuntu/ hardy main restricted universe multiverse
deb-i386 http://security.ubuntu.com/ubuntu hardy-security main restricted universe multiverse
deb-i386 http://archive.ubuntu.com/ubuntu/ hardy-updates main restricted universe multiverse
deb-i386 http://packages.medibuntu.org/ hardy free non-free

##
## Cleaner configuration example
##
#
# set cleanscript $var_path/clean.sh
#

# Cleaning section
clean http://ftp.nl.debian.org/
clean http://security.debian.org/
clean http://archive.ubuntu.com/
clean http://packages.medibuntu.org/
</pre>
<pre class="code">su - apt-mirror -c apt-mirror</pre>
<pre class="code">nano /etc/cron.d/apt-mirror
#
# Regular cron jobs for the apt-mirror package
#
0 23    * * 6   apt-mirror      /usr/bin/apt-mirror &amp;gt; /var/spool/apt-mirror/var/cron.log</pre>
<p>
&lt;/div&gt;
</p>
</div>
</div>
<p><!-- end Dokuwiki generated code--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.songshu.org/index.php/setup-a-debian-apt-mirror/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>zimbra in a linux Vserver</title>
		<link>http://www.songshu.org/index.php/zimbra-in-a-linux-vserver</link>
		<comments>http://www.songshu.org/index.php/zimbra-in-a-linux-vserver#comments</comments>
		<pubDate>Sun, 15 Feb 2009 12:56:34 +0000</pubDate>
		<dc:creator>randall</dc:creator>
				<category><![CDATA[Debian Etch]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[all posts]]></category>
		<category><![CDATA[zimbra]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[etch]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[vserver]]></category>

		<guid isPermaLink="false">http://www.songshu.org/?p=522</guid>
		<description><![CDATA[&#60;div id=“dw”&#62; mailro.songshu.org (192.168.1.86) Installation newvserver --vsroot /VSERVERS --hostname mailro --domain songshu.org --ip 192.168.1.86/24 --dist etch --arch i386 --mirror http://192.168.1.12:3142/debian.apt-get.eu/debian --interface dummy0 Your current time zone is set to Unknown Do you want to change that? [n]: Enter for default Enable shadow passwords? &#38;lt;Yes&#38;gt; enter the root password Create a normal user account now? &#38;lt;No&#38;gt; Choose software to install: &#38;lt;Ok&#38;gt; Change the size of /tmp from 16m to 128m nano /etc/vservers/mailro/fstab none /proc proc defaults 0 0 none /tmp tmpfs size=128m,mode=1777 0 0 none /dev/pts devpts gid=5,mode=620 0 0 vserver mailro start vserver mailro enter nano /etc/apt/sources.list deb http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib deb http://192.168.1.12:3142/ftp.nl.debian.org/debian/ etch main contrib non-free apt-get update apt-get upgrade apt-get install libgetopt-mixed-perl file libc6-i686 sudo libidn11 curl fetchmail libgmp3c2 libxml2 libstdc++6 openssl libexpat1 libpcre3 libltdl3 libtie-ixhash-perl libperl5.8 ssh cd /usr/src wget http://h.yimg.com/lo/downloads/5.0.9_GA/zcs-5.0.9_GA_2533.DEBIAN4.0.20080815215219.tgz tar xvfz zcs-5.0.9_GA_2533.DEBIAN4.0.20080815215219.tgz cd zcs-5.0.9_GA_2533.DEBIAN4.0.20080815215219 We made a 32bit server on a 64bit host and install the 32bit zimbra version, nevertheless we need to override or the installer will refuse ./install.sh --platform-override Press Return to continue Install zimbra-ldap [Y] y Install zimbra-logger [Y] y Install zimbra-mta [Y] y Install zimbra-snmp [Y] y Install zimbra-store [Y] y Install zimbra-apache [Y] y Install zimbra-spell [Y] y Install [...]]]></description>
			<content:encoded><![CDATA[<p><!-- begin Dokuwiki generated code--></p>
<div class="dokuwiki">
<p>&lt;div id=“dw”&gt;</p>
<h1><a name="mailro.songshu.org_192.168.1.86" id="mailro.songshu.org_192.168.1.86">mailro.songshu.org (192.168.1.86)</a></h1>
<div class="level1">
</div>
<h4><a name="installation" id="installation">Installation</a></h4>
<div class="level4">
<pre class="code">newvserver --vsroot /VSERVERS --hostname mailro --domain songshu.org --ip 192.168.1.86/24 --dist etch --arch i386 --mirror http://192.168.1.12:3142/debian.apt-get.eu/debian  --interface dummy0 </pre>
<pre class="code">Your current time zone is set to Unknown
Do you want to change that? [n]:

Enter for default</pre>
<pre class="code"> Enable shadow passwords?
&amp;lt;Yes&amp;gt; </pre>
<pre class="code">enter the root password</pre>
<pre class="code">Create a normal user account now?
 &amp;lt;No&amp;gt;    </pre>
<pre class="code">Choose software to install:
&amp;lt;Ok&amp;gt; </pre>
<p>
Change the size of /tmp from 16m to 128m</p>
<pre class="code">nano /etc/vservers/mailro/fstab
none    /proc           proc    defaults                0 0
none    /tmp            tmpfs   size=128m,mode=1777     0 0
none    /dev/pts        devpts  gid=5,mode=620          0 0</pre>
<pre class="code">vserver mailro start
vserver mailro enter</pre>
<pre class="code">nano /etc/apt/sources.list
deb http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib
deb http://192.168.1.12:3142/ftp.nl.debian.org/debian/ etch main contrib non-free</pre>
<pre class="code">apt-get update
apt-get upgrade</pre>
<pre class="code">apt-get install libgetopt-mixed-perl file libc6-i686 sudo libidn11 curl fetchmail libgmp3c2 libxml2 libstdc++6 openssl libexpat1 libpcre3 libltdl3 libtie-ixhash-perl libperl5.8 ssh</pre>
<pre class="code">cd /usr/src
wget http://h.yimg.com/lo/downloads/5.0.9_GA/zcs-5.0.9_GA_2533.DEBIAN4.0.20080815215219.tgz</pre>
<pre class="code">tar xvfz zcs-5.0.9_GA_2533.DEBIAN4.0.20080815215219.tgz
cd zcs-5.0.9_GA_2533.DEBIAN4.0.20080815215219</pre>
<p>We made a 32bit server on a 64bit host and install the 32bit zimbra version, nevertheless we need to override or the installer will refuse</p>
<pre class="code">./install.sh --platform-override</pre>
<p>
Press Return to continue</p>
<pre class="code">Install zimbra-ldap [Y] y
Install zimbra-logger [Y] y
Install zimbra-mta [Y] y
Install zimbra-snmp [Y] y
Install zimbra-store [Y] y
Install zimbra-apache [Y] y
Install zimbra-spell [Y] y
Install zimbra-proxy [N] n</pre>
<pre class="code">This platform is DEBIAN4.0_64
Packages found: DEBIAN4.0

Install anyway? [N] Y</pre>
<pre class="code">The system will be modified.  Continue? [N] Y</pre>
<pre class="code">DNS ERROR resolving MX for mailro.songshu.org
It is suggested that the domain name have an MX record configured in DNS
Change domain name? [Yes] No</pre>
<pre class="code">Address unconfigured (**) items  (? - help) 3
Select, or &#039;r&#039; for previous menu [r] 4
set the password *******
*** CONFIGURATION COMPLETE - press &#039;a&#039; to apply
Select from menu, or press &#039;a&#039; to apply config (? - help) a
Save configuration data to a file? [Yes] yes
Save config in file: [/opt/zimbra/config.19658]
The system will be modified - continue? [No] Yes
Notify Zimbra of your installation? [Yes] no</pre>
<p>
The installation should be done by now, we still need to do some modification for the Vserver to listen to its RFC 1918 IP instead of 127.0.0.1
</p>
<pre class="code">cd /opt/zimbra/conf &amp;amp;&amp;amp; mkdir bak new &amp;amp;&amp;amp; cp * bak &amp;amp;&amp;amp; for i in *; do sed &#039;s/127\.0\.0\.1/192.168.1.86/g&#039;  $i &amp;gt; new/$i; done &amp;amp;&amp;amp; mv new/* . &amp;amp;&amp;amp; rmdir new</pre>
<pre class="code">su zimbra</pre>
<pre class="code">zmprov modifyServer mailro.songshu.org zimbraMtaMyNetworks &#039;10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12,  192.168.1.86&#039;</pre>
<pre class="code">exit</pre>
<pre class="code">nano /opt/zimbra/postfix/conf/master.cf
192.168.1.86:10025 inet n  -       n       -       -  smtpd
 -o mynetworks=127.0.0.1/8,192.168.1.86</pre>
<pre class="code">nano /opt/zimbra/amavisd/sbin/amavisd
@inet_acl   = qw( 127.0.0.1 192.168.1.86 [::1] );  # allow SMTP access only from localhost
$inet_socket_bind = &#039;192.168.1.86&#039;;  # limit socket bind to loopback interface
$notify_method  = &#039;smtp:[192.168.1.86]:10025&#039;;
$forward_method = &#039;smtp:[192.168.1.86]:10025&#039;;</pre>
<pre class="code">nano /opt/zimbra/conf/amavisd.conf
$archive_quarantine_method = &#039;smtp:[192.168.1.86]:10025&#039;;
\&amp;amp;ask_daemon, [&quot;CONTSCAN {}\n&quot;, &#039;192.168.1.86:3310&#039;],</pre>
<pre class="code">nano /opt/zimbra/conf/dspam.conf
LocalMX 192.168.1.86</pre>
<p>
<a href="http://www.songshu.org/wp-content/plugins/wp-dokuwiki/lib/exe/fetch.php?id=&amp;cache=cache&amp;media=page_funambol.cipar.net_firstseconly_footer" class="media mediafile mf_" title="page_funambol.cipar.net_firstseconly_footer">page_funambol.cipar.net_firstseconly_footer</a><br />
&lt;/div&gt;
</p>
</div>
</div>
<p><!-- end Dokuwiki generated code--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.songshu.org/index.php/zimbra-in-a-linux-vserver/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sync zimbra contacts with funambol</title>
		<link>http://www.songshu.org/index.php/sync-zimbra-contacts-with-funambol</link>
		<comments>http://www.songshu.org/index.php/sync-zimbra-contacts-with-funambol#comments</comments>
		<pubDate>Sun, 15 Feb 2009 12:52:54 +0000</pubDate>
		<dc:creator>randall</dc:creator>
				<category><![CDATA[Debian Etch]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[all posts]]></category>
		<category><![CDATA[zimbra]]></category>
		<category><![CDATA[adressbook]]></category>
		<category><![CDATA[contacts]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[etch]]></category>
		<category><![CDATA[funambol]]></category>
		<category><![CDATA[sync]]></category>
		<category><![CDATA[vserver]]></category>

		<guid isPermaLink="false">http://www.songshu.org/?p=520</guid>
		<description><![CDATA[&#60;div id=“dw”&#62; Funambol Lets try to hook up funambol.cipar.net with the zimbra installation at mailro.songshu.org so that we can sync the calendars and contact lists with e-mail clients like thunderbird and mobile devices blackberrys and such. Installation you can get it to run on 64bit i guess but you will have to change some paths for java, well not really in to the effort right now so i&#039;ll install the 32 bit OS this time. newvserver --vsroot /VSERVERS --hostname funambol --domain cipar.net --ip 192.168.1.18/24 --dist etch --arch i386 --mirror http://192.168.1.12:3142/debian.apt-get.eu/debian --interface dummy0 Your current time zone is set to Unknown Do you want to change that? [n]: Enter for default Enable shadow passwords? &#38;lt;Yes&#38;gt; enter the root password Create a normal user account now? &#38;lt;No&#38;gt; Choose software to install: &#38;lt;Ok&#38;gt; vserver funambol start vserver funambol enter nano /etc/apt/sources.list deb http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib deb http://192.168.1.12:3142/ftp.nl.debian.org/debian/ etch main contrib non-free apt-get update apt-get upgrade cd /usr/src/ wget http://download.forge.objectweb.org/sync4j/funambol-7.0.6.bin sh funambol-7.0.6.bin and prepare for a long scroll. Do you agree to the above license terms? [yes or no] yes /opt always seems to be a nice place Directory to extract Funambol [/opt] &#38;lt;return to accept&#38;gt;? Do you want to start the server? [...]]]></description>
			<content:encoded><![CDATA[<p><!-- begin Dokuwiki generated code--></p>
<div class="dokuwiki">
<p>&lt;div id=“dw”&gt;</p>
<h1><a name="funambol" id="funambol">Funambol</a></h1>
<div class="level1">
<p>Lets try to hook up funambol.cipar.net with the zimbra installation at mailro.songshu.org so that we can sync the calendars and contact lists with e-mail clients like thunderbird and mobile devices blackberrys and such.
</p>
</div>
<h4><a name="installation" id="installation">Installation</a></h4>
<div class="level4">
<p>you can get it to run on 64bit i guess but you will have to change some paths for java, well not really in to the effort right now so i&#039;ll install the 32 bit <acronym title="Operating System">OS</acronym> this time.</p>
<pre class="code">newvserver --vsroot /VSERVERS --hostname funambol --domain cipar.net --ip 192.168.1.18/24 --dist etch --arch i386 --mirror http://192.168.1.12:3142/debian.apt-get.eu/debian --interface dummy0</pre>
<pre class="code">Your current time zone is set to Unknown
Do you want to change that? [n]:

Enter for default</pre>
<pre class="code"> Enable shadow passwords?
&amp;lt;Yes&amp;gt; </pre>
<pre class="code">enter the root password</pre>
<pre class="code">Create a normal user account now?
 &amp;lt;No&amp;gt;    </pre>
<pre class="code">Choose software to install:
&amp;lt;Ok&amp;gt; </pre>
<pre class="code">vserver funambol start
vserver funambol enter</pre>
<pre class="code">nano /etc/apt/sources.list
deb http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib
deb http://192.168.1.12:3142/ftp.nl.debian.org/debian/ etch main contrib non-free</pre>
<pre class="code">apt-get update
apt-get upgrade</pre>
<pre class="code">cd /usr/src/</pre>
<pre class="code">wget http://download.forge.objectweb.org/sync4j/funambol-7.0.6.bin</pre>
<pre class="code">sh funambol-7.0.6.bin</pre>
<p>and prepare for a long scroll.
</p>
<pre class="code">Do you agree to the above license terms? [yes or no]
yes</pre>
<p>/opt always seems to be a nice place</p>
<pre class="code">Directory to extract Funambol [/opt] &amp;lt;return to accept&amp;gt;? </pre>
<pre class="code">Do you want to start the server? [yes or no]
yes</pre>
<pre class="code">cp /opt/Funambol/bin/funambol /etc/init.d/</pre>
<pre class="code">ln -s /etc/init.d/funambol /etc/rc3.d/S30funambol</pre>
<pre class="code">nano /etc/init.d/funambol</pre>
<p>change funambol home to the following</p>
<pre class="code">FUNAMBOL_HOME=`(cd /opt/Funambol ; pwd)</pre>
<pre class="code">cd /usr/src</pre>
<pre class="code">wget http://downloads.sourceforge.net/zimbrafunambol/ZimbraConnector_0.5.01.s4j?modtime=1219875982&amp;amp;big_mirror=0</pre>
<pre class="code">cp ZimbraConnector_0.5.01.s4j ZimbraConnector.s4j</pre>
<pre class="code">cp ZimbraConnector.s4j /opt/Funambol/ds-server/modules</pre>
<pre class="code">mkdir /opt/Funambol/config/connector</pre>
<pre class="code">nano /opt/Funambol/config/connector/ZimbraConnector.xml</pre>
<pre class="code">&amp;lt;java version=&quot;1.5.0&quot; class=&quot;java.beans.XMLDecoder&quot;&amp;gt;
&amp;lt;object class=&quot;ru.korusconsulting.connector.config.ConnectorConfig&quot;&amp;gt;
  &amp;lt;void property=&quot;dataSource&quot;&amp;gt;
    &amp;lt;string&amp;gt;jdbc/fnblds&amp;lt;/string&amp;gt; &lt;!--The funambol datasource--&gt;
  &amp;lt;/void&amp;gt;
&amp;lt;/object&amp;gt;
&amp;lt;/java&amp;gt;</pre>
<pre class="code">nano /opt/Funambol/ds-server/install.properties</pre>
<p>and add our module to the modules to install</p>
<pre class="code">ZimbraConnector</pre>
<pre class="code">/opt/Funambol/bin/install-modules</pre>
<p>This will ask you to install the modules listed in install.properties.
</p>
<p>
We&#039;re not running funambol on a desktop machine so do the basic install on your desktop client and issue.</p>
<pre class="code">/opt/Funambol/admin/bin/funamboladmin</pre>
<p>to start the admin tool and login to 192.168.1.18.
</p>
<p>
In the admin tool remove the following items</p>
<pre class="code">PIM Calendar SyncSource -- cal; event; scal; stask; task

PIM Contact SyncSource  -- card; scard</pre>
<p>
add new SyncSources to FunambolZimbraConnector.<br />
Modules &gt; zimbra &gt; FunambolZimbraConnector&gt;CalendarSyncSource</p>
<pre class="code">Source URI    = cal,event,scal,stask,task

Name          = cal,event,scal,stask,task

Zimbra URL    = http://mailro.songshu.org/service/soap/
</pre>
<p>
Modules &gt; zimbra &gt; FunambolZimbraConnector&gt;ContactSyncSource</p>
<pre class="code">Source URI    = card, scard

Name          = card, scard

Zimbra URL    = http://mailro.songshu.org/service/soap/
</pre>
<p>
done.<br />
&lt;/div&gt;
</p>
</div>
</div>
<p><!-- end Dokuwiki generated code--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.songshu.org/index.php/sync-zimbra-contacts-with-funambol/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>avantfax on debian</title>
		<link>http://www.songshu.org/index.php/avantfax-on-debian</link>
		<comments>http://www.songshu.org/index.php/avantfax-on-debian#comments</comments>
		<pubDate>Sun, 15 Feb 2009 12:50:33 +0000</pubDate>
		<dc:creator>randall</dc:creator>
				<category><![CDATA[Debian Etch]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[all posts]]></category>
		<category><![CDATA[avantfax]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[etch]]></category>
		<category><![CDATA[hylafax]]></category>
		<category><![CDATA[vserver]]></category>

		<guid isPermaLink="false">http://www.songshu.org/?p=518</guid>
		<description><![CDATA[&#60;div id=“dw”&#62; fax.cipar.net (192.168.1.10) The hylafax server receives and sends faxes and is accessible via Avantfax on http://192.168.1.10 THE AVANTFAX PART OF THIS THIS PAGE IS OUTDATEd by the avantfax debian.sh script which does basically all the avantfax install below but i keep this page for reference and posterity installation newvserver --vsroot /VSERVERS --hostname fax --domain cipar.net --ip 192.168.1.10/24 --dist etch --mirror http://192.168.1.12:3142/debian.apt-get.eu/debian --interface dummy0 # cd /usr/local/sbin # ./set-context.sh fax vserver fax start vserver fax enter locale-gen # nano /etc/apt/sources.list deb http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib deb-src http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib deb http://192.168.1.12:3142/debian.apt-get.eu/debian/ etch main contrib non-free # apt-get update HylaFAX http://manpages.songshu.org/manpages/lenny/en/man5/hylafax-server.5.html http://www.howtoforge.com/build-a-hylafax-server-with-avantfax-on-debian-etch http://www.lucasmanual.com/mywiki/FaxServer http://www.avantfax.com/install.php # apt-get install postfix chhose No configuration # nano /etc/aliases and add the following root: randall@smydomain # newaliases # apt-get install hylafax-server # exit # cp -a /dev/ttyS0 /VSERVERS/fax/dev/ttyS0 # cp -aR /dev/null /VSERVERS/fax/var/spool/hylafax/dev # vserver fax enter # faxsetup enter for the defaults until the country code # Country code [1]? 31 # Area code [415]? 10 # Phone number of fax modem [+1.999.555.1212]? +31.10.1234567 # Local identification string (for TSI/CIG) [&#34;NothingSetup&#34;]? fax.cipar.net # Long distance dialing prefix [1]? 0 # International dialing prefix [011]? 00 # Protection mode for received facsimile [0600]? 0644 [...]]]></description>
			<content:encoded><![CDATA[<p><!-- begin Dokuwiki generated code--></p>
<div class="dokuwiki">
<p>&lt;div id=“dw”&gt;</p>
<h1><a name="fax.cipar.net_192.168.1.10" id="fax.cipar.net_192.168.1.10">fax.cipar.net (192.168.1.10)</a></h1>
<div class="level1">
<p>The hylafax server receives and sends faxes and is accessible via Avantfax on <a href="http://192.168.1.10" class="urlextern" title="http://192.168.1.10"  rel="nofollow">http://192.168.1.10</a>
</p>
</div>
<h3><a name="the_avantfax_part_of_this_this_page_is_outdated_by_the_avantfax_debian.sh_script_which_does_basically_all_the_avantfax_install_below_but_i_keep_this_page_for_reference_and_posterity" id="the_avantfax_part_of_this_this_page_is_outdated_by_the_avantfax_debian.sh_script_which_does_basically_all_the_avantfax_install_below_but_i_keep_this_page_for_reference_and_posterity">THE AVANTFAX PART OF THIS THIS PAGE IS OUTDATEd by the avantfax debian.sh script which does basically all the avantfax install below but i keep this page for reference and posterity</a></h3>
<div class="level3">
</div>
<h3><a name="installation" id="installation">installation</a></h3>
<div class="level3">
<pre class="code">newvserver --vsroot /VSERVERS --hostname fax --domain cipar.net --ip 192.168.1.10/24 --dist etch --mirror http://192.168.1.12:3142/debian.apt-get.eu/debian --interface dummy0</pre>
<pre class="code"># cd /usr/local/sbin
# ./set-context.sh fax</pre>
<pre class="code">vserver fax start
vserver fax enter
locale-gen</pre>
<pre class="code"># nano /etc/apt/sources.list</pre>
<pre class="code">deb http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib
deb-src http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib
deb http://192.168.1.12:3142/debian.apt-get.eu/debian/ etch main contrib non-free</pre>
<pre class="code"># apt-get update
</pre>
</div>
<h3><a name="hylafax" id="hylafax">HylaFAX</a></h3>
<div class="level3">
<p><a href="http://manpages.songshu.org/manpages/lenny/en/man5/hylafax-server.5.html" class="urlextern" title="http://manpages.songshu.org/manpages/lenny/en/man5/hylafax-server.5.html"  rel="nofollow">http://manpages.songshu.org/manpages/lenny/en/man5/hylafax-server.5.html</a>
</p>
<p>
<a href="http://www.howtoforge.com/build-a-hylafax-server-with-avantfax-on-debian-etch" class="urlextern" title="http://www.howtoforge.com/build-a-hylafax-server-with-avantfax-on-debian-etch"  rel="nofollow">http://www.howtoforge.com/build-a-hylafax-server-with-avantfax-on-debian-etch</a><br />
<a href="http://www.lucasmanual.com/mywiki/FaxServer" class="urlextern" title="http://www.lucasmanual.com/mywiki/FaxServer"  rel="nofollow">http://www.lucasmanual.com/mywiki/FaxServer</a><br />
<a href="http://www.avantfax.com/install.php" class="urlextern" title="http://www.avantfax.com/install.php"  rel="nofollow">http://www.avantfax.com/install.php</a></p>
<pre class="code"># apt-get install postfix</pre>
<pre class="code">chhose No configuration</pre>
<pre class="code"># nano /etc/aliases</pre>
<p>and add the following</p>
<pre class="code">root:   randall@smydomain</pre>
<pre class="code"># newaliases</pre>
<pre class="code"># apt-get install hylafax-server</pre>
<pre class="code"># exit
# cp -a /dev/ttyS0 /VSERVERS/fax/dev/ttyS0
# cp -aR /dev/null /VSERVERS/fax/var/spool/hylafax/dev
# vserver fax enter</pre>
<pre class="code"># faxsetup
enter for the defaults until the country code</pre>
<pre class="code"># Country code [1]? 31
# Area code [415]? 10
# Phone number of fax modem [+1.999.555.1212]? +31.10.1234567
# Local identification string (for TSI/CIG) [&quot;NothingSetup&quot;]? fax.cipar.net
# Long distance dialing prefix [1]? 0
# International dialing prefix [011]? 00
# Protection mode for received facsimile [0600]? 0644
# Protection mode for session logs [0600]? 0644
# Protection mode for ttyS0 [0600]? 0666</pre>
<p>
Allow users from our subnet access to the fax service:</p>
<pre class="code"># nano /etc/hylafax/hosts.hfaxd</pre>
<p>
on the bottom of the file
</p>
<pre class="code">192\.168\.:::</pre>
<pre class="code"># exit
# vserver fax restart
# vserver fax enter</pre>
<pre class="code">faxstat -a -s</pre>
<p>should show something like this</p>
<pre class="code">HylaFAX scheduler on fax.cipar.net: Running
Modem ttyS0 (+**.**.*******): Running and idle</pre>
<p>
Add a fax user. This will create a user named “user” with userID 101 and no password.
</p>
<pre class="code"># faxadduser -u 100 user</pre>
<p>Add an administrator. This will create a user named admin with admin password &lt;password&gt;:</p>
<pre class="code"># faxadduser -a &amp;lt;password&amp;gt; -p &amp;lt;password&amp;gt; -u 100 admin</pre>
</div>
<h3><a name="avantfax" id="avantfax">AvantFax</a></h3>
<div class="level3">
<p>
<em>Below seems largely to be not needed anymore!!!!!!! There is a debian-install.sh now that seems to do basically all below automatically, i have tried it and it worked, even the “rotate” option for the faxes work now without a problem.<br />
The script was not perfect yet since some steps needed to be repeated after the script manually.<br />
Manually repeat this steps from the script:</em></p>
<pre class="code">/usr/sbin/faxadduser -f newhosts -a pwd www-data
/usr/sbin/faxdeluser localhost
/usr/sbin/faxdeluser 127.0.0.1
echo 127.0.0.1 &amp;gt;&amp;gt; newhosts
cat /etc/hylafax/hosts.hfaxd &amp;gt;&amp;gt; newhosts
cat newhosts &amp;gt; /etc/hylafax/hosts.hfaxd
rm -f newhosts
reboot the server</pre>
<p>
first we install all the needed dependencies</p>
<pre class="code"># apt-get install apache2-mpm-prefork apache2-utils apache2.2-common libapache2-mod-php5 php5 php-pear php5-mysql php5-pgsql php5-cli php5-cgi mysql-server netpbm php5-imagick dh-make-php libmagic-dev libungif4g libpng3 sudo libtiff4-dev gs-gpl gsfonts expect php5-dev make php-pear psutils libnetpbm10-dev libungif-bin libungif4-dev php-db php-file php-http php-mail php-mail-mime php-net-smtp php-net-socket php-xml-parser wdiff
</pre>
<p>
And the avantfax itself</p>
<pre class="code"># cd /usr/src
# wget http://easynews.dl.sourceforge.net/sourceforge/avantfax/avantfax-3.0.6.tgz
# tar zvxf avantfax-3.0.6.tgz
# cd avantfax-3.0.6</pre>
<pre class="code"># pear channel-update pear.php.net
# pear upgrade-all
# pear install Mail Net_SMTP Mail_mime MDB2_driver_mysql MDB2_driver_pgsql
# pecl install fileinfo</pre>
<pre class="code"># chmod 0770 avantfax/includes/templates/admin_theme/templates_c/ avantfax/includes/templates/admin_theme/cache/ avantfax/includes/templates/main_theme/templates_c/ avantfax/includes/templates/main_theme/cache/
# chown www-data:www-data avantfax/includes/templates/admin_theme/templates_c/ avantfax/includes/templates/admin_theme/cache/ avantfax/includes/templates/main_theme/templates_c/ avantfax/includes/templates/main_theme/cache/
# chmod 0755 avantfax/includes/faxcover.php avantfax/includes/faxrcvd.php avantfax/includes/notify.php avantfax/tools/update_contacts.php avantfax/tools/faxcover.php avantfax/includes/avantfaxcron.php
</pre>
<pre class="code"># cp avantfax/includes/local_config-example.php avantfax/includes/local_config.php</pre>
<pre class="code"># nano avantfax/includes/local_config.php</pre>
<p>Change the following defaults</p>
<pre class="code">$FAXRMPWD = &quot;pwd&quot;;
define (&#039;ADMIN_EMAIL&#039;, &#039;root@localhost&#039;);
$AVANTFAX_SERVERNAME = &#039;fax.cipar.net&#039;; //</pre>
<p>
Make sure ”-a pwd” is the same as the “$FAXRMPWD = “pwd”;” as above</p>
<pre class="code"># /usr/sbin/faxadduser -f newhosts -a pwd www-data
# /usr/sbin/faxdeluser localhost
# /usr/sbin/faxdeluser 127.0.0.1</pre>
<pre class="code"># echo 127.0.0.1 &amp;gt;&amp;gt; newhosts
# cat /var/spool/hylafax/etc/hosts.hfaxd &amp;gt;&amp;gt; newhosts
# cat newhosts &amp;gt; /var/spool/hylafax/etc/hosts.hfaxd
# rm -f newhosts</pre>
<pre class="code"># echo &#039;JobFmt: &quot;%-3j %3i %1a %15o %40M %-12.12e %5P %5D %7z %.25s&quot;&#039; &amp;gt;&amp;gt; /etc/hylafax/hyla.conf</pre>
<pre class="code"># mv avantfax /var/www/avantfax</pre>
<pre class="code"># chown -R www-data.www-data /var/www/avantfax
# chmod -R 777 /var/www/avantfax/tmp /var/www/avantfax/faxes</pre>
<pre class="code"># nano /etc/apache2/sites-enabled/000-default</pre>
<pre class="code">NameVirtualHost *
 &amp;lt;VirtualHost *&amp;gt;
        DocumentRoot /var/www/avantfax
        ServerName avantfax
&amp;lt;/virtualhost&amp;gt;
</pre>
<pre class="code"># /etc/init.d/mysql restart
# /etc/init.d/apache2 restart</pre>
<pre class="code"># mysql --user=root -e &quot;GRANT ALL ON avantfax.* TO avantfax@localhost IDENTIFIED BY \&quot;d58fe49\&quot;&quot; mysql
# mysqladmin --default-character-set=utf8 --user=avantfax --password=d58fe49 create avantfax
# mysql --user=avantfax --password=d58fe49 avantfax &amp;lt; create_tables.sql
# mysqlshow --user=avantfax --password=d58fe49 avantfax</pre>
<pre class="code"># ln -s /var/www/avantfax/includes/faxrcvd.php /var/spool/hylafax/bin/faxrcvd.php
# ln -s /var/www/avantfax/includes/notify.php  /var/spool/hylafax/bin/notify.php
# mv /usr/bin/faxcover /usr/bin/faxcover.old
# ln -s /var/www/avantfax/includes/faxcover.php /usr/bin/faxcover
# ln -s /usr/share/file/magic* /usr/share/misc/</pre>
<pre class="code"># cat /etc/sudoers | grep -v requiretty &amp;gt; /tmp/sudoers
# echo &quot;www-data ALL= NOPASSWD: /sbin/reboot, /sbin/halt, /usr/sbin/faxdeluser, /usr/sbin/faxadduser -u * -p * *&quot; &amp;gt;&amp;gt; /tmp/sudoers
# mv /etc/sudoers /etc/sudoers.orig
# mv /tmp/sudoers /etc/sudoers
# chmod 0440 /etc/sudoers</pre>
<pre class="code"># nano /var/spool/hylafax/etc/config</pre>
<p>and add the following on at the bottom</p>
<pre class="code">#
## AvantFAX configuration
#
NotifyCmd:      bin/notify.php</pre>
<pre class="code"># nano /var/spool/hylafax/etc/config.ttyS0

#
## AvantFAX configuration
#
FaxrcvdCmd:     bin/faxrcvd.php</pre>
<pre class="code"># crontab -l &amp;gt; /tmp/tab
# echo -e &quot;0 0 * * *\t/var/www/avantfax/includes/avantfaxcron.php -t 2&quot; &amp;gt;&amp;gt; /tmp/tab
# crontab /tmp/tab
# rm -f /tmp/tab</pre>
<pre class="code"># mv /var/spool/hylafax/etc/config /etc/hylafax/config
# mv /var/spool/hylafax/etc/hosts.hfaxd /etc/hylafax/hosts.hfaxd
# mv /var/spool/hylafax/etc/config.ttyS0 /etc/hylafax/config.ttyS0
# /etc/init.d/hylafax restart</pre>
<pre class="code"># nano /etc/postfix/master.cf</pre>
<p>At the top comment out:</p>
<pre class="code">#smtp      inet  n       -       -       -       -       smtpd</pre>
<p>And att the bottom add</p>
<pre class="code">fax       unix  -       n       n       -       1       pipe
  flags= user=faxmail argv=/usr/bin/faxmail -d -n \${user}</pre>
<pre class="code"># nano /etc/postfix/transport</pre>
<p>and add</p>
<pre class="code">yourdomain.com       fax:localhost</pre>
<pre class="code"># postmap /etc/postfix/transport</pre>
<pre class="code"># nano /etc/hylafax/faxmail.conf</pre>
<pre class="code"># nano /etc/postfix/main.cf</pre>
<pre class="code">fax_destination_recipient_limit = 1</pre>
<pre class="code">nano /etc/hylafax/faxmail.conf</pre>
<pre class="code">AutoCoverPage: false
TextPointSize: 12pt
Headers: Message-id Date Subject From
MailUser: faxmail</pre>
<pre class="code"># /etc/init.d postfix reload</pre>
<p>Be carefull not to loose any sleep when doing this the first time, but if you do the result will look like this!
</p>
<p>
<a href="http://www.songshu.org/wp-content/plugins/wp-dokuwiki/lib/exe/detail.php?id=&amp;cache=cache&amp;media=screenshot-1.png" class="media" title="screenshot-1.png"><img src="http://www.songshu.org/wp-content/plugins/wp-dokuwiki/lib/exe/fetch.php?w=&amp;h=&amp;cache=cache&amp;media=screenshot-1.png" class="media" alt="" /></a>
</p>
</div>
<h2><a name="backup" id="backup">backup</a></h2>
<div class="level2">
<p>For the backup we need ssh and rsync
</p>
<pre class="code"># apt-get install openssh-server
# apt-get install rsync</pre>
<p>and make sure ssh only listens to the local address</p>
<pre class="code">ListenAddress 192.168.1.10</pre>
<pre class="code"># /etc/init.d/ssh restart</pre>
<pre class="code">newvserver --vsroot /VSERVERS --hostname fax --domain cipar.net --ip 192.168.1.10/24 --dist etch --mirror http://192.168.1.12:3142/debian.apt-get.eu/debian --interface dummy0</pre>
<pre class="code">cd /usr/src</pre>
<pre class="code">wget http://easynews.dl.sourceforge.net/sourceforge/avantfax/avantfax-3.1.3.tgz</pre>
<pre class="code">tar zvxf avantfax-3.1.3.tgz</pre>
<pre class="code">cd avantfax-3.1.3</pre>
<pre class="code"> nano debian-prefs.txt</pre>
<pre class="code"># DEFAULT INSTALL VALUES FOR Debian
#
# BEWARE: Only run the install script once or risk having duplicate
#         settings in your sendmail, sudo, and other configuration files
#
# The debian-install.sh script refers to this file
#

# The domain name for configuring email to fax
FAXDOMAIN=fax.cipar.net

# The installation directory for AvantFAX
INSTDIR=/var/www/avantfax

# The root directory where HylaFAX bin files are stored (typically, /usr or /usr/local)
HYLADIR=/usr

# HylaFAX $SPOOL directory (typically, /var/spool/hylafax or /var/spool/fax)
SPOOL=/var/spool/hylafax

# These are the database settings AvantFAX will create and use
USER=avantfax
PASS=d58fe49
DB=avantfax

# if the MySQL password for root is set, specify it here
ROOTMYSQLPWD=

# The user and group which Apache runs as (typically, apache, wwwrun, nobody, etc...)
HTTPDUSER=www-data
HTTPDGROUP=www-data</pre>
<p>&lt;/div&gt;
</p>
</div>
</div>
<p><!-- end Dokuwiki generated code--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.songshu.org/index.php/avantfax-on-debian/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
