Archive for the Category » backup «

Sunday, August 04th, 2013 | Author:

History

Much had changed since I last mentioned my personal server – Ĝi kreskis de saltegoj kaj saltegoj (it now has a 7TB md RAID6) and it had recently been rebuilt with Ubuntu Server.

Arch was never a mistake. Arch Linux had already taught me so much about Linux (Kaj daŭros tiel fari sur mia alia surtabla). But Arch definitely requires more time and attention than I would like to spend on a server. Ideally I’d prefer to be able to forget about the server for a while until a reminder email saysumthere’s a couple updates you should look at, buddy.

Space isn’t freeand neither is space

The opportunity to migrate to Ubuntu was the fact that I had run out of SATA ports, the ports required to connect hard drives to the rest of the computerthat 7TB RAID array uses a lot of ports! I had even given away my very old 200GB hard disk as it took up one of those ports. I also warned the recipient that the disk’s SMART monitoring indicated it was unreliable. Kiel intertempa workaround al la manko de SATAaj havenoj, I had even migrated the server’s OS to a set of four USB sticks in an md RAID1. Freneza. Mi scias. Mi wasn’t tro feliĉa pri la rapido. I decided to go out and buy a new reliable hard drive and a SATA expansion card to go with it.

The server’s primary Arch partition was using about 7GB of disk. A big chunk of that was a swap file, Cached datumo and otherwise miscellaneous or unnecessary files. Entute la reala grandeco de la OS, including the /home folder, Estis nur pri 2GB. This prompted me to look into a super-fast SSD drive, thinking perhaps a smaller one might not be so expensive. It turned out that the cheapest non-SSD drive I could find actually cost Pli Ol unu el ĉi tiuj relative malgranda SSDs. Yay for me. 🙂

Choice? Woah?!

En elektanta la OS, I’d jam decidis ĝin wouldn’t esti Arkaĵo. Ekstere de ĉiuj la aliaj popularaj disdonadoj, I’m most familiar with Ubuntu and CentOS. Fedora was also a possibilitybut I hadn’t seriously yet considered it for a server. Ubuntu won the round.

The next decision I had to make didn’t occur to me until Ubiquity (Ubuntu’s instalaĵa sorĉisto) Demandis ĝin de mi: How to set up the partitions.

I was new to using SSDs in Linux – I’m bone konscia de la enfaliloj de ne uzanta ilin ĝuste, Plejparte pro ilia risko de malriĉa longevity se misuzita.

Mi didn’t deziras uzi diligentan interŝanĝan septon. Mi planas sur altgradiganta la servilon’s motherboard/CPUa/memoro ne tro ege en la estonteco. Bazita sur kiu mi decidis min metos interŝanĝon en interŝanĝa dosiero sur la ekzistanta md TRUDENIRO. The swap won’t be particularly fast but its only purpose will be for that rare occasion when something’s gone wrong and the memory isn’t available.

This then left me to give the root path the full 60GB out of an Intel 330 SSD. Mi konsideris apartiganta /hejmon sed ĝi nur ŝajnita malgranda sencela, Donita kiom malmulte estis uzita en la pasinteco. I first set up the partition with LVMsomething I’ve recently been doing whenever I set up a Linux box (really, there’s no excuse not to use LVM). Kiam ĝi akiris al la parto kie mi formus la filesystem, Mi klakis la falon-malsupren kaj instinkte elektita ext4. Tiam mi rimarkis btrfs en la sama listo. Pendi sur!!

But a what?

Btrfs (“Butero-eff-ess”, “Pli bona-eff-ess”, “Abelo-arbo-eff-ess”, Aŭ kio ajn vi fantazias sur la tago) Estas relative nova filesystem evoluigita por alporti Linukson’ Filesystem kapabloj reen sur vojeto kun fluo filesystem tech. La ekzistanta King-de-la-Monteto filesystem, “Ext” (La nuna versio vokis ext4) Estas sufiĉe bona – but it is limited, stuck in an old paradigm (think of a brand new F22 Raptor vs. an F4 Phantom with a half-jested attempt at an equivalency upgrade) and is unlikely to be able to compete for very long with newer Enterprise filesystems such as Oracle’s ZFS. Btrfs ankoraŭ havas longan vojon iri kaj estas ankoraŭ konsiderita eksperimentan (Dependanta sur kiu vi demandas kaj kio prezentas vin bezono). Multaj konsideri ĝin esti stabila por baza uzo – Sed neniu estas iranta fari ajnajn garantiojn. Kaj, Nature, Ĉiu estas diranta fari kaj testaj rezervoj!

Mooooooo

La plej fundamenta diferenco inter ext kaj btrfs estas ke btrfs estas “BOVINO” Aŭ “Kopii sur Skribi” Filesystem. Tio ĉi signifas ke datumo estas neniam efektive intence anstataŭigita de la filesystem’s internals. Se vi skribas ŝanĝon al dosiero, btrfs will write your changes to a new location on physical media and will update the internal pointers to refer to the new location. Btrfs iras paŝon cetere en kiu tiuj internaj sugestoj (Plu-gvidita al kiel metadata) Estas Ankaŭ BOVINO. Pli malnovaj versioj de ext havus simple anstataŭigitan la datumo. Ext4 uzus Revuon certigi tiun korupton gajnis’t okazas devus la AC ŝtopas esti elretirita ĉe la plej inopportune momento. La revuaj rezultoj en simila nombro de paŝoj postulita ĝisdatigi datumon. With an SSD, the underlying hardware operates a similar CoW process no matter what filesystem you’re using. Tio ĉi estas ĉar SSDaj stiradoj povas ne efektive anstataŭigi datumon – Ili devi kopii la datumon (with your changes) to a new location and then erase the old block entirely. An optimisation in this area is that an SSD might not even erase the old block but rather simply make a note to erase the block at a later time when things aren’t so busy. The end result is that SSD drives fit very well with a CoW filesystem and don’t perform as well with non-CoW filesystems.

Fari aferojn interesanta, BOVINO en la filesystem facile iras manon mane kun ĉefaĵo vokis deduplication. Tio ĉi permesas du (Aŭ pli) Identaj blokoj de datumo esti entenita uzanta nur ununuran kopion, Savanta spacon. Kun BOVINO, Se deduplicated dosiero estas modifita, La aparta ĝemelo gajnis’t esti influita kiel la modifita dosieron’s datumoj estos estinta skribita al malsama fizika bloko.

BOVINO en ĝiradaj faroj Snapshotting Relative facile efektivigi. Kiam momentfoto estas farita la sistemon simple registras la novan momentfoton kiel estanta duplikatado de ĉiuj datumoj kaj metadata ene de la volumo. Kun BOVINO, Kiam ŝanĝoj estas farita, La momentfoto’s datumoj restas sendifektan, Kaj konsekvenca vido de la filesystem’s statuso ĉe la tempo la momentfoto estis farita povas esti daŭrigita.

A new friend

Kun la supra en menso, Precipe kiel Ubuntu faris btrfs havebla kiel instali-tempa elekto, Mi kalkulis ĝin estus bona tempo plonĝi en btrfs kaj esplori malgrandan. 🙂

Part 2 coming soon

Interŝanĝado
Saturday, February 21st, 2009 | Author:

The relatively new document types Office 2007 has given some web hosts problems when their clients want to offer documents for download. Most often, the documents are being offered by the web server as text/html which is then rendered as a ton of garbage on the web user’s screen.

The best way to resolve this is to add all the MIME types to the server’s main configuration. IIS7 for Windows already has these MIME types set up correctly by default. IIS6 and IIS5 require the MIME types to be added, as might Apache on older installations. For Apache, there is also a workaround for the individual domain owner to add the mime types via Apache’s .htaccess file.

IIS 6 MIME type addition (for the Server Administrator)

Before this can be done, ensure that your server is also set to allow direct metabase editing:

  1. Load IIS Manager: Start -> Run, “inetmgr” -> [OK]
  2. Right click theserverand clickProperties
  3. Within theInternet Information Servicestab (usually the only tab), ensure that theEnable Direct Metabase Editcheckbox is checked.
  4. Click [OK]

Be sure to back up IIS’s configuration (here for IIS5) beforehand. I won’t take any responsibility for an admin breaking his server. I have reason to believe this may also work on IIS5 however I have just as much reason to believe that it might just give lots of errors. If an IIS5 / Windows 2000 admin is willing to test this for me after backing up your configuration please let me know of the results.

Copy the following text into a file named msoff07-addmime.vbs and execute it once from the commandline by typing cscript msoff07-addmime.vbs and pressing Enter. If you run it more than once, the MIME types will be added each time and you will have multiple identical entries:

' This script adds the necessary Office 2007 MIME types to an IIS 6 Server.
' To use this script, just double-click or execute it from a command line.
' Running this script multiple times results in multiple entries in the
' IIS MimeMap so you should not run it more than once.
' Modified from http://msdn.microsoft.com/en-us/library/ms752346.aspx
 
Dim MimeMapObj, MimeMapArray, MimeTypesToAddArray, WshShell, oExec
Const ADS_PROPERTY_UPDATE = 2 
 
' Set the MIME types to be added
MimeTypesToAddArray = Array(".docm", "application/vnd.ms-word.document.macroEnabled.12", _
".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", _
".dotm", "application/vnd.ms-word.template.macroEnabled.12", _
".dotx", "application/vnd.openxmlformats-officedocument.wordprocessingml.template", _
".potm", "application/vnd.ms-powerpoint.template.macroEnabled.12", _
".potx", "application/vnd.openxmlformats-officedocument.presentationml.template", _
".ppam", "application/vnd.ms-powerpoint.addin.macroEnabled.12", _
".ppsm", "application/vnd.ms-powerpoint.slideshow.macroEnabled.12", _
".ppsx", "application/vnd.openxmlformats-officedocument.presentationml.slideshow", _
".pptm", "application/vnd.ms-powerpoint.presentation.macroEnabled.12", _
".pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation", _
".sldm", "application/vnd.ms-powerpoint.slide.macroEnabled.12", _
".sldx", "application/vnd.openxmlformats-officedocument.presentationml.slide", _
".xlam", "application/vnd.ms-excel.addin.macroEnabled.12", _
".xlsb", "application/vnd.ms-excel.sheet.binary.macroEnabled.12", _
".xlsm", "application/vnd.ms-excel.sheet.macroEnabled.12", _
".xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", _
".xltm", "application/vnd.ms-excel.template.macroEnabled.12", _
".xltx", "application/vnd.openxmlformats-officedocument.spreadsheetml.template") 
 
' Get the mimemap object
Set MimeMapObj = GetObject("IIS://LocalHost/MimeMap")
 
' Call AddMimeType for every pair of extension/MIME type
For counter = 0 to UBound(MimeTypesToAddArray) Step 2
    AddMimeType MimeTypesToAddArray(counter), MimeTypesToAddArray(counter+1)
Next
 
' Create a Shell object
Set WshShell = CreateObject("WScript.Shell")
 
' Stop and Start the IIS Service
Set oExec = WshShell.Exec("net stop w3svc")
Do While oExec.Status = 0
    WScript.Sleep 100
Loop
 
Set oExec = WshShell.Exec("net start w3svc")
Do While oExec.Status = 0
    WScript.Sleep 100
Loop
 
Set oExec = Nothing
 
' Report status to user
WScript.Echo "Microsoft Office 2007 Document MIME types have been registered."
 
' AddMimeType Sub
Sub AddMimeType (Ext, MType)
 
    ' Get the mappings from the MimeMap property.
    MimeMapArray = MimeMapObj.GetEx("MimeMap") 
 
    ' Add a new mapping.
    i = UBound(MimeMapArray) + 1
    Redim Preserve MimeMapArray(i)
    Set MimeMapArray(i) = CreateObject("MimeMap")
    MimeMapArray(i).Extension = Ext
    MimeMapArray(i).MimeType = MType
    MimeMapObj.PutEx ADS_PROPERTY_UPDATE, "MimeMap", MimeMapArray
    MimeMapObj.SetInfo
 
End Sub

Apache MIME type addition (for the Server Administrator)

Apache stores its MIME types in a file normally located at $installpath/conf/mime.types. See the mod_mime documentation for more on how it works. Arch Linux installs its MIME types at /etc/httpd/conf/mime.types and Parallels Plesk installs it in /usr/local/psa/admin/conf/mime.types. Your distribution might have it in another place, so find your mime.types file by running locate mime.types.

Add the following lines to your mime.types file:

application/vnd.ms-word.document.macroEnabled.12                          docm
application/vnd.openxmlformats-officedocument.wordprocessingml.document   docx
application/vnd.ms-word.template.macroEnabled.12                          dotm
application/vnd.openxmlformats-officedocument.wordprocessingml.template   dotx
application/vnd.ms-powerpoint.template.macroEnabled.12                    potm
application/vnd.openxmlformats-officedocument.presentationml.template     potx
application/vnd.ms-powerpoint.addin.macroEnabled.12                       ppam
application/vnd.ms-powerpoint.slideshow.macroEnabled.12                   ppsm
application/vnd.openxmlformats-officedocument.presentationml.slideshow    ppsx
application/vnd.ms-powerpoint.presentation.macroEnabled.12                pptm
application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
application/vnd.ms-powerpoint.slide.macroEnabled.12                       sldm
application/vnd.openxmlformats-officedocument.presentationml.slide        sldx
application/vnd.ms-excel.addin.macroEnabled.12                            xlam
application/vnd.ms-excel.sheet.binary.macroEnabled.12                     xlsb
application/vnd.ms-excel.sheet.macroEnabled.12                            xlsm
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet         xlsx
application/vnd.ms-excel.template.macroEnabled.12                         xltm
application/vnd.openxmlformats-officedocument.spreadsheetml.template      xltx

Apache MIME type addition (For the domain owner with at least FTP accessusing .htaccess file)

Add the following text to your domain’s .htaccess file, most commonly in an httpdocs/ directory

AddType application/vnd.ms-word.document.macroEnabled.12 docm
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
AddType application/vnd.ms-word.template.macroEnabled.12 dotm
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx
AddType application/vnd.ms-powerpoint.template.macroEnabled.12 potm
AddType application/vnd.openxmlformats-officedocument.presentationml.template potx
AddType application/vnd.ms-powerpoint.addin.macroEnabled.12 ppam
AddType application/vnd.ms-powerpoint.slideshow.macroEnabled.12 ppsm
AddType application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx
AddType application/vnd.ms-powerpoint.presentation.macroEnabled.12 pptm
AddType application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
AddType application/vnd.ms-powerpoint.slide.macroEnabled.12 sldm
AddType application/vnd.openxmlformats-officedocument.presentationml.slide sldx
AddType application/vnd.ms-excel.addin.macroEnabled.12 xlam
AddType application/vnd.ms-excel.sheet.binary.macroEnabled.12 xlsb
AddType application/vnd.ms-excel.sheet.macroEnabled.12 xlsm
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
AddType application/vnd.ms-excel.template.macroEnabled.12 xltm
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx
Interŝanĝado