Archive for the Category » backup «

Sunday, August 04th, 2013 | Author:

Storja

Ħafna kienu nbidlu peress I aħħar imsemmi tiegħi server personali – din kibret leaps u limiti (issa għandha 7TB md RAID6) u kien reċentement ġie rrikostitwit ma Ubuntu Server.

Arch qatt kien żball. Arch Linux kienet diġà mgħallma me daqstant dwar Linux (u se tkompli tagħmel dan fuq id-desktop tiegħi oħra). Iżda Arch definittivament teħtieġ iktar ħin u attenzjoni milli nixtieq li jonfqu fuq server. Idealment I d jippreferu li jkunu kapaċi tinsa dwar il-server għal waqt sakemm email tfakkira jgħid “um … hemm koppja aġġornamenti għandek tfittex fil, buddy.”

Ispazju mhuwiex ħieles – u la huwa l-ispazju

L-opportunità li jemigraw lejn Ubuntu kien il-fatt li kelli jispiċċaw ta ' SATA portijiet, il-portijiet meħtieġa biex jgħaqqdu hard drives għall-bqija tal-kompjuter – li firxa RAID 7TB juża ħafna ta 'portijiet! I kienet saħansitra mogħtija bogħod tiegħi ħafna qodma hard disk 200GB kif hija ħadet up waħda minn dawk il-portijiet. I wkoll wissa lir-riċevitur li l-disk tal SMART monitoraġġ indika li kien inaffidabbli. Bħala workaround temporanja għan-nuqqas ta 'portijiet SATA, I kienet saħansitra emigraw OS-server li sett ta 'erba stikek USB fi md RAID1. Crazy. Naf. I ma kienx wisq kuntenti dwar il-veloċità. I iddeċieda li joħorġu u jixtru hard drive affidabbli ġodda u karta espansjoni SATA li jmorru magħha.

Partition l-server primarja Arch kien uża madwar 7GB ta 'disk. A blokki kbar ta 'dak kien tpartit fajl, data Cached u fajls inkella jew mixxellanji mhux meħtieġa. B'mod ġenerali d-daqs attwali tal-OS, inkluż il- /home folder, Kien biss madwar 2GB. Dan wassal għalija li tħares lejn super fast SSD issuq, ħsieb forsi wieħed iżgħar jista 'ma jkunx tant għali. Irriżulta li l-irħas drive mhux SSD I jista 'jsib ispiża attwalment aktar minn wieħed minn dawn SSDs relattivament żgħar. Yay għalija. 🙂

Għażla? Woah?!

Fl-għażla l-OS, I d diġà ddeċidiet li ma jkunx Arch. Mit-total ta 'l-distribuzzjonijiet oħra popolari, Jien aktar familjari ma Ubuntu u CentOS. Fedora kien ukoll il-possibbiltà – iżda I kien għadu ma kkunsidrata serjament dan għal server. Ubuntu rebaħ il-round.

Id-deċiżjoni li jmiss I kellha tagħmel ma seħħx lili sakemm Ubikwità (Wizard installazzjoni Ubuntu) talabha ta 'lili: Kif twaqqaf il- ħitan.

I kien ġdid għall-użu SSDs fl-Linux – Jien konxju tal-iżvantaġġi ta 'mhux jużawhom b'mod korrett, aktar minħabba r-riskju tagħhom ta 'lonġevità fqira jekk użati ħażin.

I ma riedx li jużaw partition tpartit dedikat. I pjan dwar it-titjib motherboard-server / CPU / memorja mhux wisq fil-futur. Ibbażat fuq dan I iddeċieda I se tpoġġi swap ġo fajl tpartit fuq il-RAID md eżistenti. It-tpartit ma se jkun partikolarment mgħaġġel iżda uniku skop tagħhom se jkun għal din l-okkażjoni rari meta xi ħaġa marret ħażin u l-memorja ma jkunx disponibbli.

Dan imbagħad telqu lili biex jagħtu l- passaġġ għerq l-60GB sħiħa barra minn Intel 330 SSD. I kkunsidrat jisseparaw / home iżda hija biss deher ftit inutli, mogħti kif ftit kien użat fil-passat. I l-ewwel stabbilit il-partition ma LVM – xi ħaġa li stajt reċentement qed tagħmel kulmeta I twaqqaf kaxxa Linux (verament, hemm l-ebda skuża biex ma jużawx LVM). Meta ltqajna għall-parti fejn nixtieq kkonfigurat l-filesystem, I għafast il-drop-down u istintivament magħżula ext4. Imbagħad I ndunat Btrfs fl-istess lista. Tistrieħ fuq!!

Iżda dak?

Btrfs (“butir eff-ESS”, “aħjar eff-ESS”, “bee-siġra-eff-ESS”, jew kwalunkwe inti fancy fil-jum) huwa filesystem relattivament ġdida żviluppata sabiex iġibu Linux’ kapaċitajiet filesystem lura fuq il-binarji ma 'kurrent filesystem teknoloġija. Ir-Re-of-the-Hill eżistenti filesystem, “ext” (il-verżjoni attwali msejjaħ ext4) hija pjuttost tajba – iżda hi limitata, staġnati paradigma qodma (think ta 'marka ġdida F22 Raptor vs. ta F4 Phantom ma 'tentattiv nofs jested fi upgrade ekwivalenza) u mhuwiex probabbli li jkunu jistgħu jikkompetu għal żmien twil ma 'filesystems Intrapriża ġodda bħall- ZFS Oracle. Btrfs għad baqgħalha triq twila quddiemha u għadu meqjus sperimentali (jiddependi fuq li inti titlob u liema karatteristiċi li għandek bżonn). Ħafna jaħsbu li hu stabbli għall-użu bażiku – imma ħadd ma jkun se jagħmel xi garanziji. U, tal-kors, kulħadd huwa qal li tagħmel u test backups!

Mooooooo

L-aktar differenza fundamentali bejn ext u Btrfs hija li Btrfs huwa “Cow” jew “Kopja fuq Write” filesystem. Dan ifisser li d-data hija qatt ma attwalment deliberatament jinkiteb fuqhom mill-intern tal-filesystem tal. Jekk inti tikteb bidla għall-fajl, Btrfs se jikteb bidliet tiegħek għal post ġdid fuq midja fiżika u se taġġorna l-pointers interni li jirreferi għall-post ġdid. Btrfs tmur pass ieħor f'dik dawk pointers interni (imsejħa metadata) huma ukoll Cow. Verżjonijiet anzjani ta 'ext ikollu sempliċement fuq ohra l-informazzjoni. Ext4 ser jużaw Ġurnal sabiex jiżguraw li l-korruzzjoni mhux se jseħħ jekk il-plagg AC jiġu yanked fil-mument l-aktar inadatt. Ir-riżultati ġurnal f'numru simili ta 'passi meħtieġa li jaġġornaw id-dejta. Bil SSD, l-hardware sottostanti topera proċess baqra simili x'ikun filesystem inti qed tuża. Dan huwa minħabba drives SSD ma tistax attwalment jissostitwixxu data – huma għandhom kopja tad-data (mal-bidliet tiegħek) għal post ġdid u mbagħad iħassar il-blokk qodma kompletament. Ottimizzazzjoni f'dan il-qasam hija li SSD ma jista 'anke tħassar l-blokk qodma iżda sempliċiment tagħmel nota litħassar l-blokk fi żmien aktar tard meta l-affarijiet mhumiex daqshekk busy. Ir-riżultat aħħari huwa li drives SSD jaqblu tajjeb ħafna ma 'filesystem baqra u ma jwettqu kif ukoll ma filesystems mhux baqra.

Biex l-affarijiet interessanti, Cow fil-filesystem faċilment tmur id f'id ma 'karatteristika imsejjaħ deduplication. Dan jippermetti 2 (jew aktar) blokki identiċi ta 'data li għandha tiġi maħżuna bl-użu biss kopja waħda, iffrankar l-ispazju. Bil Cow, jekk fajl deduplicated hija modifikata, l twin separata mhux se jiġu affettwati bħala data tal-fajl modifikata se jkunu nkitbu għal blokk fiżika differenti.

Cow mbagħad jagħmel snapshotting relattivament faċli biex jiġi implimentat. Meta notament s-sistema hija biss l-istampa l-ġdida bħala duplikazzjoni tad-dejta kollha u metadata fil-volum. Bil Cow, meta bidliet ikunu saru, data tal-snapshot ta soġġorni intatti, u viżjoni konsistenti tad-istatus tal-filesystem fil-ħin l-istampa saret tista 'tinżamm.

A ħabib ġdid

Bl-hawn fuq fil-moħħ, speċjalment fir-Ubuntu għamlet Btrfs disponibbli bħala għażla jinstallaw-time, I dehret se jkun żmien tajjeb biex adsa fis Btrfs u tesplora ftit. 🙂

Parti 2 coming soon …

Aqsam
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 fajl.

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 (hawn 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 li UBound(MimeTypesToAddArray) Pass 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 u 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 fajl, 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
Aqsam