Installing Apache on Windows 2008

I would like to share my experiences with Apache installation on Windows 2008 Server.
It's not a easy drive when you are installing deploying your open-source application on Microsoft Windows 2008 Server. There was a nasty UAC - User Account Control which makes it difficult to configure Apache if we don't know about UAC on Windows 2008.

So if we are installing Apache on Windows 2008 then first thing to take care is go to Control Panel > User Accounts > Enable or Disable UAC. Un-check the checkbox and Finish wizard. It will require a reboot. Once it is done Apache should be able to start without any problem. If you don't do that it gives really wired error which is "Unable to open logs" which really does not make any sense that why this is happening.

Tags: ,

Generating 2048-bit CSR with OpenSSL

As computer processing power is increasing everyday, so breaking 1024-bit private key algorithms will be possible by 2011. So we will need to generate minimum 2048-bit RSA Private Keys for new SSL Certificates or renewals.

I have recently faced similar case while I had given older CSR which I gave last year for the renewal to GoDaddy and it didn't worked due to security reasons.

We need to simply regenerate Private Key and CSR with the help of following OpenSSL command:

 openssl req -nodes -newkey rsa:2048 -keyout new-digitss.key -out new-digitss.csr

This will generate 2048-bit key file and after that it will ask few basic information about the entity being certified. Private Key file generated with above command won't have secret pass-phrase so it won't be a problem deploying them on Windows based Apache server setups or either on Linux platforms. But if you really want to have pass-phrase then please refer to a previous post and replace it with 2048 or 4096 instead of 1024 which is being used in commands or just remove the "-nodes" from the above command which will ask for a pass-phrase.

Removing the "-nodes" option from the above mentioned openssl command will ask for a pass-phrase and encrypt the private key. This can increase security, but please note that the pass-phrase will be required each time Apache is started. In that case you need to get a un-secure private key for your Windows based Apache setup. It is as simple as writing following line of command on OpenSSL.

 rsa -in digitss.key -out unsecured.digitss.key

Above OpenSSL command will give unsecured private key which will have pass-phrase removed and so can be used with Windows based Apache setups.

More References:

For more detailed information on CSR generation please refer following post: (Just use 2048 or 4096 instead of 1024 to make it work)
http://blogs.digitss.com/apache/how-to-generate-certificate-signing-request-csr-file-with-apache-openssl/

See GoDaddy Help for detailed reason on: Why does my CSR need to be 2048 bit length?

CSR Generation Instructions for Rest of the Web-Servers: Certificate Signing Request (CSR) Generation Instructions

Tags: , ,

Export/Import CSV files with MySQL – No external tool required

Loading data from and to CSV or other TAB DELIMITED or similar file format is essential in day to day operation. With MySQL it is easy to load data into table using files and exporting data into CSV files is quite easy. No need to use any external tool it can be done right there from the query tool/command prompt, no specific GUI tool required.

Let's see how?

Exporting data as CSV file directly using simple MySQL Query

Simply add INTO OUTFILE [FILE_PATH] in your query and you are done. Here is a simple example:

SELECT * FROM [TABLE]
INTO OUTFILE 'X:/[FILE]'

Above statement uses default options for file export of result set of a query, but it is simple to override them. By default file will be TAB DELIMITED file. We can always override as showed in example below:

SELECT * FROM  [TABLE] INTO OUTFILE 'X:/[FILE]'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'

OR

SELECT * INTO OUTFILE 'X:/[FILE]'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM  [TABLE]

The beauty is it don't really matter where you place FROM TABLE clause, any of the style would work from above example. Don't forget that we can use all our complex join or where conditions which we really use with SELECT. Read the rest of this entry »

Tags:

AG_E_PARSER_BAD_PROPERTY_VALUE

Error Reporting in Silverlight is really bad. One of the most common error you see whiled developing a Silverlight application
is AG_E_PARSER_BAD_PROPERTY_VALUE.
This error mostly occurs due to following,

Version Change in assemly while you are working in the same code (i.e. you used version x initially and later on you changed it to version x + y ). Some Assemblies in 3rd party control when upgraded do not support few older properties or methods.

Your XAML code is referring to some event which is not present in the code behind file. Make sure that all XAML code has relevant code in code behind file. (Remove any unnecessary Events from XAML and CS files)

Your XAML code has repeated the same code again, causing a clash.

Hope this helps

Tags:

backup/restore MySQL db using MYSQLDUMP (quick reference)

Whether you are using MySQL with MyISAM or InnoDB or other database engine it is possible to backup/restore database using MYSQLDUMP utility. Though if you have all tables in MyISAM format MYSQLHOTCOPY is faster option but in any case MYSQLDUMP is a handly tool if you have got a mix set of tables.

Commands are very quick simple and easy to execute and can be made automated by a PHP or other script/tool.

How to backup using mysqldump?:

Before you use any of commands you have to move to mysql/bin directory of your MySQL installation and MySQL server should be up and running.

To backup all MySQL database on a server:

mysqldump --user=[USER] --password=[PASSWORD] -A > C:/BACKUP_PATH/BACKUP_TIMESTAMP.SQL

To backup specific MySQL database on a server:

mysqldump --user=[USER] --password=[PASSWORD] [DATABASE] > C:/BACKUP_PATH/BACKUP_TIMESTAMP.SQL

To backup certain tables in a MySQL database: Read the rest of this entry »

Tags:

All New Apple iMac with Intel dual/quad core processors

Hey can't wait to post this beautiful piece of Apple iMac; basically I am a Windows/*nix developer but got a chance to have hands on it while developing/testing iPhone compatible web application on it over iPhone SDK toolkit.

Apple iMac

Apple iMac

It's all together different experience when we use iMac. Basically I tried installing Mac OS X (Tiger) before few months back over Windows host using VMWare 6.x but was not able to do that successfully.

Downloaded a x86 version of the OS X from osx86project.org but there were some issues with hard-disk detection and couldn't come out of it and stopped trying on it further.

Tags: ,

VMWare Workstation: This virtual machine appears to be in use.

If you have ever encountered this error message anytime and it didn't worked out for you then remember there is a simple solution to it as easy as deleting a file/folder. I had this error earlier while either you reinstall a VMWare or you setup a new operating system. When I got this error again just recently I wanted it to plug it on as a post to my Wordpress blog so that it can help someone or myself in future..! :)

VMWare Workstation - This virtual machine appears to be in use.

VMWare Workstation - This virtual machine appears to be in use.

What we need to do is simply go to the folder where we have placed the physical files for the specific virtual machine and just delete the folders which are ending with "*.vmx.lck" and you are done.

For example in respect to current situation which we see in dialog box I needed to delete 2 folders SUSE Linux.vmx.lck and SUSE Linux.vmdk.lck. That's it and VMWare Workstation will be happy to play the Virtual Machine again without any problem.

Tags: ,

Upgrading to PHP 5.3..! – are you sure?

If you are planning to upgrade to PHP 5.3 from PHP 5.2.x then you must think twice before you really do it. There are few things you should take care of. Recently last week I tried upgrading one of the web-server to PHP 5.3 from PHP 5.2.9 and it was not a good idea which I came to know later on.

It is not only about deprecated functions which are creating Warnings or Notices but TCPDF library for generating PDF has created some wired problems due to which I have to roll back to the older version, as it was one of the crucial functionality of the application. It was not a planned version upgrade but it was a server migration and on the fly I tried upgrading PHP version also.

There are many functions and some of php.ini parameters which are deprecated, for complete list please refer http://www.php.net/manual/de/migration53.deprecated.php.

You can’t pass parameter while overriding “magic methods”; so if you ever had your __toString() method overridden with __toString($device = ‘SCREEN’) then it won’t work with PHP5.3. Other than that date_default_timezone() or similar timezone setup function also had some problems.

// This won't work with PHP5.3 and will work with 5.x
public function __tostring($device = "SCREEN")
{ ... }
 
// This will work with PHP5.3 and 5.x
public function __tostring()
{ ... }

So crux is if your applications are not ready for PHP5.3 it is not wise decision to upgrade and if you have to upgrade we should make sure to test whole application and all functionalities as with large development teams sometimes you never know who has used what all the time.

Steve Jobs and Bill Gates Together

Today it was Sunday and most of my time I spent on working for Server migration I did on Saturday for my Company's server. I tested multiple applications and found something wrong and corrected back the versions of Apache/PHP to fix something. But apart from all this most interesting thing today I went through was some of the YouTube videos of Steve Jobs and Bill Gates.

I went to YouTube from one of the funny videos of Steve Ballmer - Microsoft CEO and then one by one I got to the series of 11 videos where Steve Jobs and Bill Gates were together on a TV Show (D5 All things Digital) in 2007. It was awesome and I recommend it to go through it once for all.

I would love to pin them on my post.. and so here they are:

Steve Jobs and Bill Gates Together: Part 1

Read the rest of this entry »

Tags: , , ,

The following module was built either with optimizations enabled or without debug information + Silverlight

While coding with VS 2005/2008 you may encounter with an exception that " The following module was built either with optimizations enabled or without debug information" .

To Resolve this, first thing you can do is enable full debug info on your project. to do this,

- Right Click the Project which is giving the exception and Go to Properties

- Under the Build tab go to the Advance option

- Set Debug Info to Full as shown below ,

Advance Settings

If this doesnt resolve you problem,

Please remove all the project references from your project that gives this exception.

- Remove all files from the bin folder of your project.

- If bin folder file attributes are read only , remove the read only attributes on bin folder.

- Add the existing project references again

- Rebuild the project

This should resolve your problem.

Tags: ,