When deploying a .NET web application with Crystal Reports you will need to install the appropriate crystal reports library on the server to use any reports you’ve built.
I recently ran into an issue where Crystal Reports Images (images in a report) would not show up on a new Windows 2003 Server. After extensive web research with no solution in sight I decided to try to solve the problem on my own.
To resolve my error I went into the Web Server(IIS) manager and performed the following steps:
1) Clicked on ‘My Website’ where I was using crystal reports
2) Clicked on ‘Handler Mappings’
3) On the right side under ‘Actions’ I selected ‘Add Managed Handler’
4) Request Path: CrystalImageHandler.aspx
5) Type: CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions…….
6) Crystal Reports Image Handler
7) Press OK Success!
I was able to track down this issue by looking at the URL for non-working images. All pointed to the following:
http://www.MySite/CrystalImageHandler.aspx?*****useless info******
As you can see, the system is trying to access a handler to read out images specified in the report.
I hope this solution can save you hours of potentially wasted time and frustration.
David Millar, Lead Developer Millar, as he is known around the office, is a rock-solid, workhorse coder. If anyone really understands what a chunk of code is doing it’s him. Family, friends, sports, and his wife are the most important things in life to him. He plays sports weekly and golf in the summer when he’s not busy hanging out with friends and family. Recently he got married to his wife Kate in a beautiful ceremony surrounded by friends and family on a perfect summer day. A humanitarian at heart, his positive demeanour is rattled most when “society makes decisions without considering more relevant information from the present”, and people “make self indulgent decisions that hurt society and everyone else”.
One thing that can be frustrating for any developer is when you run into a problem and despite millions of search results when searching for a resolution nothing seems to solve the issue. I thought I would share some simple solutions to two very frustrating WSS issues we’ve run into this past year.
The first issue is intermittent 403 Forbidden errors on a WSS (Windows Sharepoint Services) site. We were seeing anonymous users in our test environment who couldn’t use the website at all until an admin logged in. After someone had logged in then anyone could use the website with or without a login. What ended up being the problem was a permissions issue on the bin folder for the website. To fix this problem please follow the simple steps below.
Ensure all sub folders that are virtual directories on the site are using the same application pool as the root site. (This didn’t help me as everything was set properly, however I read countless posts of this causing problems for others)
Add read access on the bin folder for the account IUSR. (You don’t need to add read access to the files, which is somewhat confusing but none the less that protects the files from being downloaded)
Success!
If you have any other problems please post your questions/solutions below.
Continuing on, I also ran into a strange DCOM error popping up in Eventlog on most of our servers with WSS sites running. The error looks like this…
The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID {61738644-F196-11D0-9953-00C04FD919C1} to the user <serverName>\networkservice SID (S-1-5-21-<serviceSID>). This security permission can be modified using the Component Services administrative tool.
Needless to say, getting this error several hundred times a day in Eventlog is not ideal. The resolution is rather simple but not overly easy to explain. Please carefully follow the steps below.
Copy the GUID (In my case it was {61738644-F196-11D0-9953-00C04FD919C1})
Open the registry editor by running regedit
Click on ‘My Computer’ at the top then select Edit -> Find and Paste the Guid (remove the {})
You should see an application name in the right pane when the Guid is found – in my case this was “IIS WAMREG admin service”
Close the registry editor and open Component Services from Control Panel -> Administrative Tools
Expand Component Services, My Computer, DCOM Config and find the application name discovered above in step #4.
Right click on the the application name and select “Properties” then select the Security tab
The first block should be set to Customize – select edit on the right side.
Now add the service account (in my case this was network service) and add the appropriate access which in my case was “Local Activiation” (which you can see in the error above)
Success!
Please share this information as both of these errors can be both frustrating and a waste of time.
Once you’ve downloaded the latest files follow these steps below:
Install Apache
Network Domain: it doesn’t matter
Server Name: it doesn’t matter
Unzip PHP into c:\php
Install MySql
Install MySql Tools
Create a folder c:\websites (or call it what you want)
Go to My Computer -> Right Click Properties -> Advanced -> Environment Variables
Select Path -> Click Edit
Add a ;c:\php on the end
Restart your computer!
Browse to the Apache Folder (Should be in Program Files\Apache Software Foundation\Apache
Go into conf and open httpd.conf
Change the following and Save
ServerRoot (Should be set to your Apache folder – nothing should be changed here)
Listen (In the event you want your Apache WebServer to not run at localhost:80 – you can specify a specific ip/port here
In the LoadModule section you might want to enable rewriter_module (not necessary!)
DocumentRoot "C:\websites"
<Directory "C:\websites"> <– This is about ~15lines below the document root (REQUIRED CHANGE)
Under the DirectoryIndex save yourself some time and add index.php after index.html with a space separating them
All Done making configuration changes to Apache
Copy the index.html file in htdocs to c:\websites
Click on the Apache Server Monitor in your TaskBar and restart Apache (if you have any problems check the logs folder in the Apache directory)
Open your Web Browser and Browse to http://localhost – You should see ‘It Works’
If this failed to work – check the settings you’ve changed (typo’s will break things) also check the error logs in the apache\logs folder (Post any problems you can’t resolve in the comments)
Now that you have Apache working – lets get PHP working so you can start coding with php/mysql
Rename php.ini-distribution to php.ini
Open php.ini
Change the following and Save
max_execution_time (Suggested for development to increase to 60)
max_input_time (Suggested for development to increase to 120)
memory_limit (Suggested for development to increase to 256M – great for any type of video conversion)
error_reporting = E_ALL & ~E_NOTICE (Un-comment this and ensure other error_reporting lines are commented
display_errors = On
log_errors = On
session.save_path = "c:\tmp"
post_max_size = 16M (Suggested for development)
doc_root = (You can leave this blank)
extension_dir = "c:\php\ext" (Required)
upload_max_filesize = 16M (Suggested for development)
Un-comment the following extensions:
extension=php_curl.dll
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_mcrypt.dll
extension=php_mssql.dll
extension=php_mysql.dll
extension=php_openssl.dll
If you have access to an SMTP server configure SMTP
Re-open the httpd.conf for apache and add the following lines after the end of the LoadModule section
LoadModule php5_module "C:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/php"
Restart Apache
Create a file in c:\websites called test.php
Put <?php phpinfo(); ?> in the file and save
Access http://localhost/test.php
You should see a dump of all the information – All the extensions you’ve loaded above should have a section within the information displayed (If you can’t find mysql on the page for example then the .dll did not load properly – Verify your Environment Path variable (restart if you change it) and try again)
Don’t forget to look at your log files if you’re having problems – and if php says it can’t load a module that exists in a specific path then it’s likely an Environment Path issue.
We’ve been noticing a lot of traffic related to a new virus that has been attacking users/websites recently.
The virus works to exploit your system is several distinct ways.
An infected PC transmits FTP information to Gumblar.cn
Gumblar.cn connects to FTP’s submitted from infected pc’s and injects code into any php/html pages it finds
Any user visiting a site will have JavaScript run in their browser that does the following:
Loads obfuscated JavaScript to connects to gumblar.cn if your running windows and not infected
This in turn loads a nice piece of JavaScript that will load an SWF file
This SWF file is the virus payload – it contains a byteArray that will inject a virus onto the computer (I believe it’s another SWF file being loaded as the byteArray)
If this computer is running windows and has flash it will become infected
See Step #1
The JavaScript code you’re looking for will look something like this:
One thing to note in the above code is the words gumblar in plain text.
When it comes to cleaning your webhost up you should take the following steps.
Take your website down (turn the web server off – stop infecting your users)
Remove the FTP information from your PC
Change the FTP username/password on your webhost
Look for new files created (image.php, etc…) that shouldn’t be there
Now that you’ve removed the backdoor & changed the password you need to perform cleanup
Find any PHP or HTML pages injected with the virus code and remove it
Once you’ve done this – everything should start getting back to normal.
There have been some useful scripts posted in the comments about this virus at blog.unmaskparasites.com.
If you’ve had any success or troubles with this virus please post your comments below.
If anyone knows of an easy way to convert a byteArray that’s being passed to an ActionScript Loader back into readable text please leave me a comment below.
Have you ever thought about adding a Easter Egg to your website?
Using a Cheat Code such as the Konami Code you can now easily add one to your website using jQuery and the plugin that Trevor Morris developed. Get the plugin here.
The code is simple and easy to follow. Here’s a snippet to demonstrate how simple it is to perform a basic javascript action.