WIMP on Windows 7 – Windows, IIS, MySQL and PHP

In the past it was always a bit challenging to get WIMP installed, at least for me it was. I ended up using installers for PHP and even then which version would I use, fast cgi or that other one (can’t seem to remember the name, it’s been a while). Recently, I had to create an environment that uses WIMP. I had to take old data from MSSQL 2008 and convert it over to MySQL. I tried to use MySQL Workbench’s migration tool but it failed on 5 of the tables. So my plan is to use PHP and somehow import the data over. Well I would need to use SQLSRV driver for PHP5 to connect to MSSQL 2008. Enough of the back story, here’s what I did.

First off, I am using Windows 7 Professional 64bit. You will need to enable IIS in the Control Panel by turning it on in the Windows features. Here’s what mine looks like.

windows_features

You don’t need all of the checked features but you will need CGI under Application Development Features – this is how PHP will run within IIS. Leave the others default. Once installed, there may be new Windows updates related to what you just enabled. It’s a good idea to patch them up. The version of IIS I’m running during time of writing is 7.5. Screenshots and feature location may differ from your version.

Now download PHP5 the version you wish to use from http://windows.php.net/download. What I downloaded and used was 5.4.27. I needed a version from 5.4 because of the SQLSVR I mentioned earlier. I haven’t tested to see if the driver works on PHP5.5+. Also, you want to download the NTS (non-thread safe) version. In my case, it’s VC9 NTS for PHP5.4.27. Unzip the file and put it in C:PHP5. You can put it anywhere but I just wanted it more accessible.

Inside this folder, look for a file called php.ini-development. Copy and rename the file to php.ini. I chose development because my environment is for development only. There is a production version with slightly different settings.

Here are the entries that need modification within the php.ini files.

  • extension_dir = “ext” (enable this if you’re going to use extensions)
  • fastcgi.impersonate = 1 (enable this)
  • cgi.fix_pathinfo=1 (enable this)
  • cgi.force_redirect = 1 (enable this)

Save the file and close it.

Now we need to let IIS know how to serve PHP pages. Open up IIS Manager. Highlight the entire Server to apply to all websites hosted or specific ones – in this case, highlight Default Web Site. Next, double-click on Handler Mappings and Add Module Mappings. Here’s how mine looks.

module_mapping

Restart IIS. Create a test file using phpinfo(). You should see something like this if all is in working order.

phpinfo

To install MySQL, just download an installer from http://dev.mysql.com/downloads/windows/installer. The great thing about the installer is that it comes with other goodies such as MySQL Workbench and connectors such as ODBC (which I needed to get the migration tool from Workbench to connect to MSSQL server). If you are going to use MySQL, don’t forget to enable the extension(s) in the php.ini file. You can find more detailed instructions from http://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/using-fastcgi-to-host-php-applications-on-iis.

Amazon S3 and Glacier with Cloudberry S3 Explorer

I’ve been using Amazon S3 service for quite some time. It’s a cost effective service for backing up files in the cloud. You pretty much pay what you use. I mainly use S3 for backing up my photos – both digital and scanned. At the time I wrote this post (June 2013), I am using around 35GB of space. For the space, Amazon is charging me under $3 per month. There are other costs like bandwidth and requests but my bill for May 2013 was $3.30. So in 1 year, if my storage size doesn’t grow, I would have paid under $40. Not bad considering that they are storing files I can’t afford to lose. I also have local back ups.

I also use Amazon Glacier. This service is similar to S3 but it’s more for archiving purposes. Unlike S3, where files are readily available, files stored in Glacier require a few hours of waiting time before the files can be accessed and download. For this reason, this service is cost is a lot more lower than S3. I use this service to archive old family videos that I’ve captured from VHS, High8, and DV. Video files can get large but at the cost of a penny ($0.01) per GB, it’s worth using specially having a backup in the cloud. So as an example, based on May 2013, I have about 38GB of files stored with Glacier. Amazon charged me $0.54 – includes storage and requests fees.

So how do I get all my files into Amazon servers? Well, there’s a great software developed by Cloudberry calledS3 Explorer. It’s very easy to use. It works similarly to FTP client software. All you have to do is enter your login credentials for Amazon. You will get 2 window panes. The left will be your local. So you can browse your computer for the files you want to upload. The right pane is where you select your Amazon account from the drop down. It will then display your directory structure in Amazon. Just like the left pane, you can browse around to a location where you want to store the files. You can click and drag the files over or highlight the files you want to back up and click on the Copy button above. A window pane in the bottom will appear to display the transfer status. Not only is it easy to use, it’s also free.

After a few months of using the free version, I got a license for their pro version. I wanted to get more customization and play with the IAM manager. The multithreading upload is a great feature as well. I do many large file uploads and wanted to take advantage of this feature. You can check out the comparison chart.

I highly recommend using using Amazon’s cloud storage service. I also highly recommend using Cloudberry S3 Explorer with it. They are great together.

My first attempt with Windows Server 2012

I was able to get a license for Windows Server 2012 from Website Park. So I tried it on my home server. The installation was fairly quick. I was never a fan of the Metro UI but I had to surpass my dislikes if I wanted to try the new server OS. With SSD and 8GB of ram, the OS was very responsive. The look and feel is more elegant compared to Windows Server 2008. It even recognized my Adaptec 6805 raid card during the installation – odd that Server 2008 didn’t.

So far the dashboard window is very helpful. It’s a window that has links to many of the common settings and configurations. I’ve also noticed that I didn’t have to install additional software from Intel so that my NIC cards can be teamed. Windows has a built-in teaming interface now. It even allows me to use a different brand of NIC (onboard NIC is a Realtek) along with my 2x Intel NICs – but I won’t. The task manager is more detailed as well. That’s all that I’ve noticed so far because I ran into a problem afterwards.

I started to install some drivers for components (USB3.0, Intel stuff, etc) though I didn’t need to based on the device manager recognizing everything. Then I enabled Hyper-V. This required a restart. Well this is what I saw after the restart.

wpid-IMG_20121016_225356

I never got in anymore. I’m not sure if the drivers I used to install for the components did this or if it was enabling Hyper-V. I was able to get in safe mode. I tried to uninstall the newly installed drivers/software for the components and disable Hyper-V but it wouldn’t let me. I don’t know too much about Windows since I’ve been using Apple for some time now and it was getting late, so I gave up and put Windows Server 2008 again. I will be trying again soon and hope to figure out what had happened. There are some features I’ve been wanting to try like storage pool, ReFS, Hyper-V and trim support, and supposedly overall management is more efficient and easier – we’ll see.

How to disable OpenCloud Security Malware/Spyware

My aunt’s PC got infected with a trojan virus. She called me and ask if she should use some kind of antivirus to clean her PC. I remember installing Microsoft Security Essentials and as she is describing the interface it didn’t sound familiar. I told her that the so called antivirus itself could be the problem. I came over to check it out and I was right. Somehow she clicked on something (very common) thinking it was something legit and installed it. I couldn’t get a screenshot right off her laptop coz it the trojan cranked up the resources to a point where it was nearly usable so I searched for a screenshot and here’s a sample.

opencloud

opencloud

I’m mostly on a Mac and when I’m behind my PC at home I usually am protected so I don’t know how to fix these things as well as I used to when I used only PCs. So I Googled and came up found what I thought to be solutions. The websites that came up gave solutions that involved downloading and installing proprietary tools. They also scare you into believing that you must manually edit your registry and if you screw up, you will mess up Windows… which is true, so you have to use their software to automatically remove it. It just didn’t look right.

So I kept researching about OpenCloud. It turns out it’s a malware/spyware. I figured I can use any free spyware software to try and remove it. The 2 that I remember using awhile back are Adaware and Spybot – Search and Destroy. In order to even do anything, you must boot into safe mode with networking by continuing to press the F8 button after your PC has been turned on. Unfortunately, Adaware will not install in safe mode, at least when I tried to it told me that I needed to boot up in normal mode which is not an option because it will execute the trojan. Spybot on the other hand will install in safe mode.

First thing you need to do after install Spybot is to update it just in case there are newer definitions available. Then back up your registry. Afterwards, you can scan for the malware and it should detect it. Once the scanning is complete, have it fix the problems. I would recommend scanning again. In my aunt’s case, the scanning took 19 minutes. It will vary from system to system.

Check the C:Users[username]AppDataRoaming folder. You will folders that were created by OpenCloud Security that should be deleted. You can tell by the weird names and the date modified. Also, you may not see the AppData folder because it’s hidden. You will have to go in your Folder Options and show the hidden files and folders.

Then run “msconfig” and go to the Startup tab. Search for anything suspicious. I disabled “Spyware Doctor” which runs an executable on the desktop. You may also find a bunch of weird named items similar to the folder names in AppData. I disabled them too. It’s probably better to disable all and go through the ones that look familiar and enable them.

You should be able to reboot to normal mode. There may be some shortcuts left behind that you can delete. Now this method only disables the trojan. I don’t believe it’s completely removed. I have yet to find out how to remove it.

As always, make sure you have a back up of your important files regardless of whether you have a problem with your PC or not. Not all solutions will work and can sometimes make things worse. So proceed with caution and the usual I will not be held responsible for any screw ups.

For those who keep getting viruses, malware/spyware, etc. please consider a different operating system like Linux or switch to a Mac. Unless you like having a broken PC or enjoy paying services like the Geek Squadhundreds of dollars.

Windows 2008 and MSSQL Server 2005 not allowing remote connections

If you think you checked every setting in MSSQL Server that allows remote connections, you may have missed the Windows firewall setting. I have installed MSSQL 2005 many times on Windows 2000 Server, 2003, and 2008 and never ran into the remote connection problem. What’s happening is I’m unable to connection using the Management Studio on another machine into the server.

  • Checked the Configuration Tools/SQL Server Configuration Manager
  • Checked SQL Browser service is running
  • Pinged the IP address
  • Checked the Surface Area Configurations and made sure it allowed local and remote connections using TCP/IP only

It turns out that Windows firewall didn’t add MSSQL to the exceptions list. So here’s how you do it. Run firewall.cpl to bring up the Windows Firewall settings. On the left click on “Allow a program through Windows Firewall”. Make sure you are on the “Exceptions” tab and click on “Add program…”. If it’s not on the list, browse for the sqlservr.exe. You will find this in [INSTALL_DIR]MSSQL.1MSSQLBinnsqlservr.exe.

I never had this issue before. Not sure what caused it. Maybe Windows 2008 SP2. The versions I’m using are Windows Server 2008 RC2 and MSSQL Server 2005 Standard.

Getting include files to work on Windows 2003

I recently been playing around with Windows 2003 because we are still running Windows 2000 Server at work and may be upgrading soon. Our ASP pages are using includes to our database connection page…

<!–#include file="some_folder/db_connection_file.asp" >

If you were to run a page with that code on a Windows 2003 server, you may get an error similar to…

Active Server Pages error ASP 0131
Disallowed Parent Path

To fix this error, I had to do the following:

  1. Create a new virtual directory of the folder that contains the files. We’ll call the virtual directory “example”.
  2. Update the include syntax to use virtual instead. So you’ll have something like
    <! #include virtual=example/some_folder/db_connection_file.asp >
    

You may get this error with javascripts as well if you have something like…

<script language=javascript src="../some_folder/my_script.js"></script>

You should update that syntax to something like…

<script language=javascript src=/example/some_folder/my_script.js></script>

I’m not a big Windows user anymore so I don’t know why it has to be done this way or know of a setting so that the old method still works. But those are the 2 changes I had to make on some of our websites to make them compatible with Windows 2003.