Sunday, 23 May 2010

Configuring Secure Virtual Host on Mac OS X

I had requirement to test my Flex Application, which I build for Raileasy in Secure environment.
It was quite difficult to configure my Mac, as I couldn't find a good post/ Blog or any article on it.
I asked few of my friends, who are using Mac for their development work and only Andy Allan gave me few tips and links:

Following are the articles helped me to set-up my Mac:
1) Mark Liyanage - article on Configuring mod_ssl on Mac OS X

2) Generating an SSL Certificate with Apache+mod_ssl

Here are the steps I took to configure my Mac (which are based on above articles):
First Open a terminal window and type in these commands:
  • sudo -s
  • cd /etc/apache2
  • mkdir ssl
  • chmod 700 ssl
  • cd ssl
  • gzip -c --best /var/log/system.log > random.dat
    (This step will create a file with the name and zip the file, which we will use to generate key)
  • openssl rand -rand file:random.dat 0

I was looking for a certificate to put on my local machine (which is self signed certificate) and to get that, here are the steps I took:
Issue following command in the already opened terminal window (which should be all in one line):

Before run the command get following questions answers ready:
***********
* Country Name (2 letter code) [AU]:GB
* State or Province Name (full name) [Some-State]:London
* Locality Name (eg, city) []:London
* Organization Name (eg, company) [Internet Widgits Pty Ltd]:Dev Co.
* Organizational Unit Name (eg, section) []:Development
* Common Name (eg, YOUR name) []:www.yourlocal.com
* Email Address []:admin@yourlocal.com
(It's important that you enter the host name of your web server exactly as it will be used later on in the "Common Name" field, like www.yourlocal.com or ssl.yourlocal.com.)
***********
COMMAND to run in terminal window:
openssl req -keyout privkey-2010.pem -newkey rsa:1024 -nodes -x509 -days 365 -out cert-2010.pem

Make sure that "TextEdit" is not running, then type these lines into the terminal window:
  • chmod 600 privkey-2001.pem
  • chown root privkey-2001.pem

On Mac Snow - Apache comes with default config file for SSL
Open following files in any text editor

/etc/apache2/httpd.conf (main config file for Apache)
/etc/apache2/httpd-ssl.conf

1) In ssl.config file look for
VirtualHost definition
You would see like this:
<VirtualHost _default_:443>

But above setting didn't work for me, I had to change it to like this, and I don't know the reason though, but it worked:
<VirtualHost www.yourlocal.com:443>

Change the DocumentRoot to the right root for your web site.
You might need to Add Directory access rights for the document root:
<Directory /sites/yoursite/wwwroot>
allow from all
Options +Indexes
</Directory>

Find the following and change them with right path and file name:
SSLCertificateFile "/etc/apache2/ssl/cert-2001.pem"
SSLCertificateFile "/etc/apache2/ssl/cert-2001.pem"

Save the file

You need to un-comment following line in httpd.conf file
#Include /private/etc/apache2/extra/httpd-ssl.conf

Save the file

from terminal window

run pwd command and make sure you are at
/etc/apache2/

run following commands:
apachectl stop
apachectl start
Now your server will provide secure access to your website.

The one thing I didn't understand was, by doing tis, all of my local website turned into secure websites.

But I was able to test my website under secure environment.

Thanks to the writers of above articles.

:)

Thursday, 20 May 2010

Flex Spy (fxSpy)

This is a nice component, if you are a Flex Developer:

I found out this component today, when Anuj showed me.

This is very impressive, and useful to play with styles like you can do with firebug.



Here is the Project:

http://code.google.com/p/fxspy/



And an article by Anuj as well:

http://www.anujgakhar.com/2009/09/05/triggering-flexspy-with-a-keyboard-shortcut/



Another one from some developer:

http://blogs.warwick.ac.uk/stevencarpenter/entry/flex-spy_live_component

Wednesday, 19 May 2010

Few helpful links for MAC

MAMP
http://www.mamp.info/en/index.html

SQLLite

http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man1/sqlite3.1.html


Installing Railo + Apache in Mac OSX

http://www.luismajano.com/category/getrailo/

Tuesday, 2 March 2010

Symlinks or Symbolic links in MAC

Here is the way and explanation on how to create symbolic links on Mac:

ln -s -i -v target linkname

where
  • -s means that I want to create a symbolic link
  • -i means that I will be prompted if the symlink already exists
  • -v means that I'll see a message confirming that the symlink was created
  • target is the path to the file or folder that I want to point to
  • linkname is the path and name of the symlink file that I want to create
For example, to create a symlink to the file /Users/username/Documents/test.txt, and place that symlink in my home directory, I would use this command:
ln -s -i -v /Users/username/Documents ~/doc

I found the above in following post:


Bob's blog 


Thanks to Bob for this post.

Saturday, 6 February 2010

Naat From Muhammad Ali Jahoori

कख सवाद न मिसरी अंदर, खंडा वि चख दिथियाँ (dithiyan )
पर एना सारियां चीजां नालों गलां सज्जन दियां मिठिया |
पर ओना सारियां चीजां नालों लबा सज्जन दियां मिठिया |
सुपने दे विच मिलया माहि ते मैं गल विच पा लईआं बावाँ,
डर दी मारी आख न खोलां, किते फेर विच्र्ड न जावां |
आन बसो मोरे नयनन मैं, मैं अखियाँ बंद कर लूँ,
न मैं देखू गेर को, न मैं तोहे देखन दूँ |
कजरा लागे किरकरो, मेरी आँखों से गिरता जाये
जिन नयनन मैं पिया बसे वहां दूजा कौन समाये,
मैं गल विच पा लईआं बावा,
औ डर दी मारी आख न खोलां, किते फेर विच्र्ड न जावां |
ते हिज्र तेरा जद पानी मंगे, ते मैं खू नयेना दे गेरा,
दिल चाहोंदा है तेनु सामने बिठा के अज दर्द पुराने छेर्रा
यार जीना दे विचड जावन ओ क्यों रोवन थोडा,
हर शे नालो जालम यारो जिस दा नाम विचोड़ा |
जीतन जीतन हर कोई खेड़े, तू हारान खेल फकीरा,
जीतन दा मूल कोडी पेंदा हारान दा मूल हीरा
(मियां साब दे कलाम दी तां कोई इन्तहा ही नहीं
और जीना वि पर्ददे जाओ )

Friday, 22 January 2010

Adobe ColdFusion 9 in parallel with Macromedia ColdFusion 6 (or 7,8)

I managed to install Adobe ColdFusion 9 on my machine when I was contracting in Exeter. First I managed to convince them to move forward to use CF9 and helped them by installing CF9 in parallel to Macromedia ColdFusion 6 on their DEV machines so they can test their existing code and compare between both versions, I also used CF9's excellent feature "Code Analyser" to analyse the existing code, and it was a great help:
Here are the steps I took to Install CF9 and get it working:
(I achieved this by going through few blogs: I can't remember the url's, but update here)

CF9 Installation Guide
These are the steps you need to take to install CF9 in parallel to CF6 and uses Apache web server:
1) Download CF9 Trial version from https://www.adobe.com/cfusion/tdrc/index.cfm?product=coldfusion
2) Stop CF 6 Admin service (Macromedia JRun Admin Server ) (if running), and also turn Start-up Type to Manual
3) Stop CF6 Cfusion service (Macromedia JRun CFusion Server)
4) Stop CF6 Default service (Macromedia JRun Default Server) (if running), and also turn Start-up type to Manual
5) If any other CF 6 services are running, like ODBC, Search/ Verity – turn them off
6) Find the CF 9 installer and run it by double clicking it
7) Opt for the trial version
8) (IMP) Change the Folder (Default option of Jrun4) to CF9Jrun4 as Jrun4 is being used by CF 6
9) Opt for installation type Multi-Server (2nd Option), (That’s what we want in here)
10) And Opt for in-built Application web server (You don’t want to play with existing Apache web server config file)
11) You don’t need Any of ODBC, .Net services except documentation (But you can make your own call here), I would say don’t select them for this test environment.
12) Let it install and finish, if you get any message of failure, look at the log, normally you get warning about some folders can’t be removed, you can ignore this.
13) Open jrun.xml from C:\CF9Jrun4\servers\admin\SERVER-INF
a. Find “jrun.servlet.http.WebService” service and change port to 8001 (or any no, which is not being used by CF6)
b. Find “jrun.servlet.jrpp.JRunProxyService” service and change port to 51002 (or any no, which is not being used by CF6)
14) Open jrun.xml from C:\CF9Jrun4\servers\cfusion\SERVER-INF
a. Find “jrun.servlet.http.WebService” service and change port to 8383 (or any no, which is not being used by CF6)
b. Find “jrun.servlet.jrpp.JRunProxyService” service and change port to 51000 (or any no, which is not being used by CF6)
15) Save both files and re-start your machine
16) Open “Jrun Launcher” from Start/All Programs/Adobe/Coldfusion 9 (multi server version)/
a. Start Admin server
b. Start Cfusion server
17) Go To Start/All Programs/Adobe/Coldfusion 9 (multi server version)/ and right click on “Adobe ColdFusion 9 Administrator” and click on properties and change port to 8383 from 8300
18) Go To Start/All Programs/Adobe/Coldfusion 9 (multi server version)/ and right click on “JRun Management Console” and click on properties and change port to 8001 from 8000
19) Go To Start/All Programs/Adobe/Coldfusion 9 (multi server version)/ and run “Adobe ColdFusion 9 Administrator” by clicking on it
20) Enter admin password and let it run for first time and follow the on screen instruction
21) When it is ready – click ok
22) You will see CF Admin screen, now set up
a. Mail server
b. Custom Tags
c. CFX Tags
d. Data Sources
e. Or any other settings like debugging, mappings if you want to.
By loading a “*.car” file or manually
23) Open Apache Config file (httpd.conf), and go to the virtual host section of the web site you want to run under CF9 and copy and paste following three lines after the end of alias or before the
JRunConfig Apialloc false
JRunConfig Serverstore "C:/CF9Jrun4/lib/wsconfig/1/jrunserver.store"
JRunConfig Bootstrap 127.0.0.1:51000

Make sure you got the right path, though you won’t find any folder after lib and you shouldn’t be worried about this.
Save it and re-start Apache web server.


That’s it, happy CF9 server experience 

Friday, 1 January 2010

Happy New Year

2009 was a mixed year for me, I got hit by recession, Emojo was closed because of this, the co I worked for almost a year and half. I started contracting, which I was thinking from quite a long time. On 21st Dec I joined Kingston Communications - Exeter as ColdFusion contractor, initially the contract is of 4 weeks with a possible extension. Lets see how it goes. I have been in talks with 2ndByte based at Godalming, Guildford, I might start here in last week of Jan.

I am looking forward to be more productive in 2010.

Best wishes to all.