W2k3 Apache Resin - Code displays

5 views
Skip to first unread message

CJB

unread,
Aug 17, 2009, 5:49:23 PM8/17/09
to Railo
Let me apologize if I missed the answer to this already. I'm also new
to both Apache and Resin, so pardon my ignorance regarding this as
well.

I've got a test box with Windows 2003, Apache 2.2 and Railo Server 3.1
(Resin). The problem is my .cfm files display the actual code.

My apache httpd.conf file has the railo info at the end:

LoadModule caucho_module "x:/Railo/win32/apache-2.2/mod_caucho.dll"
ResinConfigServer localhost 6800
CauchoStatus yes
<Location /caucho-status>
SetHandler caucho-status
</Location>

I've got an active directory as done in the apache instructions with a
conf file for the test site as follow:
<VirtualHost *:80>
ServerAdmin m...@xxxxxx.org
DocumentRoot "x:/Apache Software Foundation/Apache2.2/htdocs/
xxxxxx.org/wwwroot"
ServerName xxxxxx.org
ErrorLog "logs/xxxxxx.org-error.log"
CustomLog "logs/xxxxxx.org-access.log" common
DirectoryIndex index.cfm index.php index.htm index.html
index.html.var
<Directory "x:/Apache Software Foundation/Apache2.2/htdocs/
xxxxxx.org/wwwroot">
Options -indexes multiViews +includesNoExec
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

Resin has the hosts directory with xxxxxx.org folder and hosts.xml so
I don't have to modify the resin.conf file every time I want to add/
remove a site:
<host xmlns="http://caucho.com/ns/resin"
xmlns:resin="http://caucho.com/ns/resin/core">
<resin:set var="path" value="x:/Apache Software Foundation/
Apache2.2/htdocs/xxxxxx.org/wwwroot" />
<host-alias>xxxxxx.org</host-alias>
</host>

This same setup runs on the Railo-Resin-Express (without Apache front-
end).

The web and server contexts work perfectly

Thank you.

Todd Rafferty

unread,
Aug 17, 2009, 7:00:04 PM8/17/09
to ra...@googlegroups.com
Your apache looks fine. Simplfy your resin to something like:

<host id="somewebsiteurlhere">
<web-app id="/" root-directory="D:/somedirectory/somewebsite" />
</host>

~Todd Rafferty
Railo Community Manager -- Volunteer
http://getRailo.org/


Andrew Penhorwood

unread,
Aug 17, 2009, 7:31:42 PM8/17/09
to CJB
CJB,

If you browse directly to the resin port what do you get?  Normally you access resin directly on port 8080, 8888 or 8600 directly to see if the resin install is working.  Look for this in your resin conf "<http address="*" port="8600"/>"  Then you can add Apache to the mix.  Also make sure to limit the resin direct access port to 127.0.0.1 once you get it working.

From the results you are getting I would say apache is not handing the stuff off to resin.  But your conf stuff look ok.  This is not a 64bit version of windows, right?

Andrew Penhorwood
>     Options -indexes   multiViews  +includesNoExec
>     AllowOverride None
>     Order allow,deny
>     Allow from all
>   </Directory>
> </VirtualHost>
> Resin has the hosts directory with xxxxxx.org folder and hosts.xml so
> I don't have to modify the resin.conf file every time I want to add/
> remove a site:
> <host xmlns="http://caucho.com/ns/resin"
>        xmlns:resin="http://caucho.com/ns/resin/core">
>        <resin:set var="path" value="x:/Apache Software Foundation/
> Apache2.2/htdocs/xxxxxx.org/wwwroot" />
>        <host-alias>xxxxxx.org</host-alias>
> </host>
> This same setup runs on the Railo-Resin-Express (without Apache front-
> end).
> The web and server contexts work perfectly

> Thank you.
>





-- 
Best regards,
Andrew Penhorwood
and...@coldbits.com
www.coldbits.com
740-392-7141 office
740-507-4634 cell

Chuck Brockman

unread,
Aug 17, 2009, 8:54:16 PM8/17/09
to ra...@googlegroups.com
Adding this to the resin.conf and doing away with the host.xml works.  I was trying to come up with a way so resin didn't have to restart for each new site, but it's not like I'm really doing much even if I were to copy this setup to a production environment.

Thank you very much for your help.

Chuck Brockman

unread,
Aug 17, 2009, 8:57:00 PM8/17/09
to ra...@googlegroups.com
Not running the 64bit, just 32bit.  I replied to Todd's post about using the resin.conf for the virtual hosts.  As I told Todd, I was looking for a way to have resin not restart when editing the resin.conf file by using the host.xml.  Thank you for your help.

Todd Rafferty

unread,
Aug 17, 2009, 9:13:48 PM8/17/09
to ra...@googlegroups.com
Chuck,

You could use a regular expression inside the resin.conf file and never touch it again, however... this implies that any website you setup and request a .cfm file is going to get a copy of Railo. Resin will do this without needing to restart the service.

<host regexp="(.+)">
<host-name>${host.regexp[1]}</host-name>
<root-directory>D:/projects/${host.regexp[1]}</root-directory>
<web-app id="/" document-directory="."/>
</host>

This also means that the host name needs to match the directory name.

Chuck Brockman

unread,
Aug 17, 2009, 9:38:15 PM8/17/09
to ra...@googlegroups.com
I'll play around with this and see how far I get.  Thanks for reminding me of this.

Peter Amiri

unread,
Aug 17, 2009, 11:36:35 PM8/17/09
to ra...@googlegroups.com
Chuck,

Here is how we do it on our shared hosting servers. It allows you to create new websites in the future without having to touch the resin.conf file and thus restarting Resin. Take a deep breath and lets get started. You have to go deep into the guts of your resin.conf file but it is pretty straight forward:

Look for this in the resin.conf:
    <!-- configures a deployment directory for virtual hosts -->
    <host-deploy path="hosts">
      <host-default>
        <resin:import path="host.xml" optional="true"/>
      </host-default>
    </host-deploy>

...and change it to:
    <!-- configures a deployment directory for virtual hosts -->
    <host-deploy path="conf/virtual">
      <host-default>
        <resin:import path="host.xml" optional="true"/>
        <web-app id="/" root-directory="${path}" />
      </host-default>
    </host-deploy>

Now create a directory in the resin/conf directory called virtual. It can be called anything but it has to match what you put into the block above.

Now you can create a directory for each of your websites you want to configure. These are not for the webroot of the websites just a place to hold the configuration files. Since we've told Resin to look for host.xml we can't have more than on in a directory so the easiest way around this is to create multiple subdirectories in the conf/virtual directory. Resin will traverse the subdirectories and discover any new host.xml file.

Now in each of the website directories you're going to create a host.xml file. Here is a sample of what should be in the host.xml file:
      xmlns:resin="http://caucho.com/ns/resin/core">
      <resin:set var="path" value="/home/alurium/public_html" />
      <host-alias>www.alurium.net</host-alias>
      <host-alias>alurium.net</host-alias>
      <host-alias>100.100.100.100</host-alias>
</host>

You are basically specifying the path to the webroot files and then any host name you want to map to this web context. 

That is all there is to it. Now when you create a new directory and put a host.xml file in it, Resin will discover it and start serving CFML files from the path identified in the host.xml file. Resin will not restart and your sessions will not get killed.

I hope this helps. Ping me if you get stuck. I run all this on linux but it should behave the same on Windows.

Peter Amiri
Alurium Hosting
i bpamiri (AIM/MSN/Y!/GTLK/SKYPE)

Chuck Brockman

unread,
Aug 18, 2009, 9:14:19 AM8/18/09
to ra...@googlegroups.com
That seems to have been the solution.  Thank you (and everybody else) very much for your help!

darius

unread,
Aug 18, 2009, 1:59:05 PM8/18/09
to Railo
Is this going to setup separate Railo instances for each website or
one for all?

Peter Amiri

unread,
Aug 18, 2009, 3:06:03 PM8/18/09
to ra...@googlegroups.com
It will setup separate Railo context for each site. Each site will get it's own Web Administrator and you have one Server Administrator to set server wide settings.

Peter Amiri
Alurium Hosting
i bpamiri (AIM/MSN/Y!/GTLK/SKYPE)

Reply all
Reply to author
Forward
0 new messages