[opencms-dev] Problems with removing of /opencms/opencms (rewrite method)

Peter Birchmeier pbirchmeier at gmx.ch
Sun Mar 27 05:06:00 CEST 2005


Hi

I followed the howto-guide of Sebastian Himberger to get rid of the 
/opencms/opencms-prefix (http://opencms-forum.de/viewtopic.php?t=713):
- jk-connector (1.2.7) with ajp 1.3
- changes in VFS: /system/workplace/views/top_fs.jsp and 
/WEB-INF/config/opencms-importexport.xml
- use of the mod-rewrite directives
In contrast to his guide, i chose a somewhat different configuration:


1. Since my intention is to provide websites to different client 
accounts, it is important to me to let clients access their own web 
directory. A website is e.g. hosted in the directory 
c:/home/www/tischtuecher/var/webapps. For this purpose i use the <Host 
/> directive of the Tomcat property file server.xml (websites can be 
distributed over several directories by this method):

   <Host name="tischtuecher.ch" debug="0" 
appBase="c:\home\www\tischtuecher\var\webapps"
       unpackWARs="true" autoDeploy="true">
             <Alias>tischtuecher.localhost</Alias>

       <Valve className="org.apache.catalina.valves.AccessLogValve"
                directory="c:\home\www\tischtuecher\var\logs"  
prefix="tomcat." suffix=".txt"
                pattern="common" resolveHosts="false"/>
   </Host>

To install OpenCms, i simply put the opencms.war file into the 
webapps-directory and let it be unpacked during a Tomcat startup. So the 
context path will be /opencms.


2. The second point is that I use a somewhat different rewrite 
configuration of the Apache httpd.conf file:

<VirtualHost *>
   ServerName tischtuecher.ch
   ServerAlias tischtuecher.localhost
     ErrorLog c:\home\www\tischtuecher\var\logs\httpd-errorlog.log
   CustomLog c:\home\www\tischtuecher\var\logs\httpd-access.log common

     SetEnvIfNoCase Request_URI ^/opencms/resources/.*$ no-jk
   SetEnvIfNoCase Request_URI ^/opencms/export/.*$ no-jk
     RewriteEngine on
 
   RewriteCond %{REQUEST_URI} !^/opencms/resources/.*$
   RewriteCond %{REQUEST_URI} !^/opencms/export/.*$
   RewriteRule !^/opencms/opencms/?(.*)$ 
/opencms/opencms%2%{REQUEST_URI} [PT]

 
   DocumentRoot 'c:/home/www/opencms6/var/webapps/'
     JkMount /* worker1
</VirtualHost>

As I you may have remarked, I have done some small changes:
a) I included the extra virtual host for static export into the base 
virtual host. The export directory is on the same directory level as the 
resourse directory, so the export's configuration should look similiar 
to the resources' one.
b) Since my DocumentRoot doesn't point to the tomcat webcontext itself 
(/opencms) but to the webapps directory, I do not have to rewrite the 
urls of the resources and export directories.


My problem:
----------
Everything just looks fine on the first sight. Rendered pages are 
correct and take account of the url shifting. But if I login 
(/system/login/) and the OpenCms explorer window is opened, the Project 
is automatically set to "online" mode, despite of the contrary property 
setting. Further when I switch to "offline" mode and try to change the 
Site path from "/sites/default/" to "/", the OpenCms explorer then 
actuallay shows again the content of "/sites/dafault/" in the folder as 
well as in the files list. Bytheway the Project editing mode gets 
updated to "Online". Finally I am only able to access the 
/sites/default/ directory in the VFS.

My assumption was that my changes to the original configuraton of 
"Sebastian Himberge" must have been the reason. Unfortunately even if I 
accomplished the installation in the original manner, the same problem 
symptoms have appeared.


Does anybody know that issue?

Thanks for your help, Peter Birchmeier



More information about the opencms-dev mailing list