sKey1 = "#LoadModule deflate_module modules/mod_deflate.so" sKey2 = "#LoadModule ssl_module modules/mod_ssl.so" sKey3 = "#LoadModule vhost_alias_module modules/mod_vhost_alias.so" sKey4 = " DirectoryIndex index.html" skey5 = "#Include conf/extra/httpd-ssl.conf" skey6 = "#Include conf/extra/httpd-manual.conf" sNewLine = "LoadModule deflate_module modules/mod_deflate.so" sNewLine1 = "LoadModule ssl_module modules/mod_ssl.so" sNewLine2 = " I know a good life when i see it" sNewLine3 ="#LoadModule vhost_alias_module modules/mod_vhost_alias.so" sNewLine4 ="# PHP directives to allow PHP to run in server" sNewLine5 ="LoadModule php5_module D:/Apache.Webserver/Apache2.2.17.test/php/php5apache2_2.dll" sNewLine6 ="# add file type handlers for executing php scripts in type file example as below adding .html will now process php within a html file" sNewLine7 ="AddHandler application/x-httpd-php .php .html" sNewLine8 ="" sNewLine9 ="#create an .htaccess file and add this line to it:" sNewLine10 ="#AddType application/x-httpd-php .php .html .htm" sNewLine11 ="" sNewLine12 ="#The above configuration will enable PHP handling of any file that has a .php extension, even if there are other file extensions." sNewLine13 ="#For example, a file named example.php.txt will be executed by the PHP handler." sNewLine14 ="#To ensure that only files that end in .php are executed, use the following configuration instead:" sNewLine15 ="#" sNewLine16 ="# SetHandler application/x-httpd-php" sNewLine17 ="#" sNewLine18 ="" sNewLine19 ="# configure the path to php.ini" sNewLine20 ="PHPIniDir D:/Apache.Webserver/Apache2.2.17.test/php" sNewLine21 =" DirectoryIndex index.html index.php" sNewLine22 ="Include conf/extra/httpd-ssl.conf" sNewLine23 ="Include conf/extra/httpd-manual.conf" sFileName = "D:\Apache.Webserver\Apache2.2.17.test\conf\httpd.conf" Set objFS = CreateObject("Scripting.FileSystemObject") aContents = Split(objFS.OpenTextFile(sFileName).ReadAll, vbNewLine) Set objTS = objFS.OpenTextFile(sFileName, 2) For Each sLine In aContents bFound = False If InStr(1, sLine, sKey1, 1) = 1 Then wscript.echo "1: sLine=" & sLine bFound = True objTS.WriteLine sNewLine ' objTS.WriteLine sNewLine1 End If If InStr(1, sLine, sKey2, 1) = 1 Then wscript.echo "2: sLine=" & sLine bFound = True objTS.WriteLine sNewLine1 ' objTS.WriteLine sNewLine3 End If If InStr(1, sLine, sKey3, 1) = 1 Then wscript.echo "3: sLine=" & sLine bFound = True objTS.WriteLine sNewLine3 objTS.WriteLine sNewLine4 objTS.WriteLine sNewLine5 objTS.WriteLine sNewLine6 objTS.WriteLine sNewLine7 objTS.WriteLine sNewLine8 objTS.WriteLine sNewLine9 objTS.WriteLine sNewLine10 objTS.WriteLine sNewLine11 objTS.WriteLine sNewLine12 objTS.WriteLine sNewLine13 objTS.WriteLine sNewLine14 objTS.WriteLine sNewLine15 objTS.WriteLine sNewLine16 objTS.WriteLine sNewLine17 objTS.WriteLine sNewLine18 objTS.WriteLine sNewLine19 objTS.WriteLine sNewLine20 ' objTS.WriteLine sNewLine3 End If If InStr(1, sLine, sKey4, 1) = 1 Then wscript.echo "4: sLine=" & sLine bFound = True objTS.WriteLine sNewLine21 ' objTS.WriteLine sNewLine3 End If If InStr(1, sLine, sKey5, 1) = 1 Then wscript.echo "5: sLine=" & sLine bFound = True objTS.WriteLine sNewLine22 ' objTS.WriteLine sNewLine3 End If If InStr(1, sLine, sKey6, 1) = 1 Then wscript.echo "6: sLine=" & sLine bFound = True objTS.WriteLine sNewLine23 ' objTS.WriteLine sNewLine3 End If if not bFound then wscript.echo "7: sLine=" & sLine objTS.WriteLine sLine End If Next objTS.Close 'Set objTS = Nothing 'Set objFS = Nothing fKey1 = "display_errors = Off" fKey2 = "doc_root =" fKey3 = "; extension_dir = ""ext""" fKey4 = ";extension=php_mysql.dll" fKey5 = "mysql.default_port =" fKey6 = ";session.save_path = ""/tmp""" fKey7 = "session.cookie_lifetime = 0" sNewLine1 = "display_errors = On" sNewLine2 = "doc_root = D:\Apache.Webserver\Apache2.2.17.test\htdocs" sNewLine3 = "extension_dir = ""D:\Apache.Webserver\Apache2.2.17.test\php\ext""" sNewLine4 = "extension=php_mysql.dll" sNewLine5 = "mysql.default_port = 3309" sNewLine6 = "session.save_path = ""D:\Apache.Webserver\Apache2.2.17.test\htdocs\sessions""" sNewLine7 = "session.cookie_lifetime = 1" sFileName = "D:\Apache.Webserver\Apache2.2.17.test\php\php.ini" Set objFS = CreateObject("Scripting.FileSystemObject") aContents = Split(objFS.OpenTextFile(sFileName).ReadAll, vbNewLine) Set objTS = objFS.OpenTextFile(sFileName, 2) For Each sLine In aContents bFound = False If InStr(1, sLine, fKey1, 1) = 1 Then wscript.echo "1: sLine=" & sLine bFound = True objTS.WriteLine sNewLine1 ' objTS.WriteLine sNewLine1 End If If InStr(1, sLine, fKey2, 1) = 1 Then wscript.echo "2: sLine=" & sLine bFound = True objTS.WriteLine sNewLine2 ' objTS.WriteLine sNewLine1 End If If InStr(1, sLine, fKey3, 1) = 1 Then wscript.echo "3: sLine=" & sLine bFound = True objTS.WriteLine sNewLine3 ' objTS.WriteLine sNewLine1 End If If InStr(1, sLine, fKey4, 1) = 1 Then wscript.echo "4: sLine=" & sLine bFound = True objTS.WriteLine sNewLine4 ' objTS.WriteLine sNewLine1 End If If InStr(1, sLine, fKey5, 1) = 1 Then wscript.echo "5: sLine=" & sLine bFound = True objTS.WriteLine sNewLine5 ' objTS.WriteLine sNewLine1 End If If InStr(1, sLine, fKey6, 1) = 1 Then wscript.echo "6: sLine=" & sLine bFound = True objTS.WriteLine sNewLine6 ' objTS.WriteLine sNewLine1 End If If InStr(1, sLine, fKey7, 1) = 1 Then wscript.echo "7: sLine=" & sLine bFound = True objTS.WriteLine sNewLine7 ' objTS.WriteLine sNewLine1 End If if not bFound then wscript.echo "8: sLine=" & sLine objTS.WriteLine sLine End If Next objTS.Close sslKey1 = "SSLCertificateKeyFile ""D:/Apache.Webserver/Apache2.2.17.test/conf/server.key""" sNewLine = "SSLCertificateKeyFile ""D:/Apache.Webserver/Apache2.2.17.test/conf/server.pem""" sFileName = "D:\Apache.Webserver\Apache2.2.17.test\conf\extra\httpd-ssl.conf" Set objFS = CreateObject("Scripting.FileSystemObject") aContents = Split(objFS.OpenTextFile(sFileName).ReadAll, vbNewLine) Set objTS = objFS.OpenTextFile(sFileName, 2) For Each sLine In aContents bFound = False If InStr(1, sLine, sslKey1, 1) = 1 Then wscript.echo "1: sLine=" & sLine bFound = True objTS.WriteLine sNewLine ' objTS.WriteLine sNewLine1 End If if not bFound then wscript.echo "8: sLine=" & sLine objTS.WriteLine sLine End If Next objTS.Close