Discussion:
[xwiki-users] Problem with mod_proxy
justanotheradress
2008-01-22 23:43:07 UTC
Permalink
Forget about it at the moment. If you have a running Tomcat instance it
is the port number at witch the standalone Tomcat http server is running.
Further I don't know where to put
xwiki exactly...I have some concerns about security...
As you are running Tomcat as a servlet container, xwiki must be copied
to your /webapps folder. If you have installed Tomcat by yourself, you
must know where its folder is. It could be under /usr/share, or under
/Library/Tomcat,... I've no Debian distribution running here. Sorry.
So far I did the following steps:

1. Installed JAVA JDK 5
[apt-get install sun-java5-jdk]
[JAVA_OPTS="-Xmx512M"]
[export JAVA_HOME]
[export JAVA_OPTS]

2. Installed Tomcat5.5
[apt-get install tomcat5.5 tomcat5.5-admin tomcat5.5-webapps]

3. Disabled Tomcat security
[vi /etc/init.d/tomcat5.5] TOMCAT5_SECURITY=no

4. Created the xwiki database
[mysql -u root -e "create database xwiki"]
[mysql -u root -e "grant all privileges on xwiki.* to xwiki at 127.0.0.1
identified by 'xwiki'"]

5. Changed hibernate.cfg.xml to
<property name="connection.url">jdbc:mysql://localhost/xwiki</property>
<property name="connection.username">xwiki</property>
<property name="connection.password">xwiki</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>

6. Changed /var/lib/tomcat5.5/conf/tomcat-users.xml to
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="admin"/>
<role rolename="manager"/>
<role rolename="tomcat"/>
<user username="tomcat"
password=?tomcatpassword?
roles="tomcat,admin,manager"/>
</tomcat-users>

7. Made a new entry in apache2/sites-enabled
<VirtualHost MyServerIP:80>
ServerName MyServerIP:80

ProxyRequests On
ProxyPreserveHost On
ProxyVia full

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

ProxyPass /xwiki http://localhost:8082/xwiki
ProxyPassReverse /xwiki http://localhost:8082/xwiki
<Location /xwiki>
Order allow,deny
Allow from all
</Location>
</VirtualHost>

8. Changed the server.xml setting in Tomcat (uncomment the part below)
<!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
<!-- See proxy documentation for more information about using this. -->
<Connector port="8082"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false"
acceptCount="100" debug="0" connectionTimeout="20000"
proxyPort="80" disableUploadTimeout="true" />


I guess I'm almost there. I can access Tomcat with MyServerIP:8180, but I
can't get it to work with Apache respectively MyServerIP/xwiki. Everytime I
call MyServerIP/xwiki I get an "Forbidden" message. I really don't know what
to do now. Any advice would be very appreciated (I tried Google for a long
time but I guess I'm just to dumb for it).
--
View this message in context: http://www.nabble.com/Problem-with-mod_proxy-tp15031584p15031584.html
Sent from the XWiki- Users mailing list archive at Nabble.com.
justanotheradress
2008-01-23 16:19:51 UTC
Permalink
Now I get the following thing if I access my xwiki on my server with
"MyIP:8180/xwiki" from my client (that does mean Apache is working, right?).
The same message appears in terminal browser by "lynx
http://localhost:8180/xwiki". Has anybody an idea what this causes?

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it
from fulfilling this request.

exception

javax.servlet.ServletException: Error number 3 in 0: Could not initialize
main XWiki context
Wrapped Exception: Error number 0 in 3: Exception while hibernate execute
Wrapped Exception: Hibernate Dialect must be explicitly set

org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:535)

org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:433)

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:117)

root cause

com.xpn.xwiki.XWikiException: Error number 3 in 0: Could not initialize main
XWiki context
Wrapped Exception: Error number 0 in 3: Exception while hibernate execute
Wrapped Exception: Hibernate Dialect must be explicitly set
com.xpn.xwiki.XWiki.getMainXWiki(XWiki.java:250)
com.xpn.xwiki.XWiki.getXWiki(XWiki.java:439)
com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:94)

org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:117)
--
View this message in context: http://www.nabble.com/Problem-with-mod_proxy-tp15031584p15045570.html
Sent from the XWiki- Users mailing list archive at Nabble.com.
justanotheradress
2008-01-23 17:34:07 UTC
Permalink
Guys, guys, guys. IT WORKS! IT WORKS!

I need some time to figure out every step I made and write the Howto, stay
tuned. :D
--
View this message in context: http://www.nabble.com/Problem-with-mod_proxy-tp15031584p15047622.html
Sent from the XWiki- Users mailing list archive at Nabble.com.
rssh
2008-01-23 18:34:59 UTC
Permalink
Post by justanotheradress
javax.servlet.ServletException: Error number 3 in 0: Could not initialize
main XWiki context
Wrapped Exception: Error number 0 in 3: Exception while hibernate execute
Wrapped Exception: Hibernate Dialect must be explicitly set
*************************************************************


So, it's nothing with mod_proxy, it's about incorrect hibernate.cfg.xml
Continue reading on narkive:
Loading...