Showing posts with label IIS. Show all posts
Showing posts with label IIS. Show all posts

10 November 2017

IIS: Could not find a base address "WebHttpBinding / BasicHttpBinding" error

IIS on Windows Server 2012 R2 64bit throws this error:
Could not find a base address that matches scheme http for the endpoint with binding BasicHttpBinding. Registered base address schemes are [https].
Impossibile trovare un indirizzo di base corrispondente allo schema http per l'endpoint con binding WebHttpBinding. Gli schemi degli indirizzi di base registrati sono [].

Find and remove from web.config(?):

    

07 November 2014

Errore WCF Service: "This collection already contains an address with scheme http. There can be at most one address per scheme in this collection."

Se, dopo aver "installato" un WCF Service su IIS, quando si cerca di utilizzarlo, ritorna il seguente errore:

This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.

La soluzione è aggiungere questo codice al web.config:



  

    
      
    

  




Trovato qui.

Testato su IIS 6

18 September 2013

Aplicazioni a 32 bit su IIS 7 a 64 bit

Per default, IIS 7 e IIS 7.5 installati su un sistema 64 bit non permettono l'esecuzione di codice 32 bit. Per cui, se state cercando di avviare applicazioni non studiate e compilate nativamente a 64 bit, potreste ricevere il messaggio di errore:

Exception information: 
Exception type: ConfigurationErrorsException 
Exception message: Impossibile caricare il file o l'assembly 'xxxxxxx' o una delle relative dipendenze. Tentativo di caricare un programma con un formato non corretto. 

Abilitate il supporto all'esecuzione del codice 32 Bit con il comando DOS:

%windir%\system32\inetsrv\appcmd set config -section:applicationPools -applicationPoolDefaults.enable32BitAppOnWin64:true

Sostituite se necessario "applicationPoolDefaults" con la vostra application pool legata all'applicazione che state cercando di eseguire (questa non l'ho capita, né provata --ndBoso).


Testato su Windows Server 2008 R2 + IIS7.
Trovato qui.

17 May 2010

Elimina file più vecchi di n giorni con ricorsione - BosoCleanDir.vbs / Delete old files

NOTE:
- impostare i parametri
- la riga che elimina i file è remmata

HACK:
- ottenere i parametri da commandline.

BosoCleanDir.vbs

' -- 2015-10-31 - aggiunto qualche echo()

Option Explicit

'------------------------------------------------------------------------------

' -- PARAMETRI
const elencoCartelle = "c:\test\1,c:\test\bla bla 2"
const maxGiorni = 30

'------------------------------------------------------------------------------

sub eliminaFile(wPath, oggi)
 
 if trim(wpath) = "" then exit sub
 
 with wscript
  .echo
  .echo "**** Processing directory: " & wpath
 end with

 dim wFileSystem, wFolder, wSubFolders, f, file
 set wFileSystem = createobject("Scripting.FileSystemObject")
 set wFolder = wFileSystem.getfolder(wPath)
 
 ' -- ELIMINA TUTTI I FILE PIU' VECCHI DI [maxGiorni] GIORNI
 for each file in wFolder.Files
  if DateDiff("d", file.DateCreated, oggi) > maxGiorni then
   wscript.echo "Deleting " & file.name
'   file.delete(true)
  end if
 next
 
 ' -- ELIMINA I FILES NELLE SOTTOCARTELLE
 dim subFolder
 for each subFolder in wFolder.SubFolders
  eliminaFile subFolder, oggi
 next

 set file = nothing
 set wFileSystem = nothing
 set wFolder = nothing
 Set wSubFolders = nothing
 
end sub

'------------------------------------------------------------------------------

sub Main()
 
 ' -- LOOP SULL'ELENCO DELLE CARTELLE
 dim arrFolder
 arrFolder = Split(elencoCartelle, ",")

 dim oggi
 oggi = now
 
 dim riga
 riga =  string(80, "*")
 
 with wscript
  .echo
  .echo riga
  .echo "* DELETING FILES OLDER THAN " & maxGiorni & " DAYS"
  .echo riga

  dim cartella
  for each cartella in arrFolder
   eliminaFile cartella, oggi
  next

  .echo
  .echo "** DONE"
 end with

end sub

'------------------------------------------------------------------------------

Main



Versione alternativa, senza output


Questa versione pulisce i log di IIS:
sLogFolder = "c:\inetpub\logs\LogFiles"
iMaxAge = 30   'in days

Set objFSO = CreateObject("Scripting.FileSystemObject")
set colFolder = objFSO.GetFolder(sLogFolder)

For Each colSubfolder in colFolder.SubFolders
        Set objFolder = objFSO.GetFolder(colSubfolder.Path)
        Set colFiles = objFolder.Files

        For Each objFile in colFiles
                iFileAge = now-objFile.DateCreated
                if iFileAge > (iMaxAge+1)  then
                        objFSO.deletefile objFile, True
                end if
        Next
Next

Via.