Tag-Archive for » Apache «

Trečiadienis, March 18th, 2009 | Autorius:

[edit] So much for that. It turns out that openssl is able to determine that the key and certificate are already in a single file. Therefore, nėra csplitting required (gerai, I hope somebody reading this at least learned about how nice csplit is). In fact, the whole script might as well be obsoleteblaargh. Well, at least it gives a nice warning about not giving a blank passphrase. 😀

Here’s the new version:

pem2pfxconverts a .pem-formatted file containing a private key and signed certificate into a Windows-compatible .pfx certificate file.

#!/bin/bash
#pem2pfx
#v0.2
#Suktas - brendan@swiftspirit.co.za
# Converts a .pem certificate file to .pfx format
# $1 is the source file
set -ir
 
if [ $# = 1 ]; then
  outputfile=`echo $1 | sed 's/.pem$/.pfx/'`
 
  echo "Please specify a password below. Windows refuses to import a .pfx certificate with a blank password."
  openssl pkcs12 -export -out $outputfile -in $1
 
 else
  echo "pem2pfx - converts a .pem formatted private-key and certificate file to an IIS-compatible .pfx file."
  echo "Usage: pem2pfx inputfile.pem"
fi

daugiau…

dalis
Šeštadienis, Vasaris 21, 2009 | Autorius:

Santykinai naujų dokumentų rūšys Biuras 2007 davė Kai kurie interneto pavaduojančius problemų, kai jų klientai nori pasiūlyti dokumentus atsisiųsti. Dažniausiai, dokumentai yra siūlomos serverio kaip “Tekstas / Html” kuris vėliau taptų kaip šiukšlių toną internete vartotojo ekrane.

Geriausias būdas išspręsti šią problemą yra pridėti visi MIME tipus į pagrindinio serverio konfigūracijos. IIS7 Windows jau turi šiuos MIME tipus, nustatytus teisingai pagal nutylėjimą. IIS6 ir IIS5 reikalauja MIME tipai turi būti pridėta, kaip galima Apache vyresnio amžiaus įrenginių. Apache, taip pat už individualios domeno savininkas problemos pridėti mime tipus per Apache .Htaccess byla.

IIS 6 MIME tipas papildymas (už Server Administrator)

Prieš tai gali būti padaryta, užtikrinti, kad jūsų serveris taip pat yra nustatyta, kad tiesioginis metabazy redagavimą:

  1. Apkrova IIS direktorius: Start -> RJT, “inetmgr” -> [Gerai]
  2. Dešiniuoju pelės mygtuku spustelėkite “serveris” ir spauskite “PRoperties”
  3. Per “Informacinės interneto paslaugos” kortelė (paprastai tik skirtukas), užtikrinti, kad “IrNsugebėti Tiesioginis metabazy Redaguoti” langelį tikrinamas.
  4. Spragtelėjimas [Gerai]

Būtinai atgal į viršų IIS konfigūracijos (čia už IIS5) iš anksto. Aš negali imtis jokių atsakomybę už admin nesilaikantiems savo serverį. Turiu pagrindo manyti, tai gali būti taip pat dirbti IIS5 tačiau turiu tik tiek, kiek pagrindo manyti, kad jis gali tiesiog suteikti daug klaidų. Jei yra IIS5 / Langai 2000 admin nori išbandyti tai man po atsargines kopijas konfigūracija, prašome leiskite man žinoti, rezultatų.

Nukopijuokite šį tekstą į failą pavadinimu msoff07-addmime.vbs ir jį vykdyti kartą iš įvesdami komandų eilutės cscript msoff07-addmime.vbs ir paspauskite "Enter". Jei paleisti daugiau nei vieną kartą, MIME tipai bus pridėta kiekvieną kartą, ir jūs turite kelis identiškus įrašus:

"Šis scenarijus prideda reikalingą tarnybą 2007 MIME tipų į IIS 6 Serveris.
"Jei norite naudoti šį scenarijų, tiesiog dukart spustelėkite arba vykdyti ją iš komandinės eilutės.
"Veikia Šis scenarijus kelis kartus rezultatus keliais įrašais
"IIS MimeMap todėl jums neturėtų paleisti daugiau nei vieną kartą.
"Modifikuotas iš http://msdn.microsoft.com/en-us/library/ms752346.aspx
 
Ne MimeMapObj, MimeMapArray, MimeTypesToAddArray, WshShell, oExec
Konst ADS_PROPERTY_UPDATE = 2 
 
"Nustatykite MIME tipai turi būti pridėta
MimeTypesToAddArray = Masyvas(".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", "Prašymas / 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", _
".sld", "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", _
"xls", "Application / vnd.openxmlformats-officedocument.spreadsheetml.sheet", _
"Xltm", "application / vnd.ms-excel.template.macroEnabled.12", _
"Xltx", "Application / vnd.openxmlformats-officedocument.spreadsheetml.template") 
 
"Gaukite mimemap objektą
Nustatyti MimeMapObj = GetObject("IIS://Localhost / MimeMap")
 
"Call AddMimeType už kiekvieną pratęsimo / MIME tipas pora
 skaitiklis = 0 į UBound(MimeTypesToAddArray) Žingsnis 2
    AddMimeType MimeTypesToAddArray(skaitiklis), MimeTypesToAddArray(skaitiklis+1)
Kitas
 
"Sukurti" Shell objektą
Nustatyti WshShell = CreateObject("WScript.Shell")
 
"Stop & Start" IIS paslauga
Nustatyti oExec = WshShell.Štabo viršininkas("Net stop w3svc")
Apie O oExec.Statusas = 0
    WScript.Miegas 100
Kilpa
 
Nustatyti oExec = WshShell.Štabo viršininkas("Net start w3svc")
Apie O oExec.Statusas = 0
    WScript.Miegas 100
Kilpa
 
Nustatyti oExec = Niekas
 
"Blogas statusą vartotojas
WScript.Aidas "Microsoft Office" 2007 Dokumento MIME tipai buvo registruotas."
 
"AddMimeType pietus
Sub AddMimeType (Ext, MTYPE)
 
    "Gaukite iš MimeMap turto rodymo.
    MimeMapArray = MimeMapObj.GETEX("MimeMap") 
 
    "Pridėti naują žemėlapių.= UBound(MimeMapArray) + 1
    Tunka Išsaugoti MimeMapArray()
    Nustatyti MimeMapArray() = CreateObject("MimeMap")
    MimeMapArray().Pratęsimas = Ext
    MimeMapArray().MimeTipas = MTYPE
    MimeMapObj.PutEx ADS_PROPERTY_UPDATE, "MimeMap", MimeMapArray
    MimeMapObj.Setinfo
 
Pabaiga Sub

Apache MIME tipas papildymas (už Server Administrator)

Apache saugo savo MIME tipus failą paprastai, esančio $installpath / conf / mime.types. Žr mod_mime dokumentacija daugiau apie tai, kaip ji veikia. Arch Linux įdiegia savo MIME tipus /etc / httpd / conf / mime.types ir Parallels Plesk įdiegia jį /usr / local / PSA / admin / conf / mime.types. Jūsų platinimo gali jį kitoje vietoje, taip Ieškoti mime.types Failas veikia rasti mime.types.

Pridėti šias eilutes į savo mime.types failą:

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 tipas papildymas (Dėl domeno savininkas su bent FTP priėjimas – naudojant .htaccess failą)

Pridėti šį tekstą į savo domeno .Htaccess byla, dažniausiai į httpdocs / katalogas

AddType application / vnd.ms-word.document.macroEnabled.12 docm
AddType taikymas / vnd.openxmlformats-officedocument.wordprocessingml.document docx
AddType taikymas / 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 MISP
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 taikymas / vnd.openxmlformats-officedocument.presentationml.presentation pptx
AddType application / vnd.ms-powerpoint.slide.macroEnabled.12 sldm
AddType taikymas / 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 taikymas / vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
AddType application / vnd.ms-excel.template.macroEnabled.12 xltm
AddType application / vnd.openxmlformats-officedocument.spreadsheetml.template xltx
dalis
Antradienis, February 17th, 2009 | Autorius:

Some of you may already know that I built a home server not too long ago. I documented some of the very important parts of how it was built though I was planning on releasing all the documentation all at once. I was using Arch Linux and I hadn’t nearly finished everything, especially the documentation. Pavyzdžiui, it was supposed to be a media server. After some disk shuffling, it was supposed to end up having a RAID1 for the boot and RAID 10 for the rest (the media part).

This didn’t work out at all.

I got as far as having an efficient (ir geraifirewalled) routing gateway server. I was finally satisfied that the customised local routing* was working correctly and I was confident that my tests with DHCP meant I could disable the DHCP service on the flimsy ADSL router and have all my flatmates start using the server as the Internet vartai. Vietoj: I was logged in to the server from the office, I’d just installed Apache2**, and I was about to consult with a colleague regarding getting nice graphs put together so the flatmates could all see who was using up the bandwidth***when I noticed a little message indicating that the root filesystem had been remounted read-only due to some or other disk failure.

And then I lost my connection to the server.

And then I gained a foul mood.

🙁

When I arrived home, I found that, as I had guessed from the descriptive message given at the office, the (labai) old 80GB IDE disk that I was using for the root filesystem had failed. Unfortunately, the server would never boot again and there was little chance of prying everything off onto another disk to continue where I’d left off.

I’m buying a replacement (SATA) HDD this next weekend just after pay dayand I’ve changed my mind about documenting my progressand backing up my configurations:

Release Early. Release Often.

* ISPs in South Africa charge less (easy price comparison) forlocal-only” (within South Africa) traffic on ADSL but only if you use an ADSL account that CANNOT access web services outside of South Africa. This means that if you want to take advantage of the reduced costs but still be able to access the Internet at large, you need to set up some sneaky routing.

** one-command-install: ~$ yaourt -S apache

*** Internet Access in SA is expensiveyou get charged about R70 ($7 / £4.9 / €5.46) per GB when using ADSL, or about R2 per MB if using GPRS / 3G.

dalis
Ketvirtadienis, January 22nd, 2009 | Autorius:

I very recently found a problem with a client’s web site due to a .Htaccess byla. The site was hosted on a Langai server running IIS using IISPassword, which makes use of .Htaccess files for its settings.

IISPassword doesn’t follow exactly the same rules as with Apache Tačiau. If the .htaccess file exists then it must contain IISPassword-appropriate rules, otherwise the server returns only the following error:

Error 500 given by IIS Password
Here’s the content of the .htaccess file. I’ve only modified the final redirection URL to point to example.com appropriately:

RewriteEngine On
RewriteCond %{HTTP_REFERER} .*google.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} .*aol.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} .*msn.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} .*yahoo.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} .*yandex.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} .*rambler.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} .*ya.*$ [NC]
RewriteRule .* http://siffy-phishing-url.example.com [R,L]

If this were on a server running Apache with mod_rewrite, most web users would go directly to the correct site content. Only if they reached the site through the search engines and indexes listed in the .htaccess, would they be redirected to the siffy phishing url that the cracker wants victims to reach.

Žinoma, the cracker (or perhaps even an automated worm) didn’t realise that the server in question didn’t even support these mod_rewrite rules. But either way, this is very worrying as I can foresee many arguments about whether or not the site is working

dalis