Archive for the ‘Internet Information Server 6’ category

How do I install PHP (64-bit) on a Windows Server?

October 15th, 2009
  1. Log into your server through Terminal Services or Remote Desktop Connection.
  2. Open a Web browser and load http://www.php.net/downloads.php
  3. Download the Windows PHP5.x ZIP package.
  4. Create a new directory, c:\PHP.
  5. Unzip the file you downloaded above into c:\PHP.
  6. Create a new directory, C:\PHP\phpsessions.
  7. Right click the C:\PHP folder and select Properties.
  8. On the Security Tab click Add.
  9. Type IUSR_COMPUTERNAME (where computer name is the name of your computer) in the text area, click Check Names and then click OK.
  10. Select the IUSR_COMPUTERNAME user, check the Full Control box and click OK.
  11. Open C:\PHP\php.ini-dist in Notepad.
  12. Within the file, make the following replacements:
    • Replace ;extension=php_mysql.dll with extension=php_mysql.dll
    • Replace ;session.save_path = “/tmp” with session.save_path = “C:\PHP\phpsessions”
    • Replace session.gc_maxlifetime = 1440 with session.gc_maxlifetime = 43200
    • Replace SMTP = localhost with SMTP = smtp.yourdomain.com
    • Replace ;sendmail_from = me@example.com with sendmail_from = user@yourdomain.com
  13. Save the file as C:\windows\php.ini.
  14. Copy C:\PHP\libmysql.dll and C:\PHP\ext\php_mysql.dll to the C:\windows\system32 folder.
  15. Open IIS located under Control Panel -> Administrative Tools -> Internet Information Services (IIS) Manager.
  16. Right click Web Service Extensions and select Add a new Web service extension.
  17. Enter php as the Extension Name, check Set extension status to Allowed and Click Add.
  18. Enter the path to C:\PHP\php5isapi.dll and click OK.
  19. Right click Web Sites and select Properties.
  20. On the ISAPI Filters tab, click Add.
  21. Enter php as the Filter Name, enter C:\PHP\php5isapi.dll as the Executable and click OK.
  22. On the Home Directory tab, click Configuration.
  23. Click Add.
  24. Enter C:\PHP\php5isapi.dll as the Executable, enter php as the Extension and click OK.
  25. On the Documents Tab, click Add.
  26. Enter index.php and click OK.
  27. A popup box may appear asking if you want to apply the settings to certain websites. Choose specific websites to enable PHP on or Select All and click OK.
  28. Right click your Computer Name, expand All Tasks and click Restart IIS.
  29. Choose Restart IIS from the dropdown menu and click OK.

*Make sure the permissions to your PHP folder have “NETWORK SERVICE”, “IUSR_*”, “SYSTEM” included.* If not php will not load!

Updating Cpanel to Perl 5.8.8

January 7th, 2009

You may notice that if you attempt an easyapache update in Cpanel that you run into the following issue;

Premature end of script headers: /usr/local/cpanel/whostmgr/docroot/cgi/
easyapache.pl: Please check   /  usr /  local /  cpanel /  logs /  error_log  for the exact error.

This indicates that you have either a bad install or an out of date instance of Perl. You can correct this by doing the following;
SSH into the vps  / server and do the following;

cd /

wget http://layer1.cpanel.net/perl588installer.tar.gz

tar -xvzf perl588installer.tar.gz

cd ./perl588installer

./install

cd /

rm -rf ./perl588installer

rm ./perl588installer.tar.gz

rm -f /home/*/.cpanel-datastore/_usr_bin_perl_-v

All done!

Use Task Scheduler to restart IIS (windows 2000/2003)

December 31st, 2008

This step-by-step article describes how to use Iisreset.exe and Task Scheduler to schedule Internet Information Services (IIS) 5.0 and 6.0 to restart.

To schedule IIS to restart on the local computer, follow these steps:

1. Click Start, point to Settings, and then click Control Panel.

2. Double-click Scheduled Tasks.

3. Double-click Add Scheduled Task, and then click Next.

4. Click Browse, navigate to the %SystemRoot%\System32 folder, click Iisreset.exe, and then click Open.

5. Either accept the default name that is displayed in the Type a name for this task box or type the name that you want to use.

6. Under Perform this task, click the interval that you want to use for this task, and then click Next.
7. If you chose to schedule a daily task, a weekly task, a monthly task, or a task that runs only one time in step 6, specify the time and the day when you want the task to run, and then click Next.

8. Type the user name and the password of a user account in which you want to run the task, and then click Next.

This account must be a member of the Administrators group. You must type the user name by using the following format, where domain is the domain name and username is the user account in which you want to schedule the task:

domain\username

9. Click to select the Open advanced properties for this task when I click Finish check box, and then click Finish.

10. Click the Task tab.

11. At the end of the command line that is displayed in the Run box, insert a space, type /restart, and then click OK.

For example, to stop and restart IIS services on the local computer, the command line that is displayed in the Run box should look similar to the following command line, where drive is the drive on which Windows is installed:

drive:\winnt\system32\iisreset.exe /restart

NOTE: You can use other Iisreset.exe parameters in combination with /restart. For example, to restart the computer if an error occurs less than one minute after the Internet services attempt to start, use the /rebootonerror parameter and the /timeout:value parameter. In this scenario, the command line that is displayed in the Run box looks similar to the following command line:
drive:\winnt\system32\iisreset.exe /restart /rebootonerror /timeout:60

Alternatively, if you want to schedule the computer to restart, use the /reboot parameter. In this scenario, the command line that is displayed in the Run box looks similar to the following command line:
drive:\winnt\system32\iisreset.exe /reboot

12. Verify that the new task is displayed in the Scheduled Tasks window, and then close the Scheduled Tasks window.

The ASP.Net Tab is Missing on 64-bit Windows

December 11th, 2008

Taken from http://www.iisadmin.co.uk/?p=15

Here’s another oddity which I stumbled upon recently whilst working on a 64-bit Windows 2003 machine so I thought I’d share it here.

I installed IIS on a newly installed 64-bit Windows 2003 R2 server and needed to configure it to support Asp.Net 1.1 applications. In order to do this I had to configure IIS to run in 32-bit mode as documented in this KB article How to switch between the 32-bit versions of ASP.NET 1.1 and the 64-bit version of ASP.NET 2.0 on a 64-bit version of Windows.

Once I had done this I went back into the Properties of the Default Web Site and I noticed that the ASP.Net tab seemed to have mysteriously vanished. After closing and re-opening and then checking the MMC a few times I still couldn’t find the ASP.Net tab. So I followed the same procedure on another 64-bit Windows 2003 server and got the same results – the Asp.Net tab disappeared after I configured the Enable32bitAppOnWin64 metabase property.

If you’ve got a 64-bit server you can test this out for yourself by following these steps.

Install IIS 6.0 on the server and then open the Properties of the Default Web Site. You should see the Asp.Net tab as shown here

Fig. 1

If you now run the following command at this point :

cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs get W3SVC/AppPools/Enable32bitAppOnWin64

you should see that it returns a value of false as shown below, which shows that IIS is currently running in 64-bit mode.

Fig. 2

In order to configure IIS to run in 32-bit mode you need to execute this command :

cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1

You should now see that it returns a value of True as shown here. This means that IIS is now running in 32-bit mode on your server.

Fig. 3

If you then go back to look at the properties of the Default Web Site you will see that the ASP.Net tab has gone.

Fig. 4

I have to admit that this had me puzzled at first until I found a reference to this KB article – The “ASP.NET” tab of IIS Manager does not appear when you retrieve the properties for a virtual directory in IIS Manager

Apparently, this anomaly is due to the fact that the 32-bit version of IIS Manager is incompatible with 64-bit machines running Asp.Net

What this means in practical terms is that if you have a 64-bit server running IIS in 32-bit mode and you need to change the version of the .Net framework on a particular web site then you need to use the ASP.NET IIS Registration Tool (Aspnet_regiis.exe) to make those changes.

Trouble updating to MySQL 5 in Cpanel.

September 4th, 2008

I recently ran into an issue where I would update the Cpanel instance using the:

/scripts/upcp –force

To update Cpanel, as I normally do. However I noticed that when I did it this time, It did not update MySQL. Thinking that’s fine, I’ll just check the MySQL 5.0 button in Main >> Server Configuration >> Tweak Settings. However the option to update to version 5.0 was not there…. This was puzzling indeed.

I then ran /scripts/mysqlup –force . That didn’t help either, version 4 was still there and no sign of version 5. I then tried to see what rpm’s where in place;

rpm -qa | grep My

Nothing but MySQL 4……. Still at a complete loss.

Then I finally looked at the config file for cpanel;

/var/cpanel/cpanel.config

Look at that:

maxemailsperhour=0
maxmem=128
myname=cpaneld
mysql-version=5.1
mysqldebug=0
nativessl=1
nobodyspam=0
nouserbackupwarn=0

MySQL 5.1????????? Changing this to 5.0 and then running the /scripts/mysqlup --force
command fixed this issue. I now can select MySQL 5.0 by going to  Main >> Server Configuration >>
Tweak Settings.

Looks like the new update of Cpanel has borked the MySQL install.