Thanks Scott for all the help. This is how far I've gotten. I have  
added the import block to Resin conf file as follows:

     <resin:import>
         <fileset dir="/var/www/vhosts/resinconf">
           <include>*.xml</include>
         </fileset>
     </resin:import>

I have also created a directory at :  /var/www/vhosts/resinconf
and placed the following file in it: showmyip.xml
and the file contains the following:

<cluster xmlns="http://caucho.com/ns/resin";>
   <host host-name="www.viditag.com">
       <host-alias>viditag.com</host-alias>
       <root-directory>/var/www/vhosts/viditag.com/httpdocs</root- 
directory>
       <web-app id="/" root-directory="." />
   </host>
</cluster>

When I restart Railo it starts up and doesn't give any errors. But  
when I try to hit the virtual host I get an error that is indicative  
that the host block was not loaded. So it seems that the resin:import  
command doesn't through any errors but cannot find or access the  
showmyip.xml file. Any ideas what could be causing this? I've alrady  
chmod the resinconf dir and the showmyip.xml file to 777 to make sure  
it is not a permission issue but that didn't help matters either.

-Peter

On May 12, 2009, at 12:19 PM, Scott Ferguson wrote:

>
> On May 12, 2009, at 11:33 AM, Peter Amiri wrote:
>
>> Scott,
>>
>> Do you know what the syntax of the actual xml files should be? Is
>> there a container that should hold the <host> block in the individual
>> xml files?
>
> resin:import always uses the containing context for the top-level xml,
> because it's like an extension of the current context.
>
> Since your host import is inside the <cluster>, the syntax of your
> *.xml would be
>
> <cluster xmlns="http://caucho.com/ns/resin";>
>
>   <host ...>
>     ...
>   </host>
>
> </cluster>
>
> -- Scott
>
>>
>>
>> -Peter
>>
>> On May 12, 2009, at 11:07 AM, Scott Ferguson wrote:
>>
>>>
>>> On May 12, 2009, at 10:49 AM, Peter Amiri wrote:
>>>
>>>> I am trying to automate the process of integrating Resin with a
>>>> cPanel
>>>> hosting environment. For each customer that signs up for a cPanel
>>>> account I need to add the virtual hosting tags to the Resin conf
>>>> file
>>>> manually. Currently the code block that is added is similar to  
>>>> this:
>>>>
>>>>  <host host-name="www.domainname.com">
>>>>      <host-alias>domainname.com</host-alias>
>>>>      <root-directory>/home/path_to_domain/public_html</root-
>>>> directory>
>>>>      <web-app id="/" root-directory="." />
>>>>  </host>
>>>>
>>>> These blocks are added to the <cluster>...</cluster> block within
>>>> the
>>>> resin conf file. Unfortunately the path to the domain is not based
>>>> on
>>>> the domain name so I cannot setup dynamic virtual hosting based  
>>>> on a
>>>> path. But I wanted to know if there was a way to write these
>>>> individual blocks into separate files that got included or imported
>>>> by
>>>> the Resin conf file.
>>>
>>> You can try the resin:import with the fileset syntax:
>>>
>>> <cluster id="">
>>> ...
>>>
>>> <resin:import>
>>>   <fileset dir="hosts">
>>>     <include>*.xml</include>
>>>   </fileset>
>>> </resin:import>
>>>
>>> That sounds like it's what you're looking for.
>>>
>>> -- Scott
>>>
>>>>
>>>>
>>>> In other words I can take into a hook for cPanel and create a text
>>>> file with the contents of the block above (or some new lines if
>>>> needed) and save it as something like domain.conf. Then I would  
>>>> like
>>>> to have the resin conf file automatically read in all these domain
>>>> based conf files based on the path to the file locations and the
>>>> extension so any new domain conf file that is dropped into the
>>>> directory would automatically be included or become part of the
>>>> Resin
>>>> conf file.
>>>>
>>>> Is this doable with Resin 3.1?
>>>>
>>>> -Peter
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> resin-interest mailing list
>>>> resin-interest@caucho.com
>>>> http://maillist.caucho.com/mailman/listinfo/resin-interest
>>>
>>>
>>>
>>> _______________________________________________
>>> resin-interest mailing list
>>> resin-interest@caucho.com
>>> http://maillist.caucho.com/mailman/listinfo/resin-interest
>>
>>
>>
>> _______________________________________________
>> resin-interest mailing list
>> resin-interest@caucho.com
>> http://maillist.caucho.com/mailman/listinfo/resin-interest
>
>
>
> _______________________________________________
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest



_______________________________________________
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

Reply via email to