Microsoft IIS

From FroggDev - En
Jump to: navigation, search


PHP on IIS

PHP Installation

  • in server management install role CGI
Add CGI role
Add CGI role on windows 2012
  • add PHP in module mapping
PHP mapping
Modify options
  • modify php.ini
fastcgi.impersonate = 1
fastcgi.logging = 0
cgi.fix_pathinfo=1
cgi.force_redirect = 0
  • restart IIS

PHP Configuration

  • if you need COM.php, you need to add the extension (was included in earlier version)
extension=php_com_dotnet.dll
  • allow <? ?> in more than <?php ?>
short_open_tag = On
  • logs path
error_log = "C:\SRVLOG\system\PHP\error.log"
mail.log ="C:\SRVLOG\system\PHP\mail.log"
  • temp files path
session.save_path = "C:\SRVLOG\system\PHP\sessions"
upload_tmp_dir = "C:\SRVLOG\system\PHP\uploads"
  • upload parameters
upload_max_filesize = 2M
post_max_size = 2M
memory_limit = 128M (must be higher than uploads size)
  • enable extensions directory
extension_dir = "ext"

PHP Update

  • stop IIS
  • save php.ini
  • replace old PHP folder for the new one (save the old to rollback if there s trouble)
  • restore php.ini
  • update Visual C++ if needed
  • start IIS

FTP

Select add FTP on the IIS server
Add a FTP


Select Name and folder
FTP folder


Set FTP IP and SSL configuration
IP & SSL Configuration


Authorized Users
FTP Users


Add user rights to the physical FTP folder
FTP Users


View result
Result

SMTP

SMTP role installation

Add role SMTP

SMTP configuration

SMTP configuration

Server IP has to be the same in those 3 cases, "All IP unassigned" allow 127.0.0.1 to work. Do not forget to allow outbound port (25 by default) in firewall

server IP
Access
Relay
Service

test in php

<?PHP
if(mail('admin@frogg.fr','test subject','test message','FROM: test@frogg.fr'))
	{echo('OK');}
else	{echo('ERROR');}
?>

change folders

log

log path

badmail

badmail path

drop

drop path


queue & pickup

require adsutil.vbs available in IIS Options

script and tools

Can requier too : IIS6 scripting Tools

commands:

adsutil.vbs set smtpsvc/1/dropdirectory C:\SRVLOG\IIS\mail\drop 
adsutil.vbs set smtpsvc/1/badmaildirectory C:\SRVLOG\IIS\mail\badmail 
adsutil.vbs set smtpsvc/1/pickupdirectory C:\SRVLOG\IIS\mail\pickup 
adsutil.vbs set smtpsvc/1/queuedirectory C:\SRVLOG\IIS\mail\queue

Options IIS

Display full errors messages

Error management in IIS

IIS Folders

Move custom error folders

custom errors folders

Change log path

IIS Log

Change temp path

change C:\inetpub\temp\appPools to C:\SRVLOG\IIS\TEMP\appPools (for example), require a system reboot to be taken

REG ADD HKLM\System\CurrentControlSet\Services\WAS\Parameters /v ConfigIsolationPath /t REG_SZ /d C:\SRVLOG\IIS\TEMP\appPools /f

move path C:\inetpub\temp\IIS Temporary Compressed Files: edit the file appPools\{appName}\{appName}.config and change the following line line to desired path

<httpCompression directory="C:\SRVLOG\IIS\TEMP\IIS Temporary Compressed Files">

history path

official doc: http://www.iis.net/configreference/system.applicationhost/confighistory

depend on service "Application Host Helper Service"

Application Host Helper Service

it is possible to interact with thoose saves with appcmd.exe which is in c:\system32\inetsrv

  • commands are :
appcmd list backup 			#list of backup available
appcmd add backup [{BackupName}] 	#create a new backup
appcmd delete backup {BackupName} 	#delete a backup
appcmd restore backup {BackupName}	#restore a backup

path can be changed in the file appPools\{appName}\{appName}.config

<system.applicationHost>
   <configHistory enabled="true"
      path="%SystemDrive%\inetpub\history"
      maxHistories="50"
      period="00:05:00" />
</system.applicationHost>