helicon zoo and mongrel service

Repository of web frameworks and applications for Microsoft IIS.
User avatar
Posts: 6
Joined: 12 May 2012, 22:14

helicon zoo and mongrel service

12 May 2012, 22:22

Hi

I just wanted to let you know that i am using your helicon zoo product and it is working great for ruby/rails so far...

However, for this certain application called fedena project i utilised all the settings using the IIS and webconfig but it was not rendering the pages properly...

When i used the program with mongrel service it was working great even if i set the mongrel service to port xxxx...IIS was still serving the pages on port 80...without having to specify the port. This means that the mongrel service was translating the pages very good and fast...

However, when I need to call only one service the pdf service i need to used the port in order for it to work. Thats the pdf function.

So was wondering probably it might be useful to incorporate the mongrel service rendering ability in helicon zoo application...

I do not know how easy or how viable this is...

However if you wish to see the operations of the website you can visit the one i set up at http://sms.ptws.edu.tt or http://sms.ptws.edu.tt:3000...

Its running on windows server 2008 R2, IIS 7.5, plesk panel 10.x.x , and your helicon zoo products.

User avatar
Posts: 27
Joined: 06 Mar 2012, 11:59

Re: helicon zoo and mongrel service

14 May 2012, 07:55

Hi.
Could you please provide web.config file. I’d like to see why doesn’t it work properly.
If you want to put mongrel behind IIS, please open C:\Windows\System32\inetsrv\config\applicationHost.config
find <heliconZooServer> and add the following line:

Code: Select all
<engine name="mongrel.http" fullPath="%SystemDrive%\Ruby18\bin\ruby.exe" arguments="%SystemDrive%\Ruby18\bin\mongrel_rails -c &quot;%APPL_PHYSICAL_PATH%&quot; -e %RACK_ENV% -a %HOST% -p %PORT% start" transport="tcp" protocol="http" />

User avatar
Posts: 6
Joined: 12 May 2012, 22:14

Re: helicon zoo and mongrel service

14 May 2012, 23:49

Ok after i turn off Mongrel service to my surprise the rail application was rendering the pages effectively as fast as well. But initially it was not doing this.

Anyhow this is the web.config file:

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>

    <heliconZoo>
      <!-- These settings are applied when IIS application pool uses 32-bit CPU mode -->
<application name="rails.project">
   <environmentVariables>
      <!--
          Deploy file includes the most common commands required to prepare application before launch (bundle install, migrations etc.)
          It is also possible to specify here any script which evenually will be run by rubyw.exe.
          -->
      <!-- <add name="DEPLOY_FILE" value="deploy.rb" /> -->
      <!-- <add name="DEPLOY_LOG" value="log\zoo-deploy.log" /> -->

      <!-- By default we run Rails in production mode -->
      <add name="RACK_ENV" value="development" />
   </environmentVariables>
</application>
</heliconZoo>


<handlers>
   <!-- All transports below support Rails 2.3, 3.0 and 3.1 as well as any Rack-based application. Uncomment the one you wish to use. -->

   <!-- Ruby 1.9 over FastCGI -->
   <!--
      <add name="rails.project#x86" scriptProcessor="ruby.1.9.rack"  path="*" verb="*" modules="HeliconZoo_x86" preCondition="bitness32" resourceType="Unspecified" requireAccess="Script" />
      <add name="rails.project#x64" scriptProcessor="ruby.1.9.rack"  path="*" verb="*" modules="HeliconZoo_x64" preCondition="bitness64" resourceType="Unspecified" requireAccess="Script" />
      -->
   <!-- Ruby 1.8 over FastCGI -->

   <add name="rails.project#x86" scriptProcessor="ruby.1.8.pipe" path="*" verb="*" modules="HeliconZoo_x86" preCondition="bitness32" resourceType="Unspecified" requireAccess="Script" />
   <add name="rails.project#x64" scriptProcessor="ruby.1.8.pipe" path="*" verb="*" modules="HeliconZoo_x64" preCondition="bitness64" resourceType="Unspecified" requireAccess="Script" />


   <!-- Ruby 1.9 over HTTP, using Thin as a back-end application server -->
   <!--
      <add name="rails.project#x86" scriptProcessor="ruby.1.9.rack"  path="*" verb="*" modules="HeliconZoo_x86" preCondition="bitness32" resourceType="Unspecified" requireAccess="Script" />
      <add name="rails.project#x64" scriptProcessor="ruby.1.9.rack"  path="*" verb="*" modules="HeliconZoo_x64" preCondition="bitness64" resourceType="Unspecified" requireAccess="Script" />
      -->
</handlers>
        <httpRedirect enabled="false" destination="http://sms.ptws.edu.tt:3000" />




</system.webServer>
</configuration>





So i first used a redirect to get the site to be easier to remembered but i did not like how the 3000 was looking at the end of the link so took it off.


The site is working well except the wkhtmltopdf is not working. When the application calls the pdf writer it gives an error attached is internal 500 error i received. However if i used mongrel service at port 3000 it calls the pdf writer and forms the pdf file with out any problems what so ever.

and fast as well.

So I have a question what does the script provide actually do...Do I still have to specify a port or does it use port 80 but just use the mongrel service to render the rail applications.

I am going to try it ...so I guess i will know.

Ritchie

User avatar
Posts: 6
Joined: 12 May 2012, 22:14

Re: helicon zoo and mongrel service

15 May 2012, 00:17

Ok so i inserted the code..but the site is still running I am happy to report independent still of the mongrel service on port 3000 that is currently disabled...

However when i tried to generate the pdf i got a different error as compared to before. This could probably help in determining the cause.

I just realised that mht files are not uploaded sorry placing both files here...in pdf

Internal server error.pdf is the initial error

Internal server error 2.pdf is after i made the change to the applicationhost.config file.

both placed in a zip file


Ritchie
Attachments
ISE.zip
Internal Server Errors.
(55.73 KiB) Downloaded 1447 times

User avatar
Posts: 6
Joined: 12 May 2012, 22:14

Re: helicon zoo and mongrel service

16 May 2012, 08:28

Just to update...Uploading pictures and reading pdf is not working under IIS...Is there a setting i have to set in the webconfig file to enable this.

I am using wkhtmltopdf and ImageMagick plugin.

Any Help would be appreciated.

I set it back to the ruby mongrel service on port 3000..and pdf and image working..

I remove the setting in the applicationhost config file.



Ritchie

User avatar
Posts: 27
Joined: 06 Mar 2012, 11:59

Re: helicon zoo and mongrel service

17 May 2012, 08:59

Hello.
Could you please provide examples of non-working requests as well as the Ruby code which processes PDF files and fails.
How do you run Mongrel? Do you run it manually? Because when you do so, the process is run with the same privileges as your Windows user account has, but in case of IIS + Plesk, user account which runs your application is very limited. It must have all required NTFS permissions to access folders related to the PDF processor.
Thank you.

User avatar
Posts: 6
Joined: 12 May 2012, 22:14

Re: helicon zoo and mongrel service

18 May 2012, 23:25

I run Mongrel as a service

Code: Select all
c:/Ruby18/bin/mongrel_service.exe" service single -e production -p 3000 -a 0.0.0.0 -l "log/mongrel.log" -P "log/mongrel.pid" -c "C:/inetpub/vhosts/cblengineering.co.tt/fedena" -t 0 -r "public" -n 1024


The program uses WikedPDF

Code: Select all
WickedPdf.config = {
    :wkhtmltopdf => "C:/inetpub/vhosts/cblengineering.co.tt/fedena/pdf/wkhtmltopdf.exe",
   #:exe_path => "C:/inetpub/vhosts/cblengineering.co.tt/fedena/pdf/wkhtmltopdf.exe",
    :layout => "pdf.html",
    :margin => {    :top=> 40,
                    :bottom => 20,
                    :left=> 30,
                    :right => 30},
    :header => {:html => { :template=> 'layouts/pdf_header.html.erb'}},
    :footer => {:html => { :template=> 'layouts/pdf_footer.html.erb'}}
    #:exe_path => '/usr/bin/wkhtmltopdf'


Code: Select all
def profile_pdf
    @employee = Employee.find(params[:id])
    @gender = "Male"
    @gender = "Female" if @employee.gender == false
    @status = "Active"
    @status = "Inactive" if @employee.status == false
    @reporting_manager = Employee.find(@employee.reporting_manager_id).first_name unless @employee.reporting_manager_id.nil?
    exp_years = @employee.experience_year
    exp_months = @employee.experience_month
    date = Date.today
    total_current_exp_days = ([email protected]_date).to_i
    current_years = total_current_exp_days/365
    rem = total_current_exp_days%365
    current_months = rem/30
    total_month = current_months if exp_months.nil?
    total_month = exp_months+current_months unless exp_months.nil?
    year = total_month/12
    month = total_month%12
    @total_years = current_years+year if exp_years.nil?
    @total_years = exp_years+current_years+year unless exp_years.nil?
    @total_months = month
    @home_country = Country.find(@employee.home_country_id).name unless @employee.home_country_id.nil?
    @office_country = Country.find(@employee.office_country_id).name unless @employee.office_country_id.nil?
    @bank_details = EmployeeBankDetail.find_all_by_employee_id(@employee.id)
    @additional_details = EmployeeAdditionalDetail.find_all_by_employee_id(@employee.id)
    render :pdf => 'profile_pdf'
         
           
    #    respond_to do |format|
    #      format.pdf { render :layout => false }
    #    end
  end


The application is on sms.ptws.edu.tt using IIS username admin and password admin123 you can try it there..

then use it using sms.ptws.edu.tt:3000 using mongrel Service and the pdf and image works.

Also the information on the mongrel service you provided earlier how does that work....can you give me some more information on utilising this method.

Ritchie

User avatar
Posts: 27
Joined: 06 Mar 2012, 11:59

Re: helicon zoo and mongrel service

22 May 2012, 06:40

Hello.
I can see it throws 500 error, but for some reason that’s default IIS error page. Helicon Zoo comes with custom designed errors page, so there is possibility you get problem on some other level.
Did you check NTFS permissions? I’m pretty sure Mongrel is run with wider permissions. One of the previously sent errors contained the following:
C:/inetpub/vhosts/cblengineering.co.tt/fedena/pdf/wkhtmltopdf.exe --
header-html file:///C:/Windows/Temp/wicked_header_pdf_992_0.html --footer-html
file:///C:/Windows/Temp/wicked_footer_pdf_992_0.html --margin-top 40 --margin-bottom
20 --margin-left 30 --margin-right 30 -q - - ***************

As far as I understand it outputs into C:/Windows/Temp/wicked_header_pdf_992_0.html, which is a system folder and isn’t accessible for IIS application pool identities.
Please check all the paths the wkhtmltopdf.exe tool needs and extend permissions for the user, running application pool. I can see the application pool name is plesk(default)(2.0)(pool). As an experiment try and create a new pool, make the web-site to use it and select Windows user with rich system permissions to run the pool.

User avatar
Posts: 6
Joined: 12 May 2012, 22:14

Re: helicon zoo and mongrel service

22 May 2012, 08:45

Ok well I can confirm after changing the application pool to fedena with rich permissions (admin) I was able to get photo upload for users to work.

however the pdf still not working this is error.

attached in the zip file.
Attachments
pdferror.zip
(12.06 KiB) Downloaded 1438 times

User avatar
Posts: 27
Joined: 06 Mar 2012, 11:59

Re: helicon zoo and mongrel service

22 May 2012, 12:02

Are there any errors in other log files? Please try and execute that PDF generation command manually.

Return to Helicon Zoo

Who is online

Users browsing this forum: No registered users and 2 guests