You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jspwiki.apache.org by John Lusk <jo...@gmail.com> on 2017/01/08 21:10:00 UTC

Problem getting started on Ubuntu 16.04/Tomcat 8

Ok, friends.  Trying to get JSPWiki set up on a new Amazon EC2 Unbuntu
16.04 instance I just stood up, and I'm having some trouble.  Help?

I installed Tomcat8 using apt-get, I wound up with:

   /etc/default/tomcat8
   /etc/init.d/tomcat8
   /etc/tomcat8
      Catalina/localhost/{docs,examples,host-manager,manager}.xml
      (These have docbase pointing to corresponding subdirs of
      /usr/share.)
   /usr/share/tomcat8
   /var/lib/tomcat8, which has a webapps subdir.

It all seems to be working fine.

So, I downloaded jspwiki.war 2.10.2, renamed it to "wiki.war", and
copied it to /var/lib/tomcat8/webapps, where it promptly got unpacked.

Now, I can see it in my Tomcat app manager, but when I attempt to
start it, I get failures.

First, I got OutOfMemory errors.

I assume Tomcat's default -Xmx=128m is way too small, so I bumped it
up to 768m (I've only got a 1GB EC2 instance (t2.micro), so I think
768m is living dangerously, eh?).

Now I'm getting errors like

   org.apache.catalina.core.ApplicationContext.log ERROR: Failed to create
a Wiki engine: JSPWiki: Unable to load and setup properties from
jspwiki.properties. Failed to start. Caused by: Failed to instantiate class
org.apache.wiki.PageManager; please check log files for better information.

   (in localhost.2017-01-08.log)

and

   java.io.FileNotFoundException: jspwiki.log (Permission denied)

   (in catalina.out)

and

   INFO [__DEFAULT__]
org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading
Illegal access: this web application instance has been stopped already.
Could not load [net/sf/ehcache/version.properties].

   (in catalina.2017-01-08.log)

I grabbed jspwiki.properties with:

   unzip jspwiki-war-2.10.2.jar ini/jspwiki.properties

and modified it as follows (renaming it jspwiki-custom.properties):

   51c51
   < jspwiki.baseURL=http://localhost:8080/JSPWiki/
   ---
   > jspwiki.baseURL=http://web.how-hard-can-it-be.com/wiki/
   102c102
   < #  jspwiki.fileSystemProvider.pageDir = /p/web/www-data/jspwiki/
   ---
   > jspwiki.fileSystemProvider.pageDir = /etc/jspwiki/pages
   144c144
   < #  jspwiki.basicAttachmentProvider.storageDir = C:\\Data\\jspwiki
   ---
   > jspwiki.basicAttachmentProvider.storageDir = /etc/jspwiki/attachments
   605c605
   < #jspwiki.xmlGroupDatabaseFile = /etc/tomcat/groupdatabase.xml
   ---
   > jspwiki.xmlGroupDatabaseFile = /etc/jspwiki/groupdatabase.xml
   626c626
   < #jspwiki.xmlUserDatabaseFile = /etc/tomcat/userdatabase.xml
   ---
   > jspwiki.xmlUserDatabaseFile = /etc/jspwiki/userdatabase.xml
   885c885
   < log4j.appender.FileLog.File = jspwiki.log
   ---
   > log4j.appender.FileLog.File = /var/log/jspwiki/jspwiki.log

and tried deploying it to various places
({/var/lib,/usr/share}/tomcat8, /var/lib/tomcat8/webapps/wiki).

All to no avail.

What else can I try?

(I'm kind of a Rip van Winkle Java web app developer -- the last time
I touched this technology stack was more than ten years ago, and that
was on JBoss, all of which I've forgotten except the pain.)

Thanks.

John.

Re: Problem getting started on Ubuntu 16.04/Tomcat 8

Posted by David Vittor <dv...@gmail.com>.
Hi John,

My guess is you might be having a permission issue. When you installed
tomcat using apt-get you might have been a "root" user, but might be
running the application as a non root user.

This line seems to be the clue:
java.io.FileNotFoundException: jspwiki.log (Permission denied)

Cheers,
David V


On Mon, Jan 9, 2017 at 8:10 AM, John Lusk <jo...@gmail.com> wrote:

> Ok, friends.  Trying to get JSPWiki set up on a new Amazon EC2 Unbuntu
> 16.04 instance I just stood up, and I'm having some trouble.  Help?
>
> I installed Tomcat8 using apt-get, I wound up with:
>
>    /etc/default/tomcat8
>    /etc/init.d/tomcat8
>    /etc/tomcat8
>       Catalina/localhost/{docs,examples,host-manager,manager}.xml
>       (These have docbase pointing to corresponding subdirs of
>       /usr/share.)
>    /usr/share/tomcat8
>    /var/lib/tomcat8, which has a webapps subdir.
>
> It all seems to be working fine.
>
> So, I downloaded jspwiki.war 2.10.2, renamed it to "wiki.war", and
> copied it to /var/lib/tomcat8/webapps, where it promptly got unpacked.
>
> Now, I can see it in my Tomcat app manager, but when I attempt to
> start it, I get failures.
>
> First, I got OutOfMemory errors.
>
> I assume Tomcat's default -Xmx=128m is way too small, so I bumped it
> up to 768m (I've only got a 1GB EC2 instance (t2.micro), so I think
> 768m is living dangerously, eh?).
>
> Now I'm getting errors like
>
>    org.apache.catalina.core.ApplicationContext.log ERROR: Failed to create
> a Wiki engine: JSPWiki: Unable to load and setup properties from
> jspwiki.properties. Failed to start. Caused by: Failed to instantiate class
> org.apache.wiki.PageManager; please check log files for better information.
>
>    (in localhost.2017-01-08.log)
>
> and
>
>    java.io.FileNotFoundException: jspwiki.log (Permission denied)
>
>    (in catalina.out)
>
> and
>
>    INFO [__DEFAULT__]
> org.apache.catalina.loader.WebappClassLoaderBase.
> checkStateForResourceLoading
> Illegal access: this web application instance has been stopped already.
> Could not load [net/sf/ehcache/version.properties].
>
>    (in catalina.2017-01-08.log)
>
> I grabbed jspwiki.properties with:
>
>    unzip jspwiki-war-2.10.2.jar ini/jspwiki.properties
>
> and modified it as follows (renaming it jspwiki-custom.properties):
>
>    51c51
>    < jspwiki.baseURL=http://localhost:8080/JSPWiki/
>    ---
>    > jspwiki.baseURL=http://web.how-hard-can-it-be.com/wiki/
>    102c102
>    < #  jspwiki.fileSystemProvider.pageDir = /p/web/www-data/jspwiki/
>    ---
>    > jspwiki.fileSystemProvider.pageDir = /etc/jspwiki/pages
>    144c144
>    < #  jspwiki.basicAttachmentProvider.storageDir = C:\\Data\\jspwiki
>    ---
>    > jspwiki.basicAttachmentProvider.storageDir = /etc/jspwiki/attachments
>    605c605
>    < #jspwiki.xmlGroupDatabaseFile = /etc/tomcat/groupdatabase.xml
>    ---
>    > jspwiki.xmlGroupDatabaseFile = /etc/jspwiki/groupdatabase.xml
>    626c626
>    < #jspwiki.xmlUserDatabaseFile = /etc/tomcat/userdatabase.xml
>    ---
>    > jspwiki.xmlUserDatabaseFile = /etc/jspwiki/userdatabase.xml
>    885c885
>    < log4j.appender.FileLog.File = jspwiki.log
>    ---
>    > log4j.appender.FileLog.File = /var/log/jspwiki/jspwiki.log
>
> and tried deploying it to various places
> ({/var/lib,/usr/share}/tomcat8, /var/lib/tomcat8/webapps/wiki).
>
> All to no avail.
>
> What else can I try?
>
> (I'm kind of a Rip van Winkle Java web app developer -- the last time
> I touched this technology stack was more than ten years ago, and that
> was on JBoss, all of which I've forgotten except the pain.)
>
> Thanks.
>
> John.
>

Re: Problem getting started on Ubuntu 16.04/Tomcat 8

Posted by Paul Uszak <pa...@gmail.com>.
I find the easiest and most risk free way of installation is to use the
Tomcat gui manager app that ships with Tomcat.  Just deploy jspwiki.war
from the gui and all the permissions get set automatically by Tomcat.  You
can then fiddle about with the files /customisations later.  They actually
just all get owned by tomcat7 and group tomcat7 on my installation.  I
expect that it's similar on Tomcat8.  Although in my case, Tomcat itself is
installed and running as root which is the simplest way.

On 11 January 2017 at 18:39, John Lusk <jo...@gmail.com> wrote:

> Yeah, I saw that, but I wasn't sure what that referred to, since there's
> $CATALINA_{HOME,BASE} and I don't recall either of them having a "lib"
> subfolder. But, maybe it's $CATALINA_HOME? (Which might leave me vulnerable
> to getting zapped by a Tomcat upgrade?)
>
> Anyway, I'll check it out later.
>
> John.
>
> On Wed, Jan 11, 2017 at 1:36 PM, Dirk Frederickx <
> dirk.frederickx@gmail.com>
> wrote:
>
> > FWIW:
> >
> > In the "Getting Started" page,  you  can read:
> >
> > In the $TOMCAT_HOME/lib folder (or equivalent based on your servlet
> > container), place a jspwiki-custom.properties file, which can contain any
> > overrides to the defaults. See Configuration
> > <https://jspwiki-wiki.apache.org/Wiki.jsp?page=Configuration> for these
> > default values.
> >
> >
> > These properties overwrite the values of the WEB-INF/jspwiki-properties.
> > I always keep the  custom properties file there,  and I never have to
> > change the exploded war.
> >
> >
> >
> > dirk
> >
> >
> > On Wed, Jan 11, 2017 at 5:38 AM, David Vittor <dv...@gmail.com> wrote:
> >
> > > Yeah - the placing the custom properties file in the expanded war
> folder
> > is
> > > one thing I don't like about jspwiki setup either.
> > >
> > > But I know of no workaround at the moment.
> > >
> > > Good to see you're making progress.
> > >
> > > Cheers,
> > > David V
> > >
> > >
> > >
> > >
> > > On Wed, Jan 11, 2017 at 2:28 PM, John Lusk <jo...@gmail.com>
> wrote:
> > >
> > > > Also: success, of sorts. Got my main page up, edited it successfully.
> > > >
> > > > There's something about the work dir not being writable, but from the
> > O/S
> > > > perspective, it is. More catalina.policy magic?
> > > >
> > > > Haven't checked the log file yet, but it's probably still wrong.
> > > >
> > > > More later.
> > > >
> > > > John.
> > > >
> > > > On Tue, Jan 10, 2017 at 10:05 PM, John Lusk <jo...@gmail.com>
> > wrote:
> > > >
> > > > > Thanks. Is there another directory than the exploded war file?
> > Reason I
> > > > > ask is if I get a new war file at some point, that exploded
> directory
> > > > will
> > > > > go away, along w/my customized properties file.  (I'll always be
> able
> > > to
> > > > > restore it after a certain amount of fumbling around, but I'd
> expect
> > to
> > > > put
> > > > > customizations elsewhere.)
> > > > >
> > > > > On Tue, Jan 10, 2017 at 10:01 PM, David Vittor <dv...@gmail.com>
> > > > wrote:
> > > > >
> > > > >> The customized properites file is: jspwiki-custom.properties
> > > > >>
> > > > >> This should be located in <tomcat>/webapps/wiki/WEB-INF/classes
> > > > >>
> > > > >> You can change the workDir, or just the log file:
> > > > >> jspwiki.workDir=/opt/digitalspider/jspwiki/wikis/testwiki/data/
> > > > >> log4j.appender.FileLog.File = /var/jspwiki/logs/jspwiki.log
> > > > >>
> > > > >> See the docs here:
> > > > >> * https://jspwiki-wiki.apache.org/Wiki.jsp?page=Documentation
> > > > >> * https://jspwiki-wiki.apache.org/Wiki.jsp?page=Getting%20Started
> > > > >>
> > > > >> But if you have a permission error, it might be more than just the
> > log
> > > > >> file.
> > > > >>
> > > > >> Cheers,
> > > > >> David V
> > > > >>
> > > > >>
> > > > >>
> > > > >>
> > > > >> On Wed, Jan 11, 2017 at 1:07 PM, John Lusk <jo...@gmail.com>
> > > wrote:
> > > > >>
> > > > >> > Ok, so I added the following to my
> /etc/tomcat8/policy.d/03catali
> > > > >> na.policy
> > > > >> > file:
> > > > >> >
> > > > >> > grant codeBase "file:${catalina.base}/webapps/wiki/-" {
> > > > >> >   permission java.io.FilePermission "file:/usr/share/jspwiki-
> > > > files/-",
> > > > >> > "read, write";
> > > > >> >   permission java.security.AllPermission;
> > > > >> > };
> > > > >> >
> > > > >> > which (a) doesn't seem to have caused any disasters (yay), but
> (b)
> > > > >> hasn't
> > > > >> > done anything nice (boo). I did a /etc/init.d/tomcat8 restart.
> The
> > > > edits
> > > > >> > appear in /var/cache/tomcat8/catalina.policy, so I guess that's
> > > good.
> > > > >> >
> > > > >> > Still getting a permission error on jspwiki.log. Golly day, it
> > sure
> > > > >> would
> > > > >> > be nice if I had a complete pathname to work with on this one.
> Not
> > > > juse
> > > > >> > "jspwiki.log".
> > > > >> >
> > > > >> > I have chowned various directories to tomcat8:tomcat8, which is
> > the
> > > > >> userid
> > > > >> > the process runs under.
> > > > >> >
> > > > >> > Next step: where the heck do I put the customized properties
> file,
> > > > what
> > > > >> do
> > > > >> > I name it? Possibilities are:
> > > > >> >
> > > > >> >
> > > > >> >    - jspwiki.properties
> > > > >> >    - jspwiki-custom.properties
> > > > >> >    - wiki.properties
> > > > >> >    - wiki-custom.properties
> > > > >> >
> > > > >> > Maginc incantation, anyone? (Plus path, would be nice.)
> > > > >> >
> > > > >> > (Thanks.)
> > > > >> >
> > > > >> > John.
> > > > >> >
> > > > >> > On Mon, Jan 9, 2017 at 3:31 AM, Col Willis <
> col.willis@gmail.com>
> > > > >> wrote:
> > > > >> >
> > > > >> > > I had to do something funky with the catalina.policy file to
> get
> > > > >> jspwiki
> > > > >> > > working in tomcat8 (apt-get installed)
> > > > >> > >
> > > > >> > > grant codeBase "file:/var/lib/tomcat8/webapps/wiki/-" {
> > > > >> > >    // !!change the directory to the location you want to
> locate
> > > your
> > > > >> > > wiki files!!
> > > > >> > >    permission java.io.FilePermission
> > > > >> > > "file:/usr/share/tomcat8/jspwiki-files/-", "read, write";
> > > > >> > >
> > > > >> > >    // just allow the entire codebase permissions to do what it
> > > > needs.
> > > > >> > >    permission java.security.AllPermission;
> > > > >> > > };
> > > > >> > >
> > > > >> > > // this file does not exist, but it does solve a problem with
> > > > >> > > exceptions being thrown in syslog
> > > > >> > > grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
> > > > >> > >    permission java.io.FilePermission
> > > > >> > > "/var/lib/tomcat8/webapps/wiki/WEB-INF/classes/logging.
> > > properties",
> > > > >> > > "read";
> > > > >> > > };
> > > > >> > >
> > > > >> > >
> > > > >> > > On 9 January 2017 at 00:13, Rick Brockman <
> > > reb@richardbrockman.info
> > > > >
> > > > >> > > wrote:
> > > > >> > >
> > > > >> > > > Like you John I'm a Rip van Winkle of bygone computer days.
> > > > When  I
> > > > >> > > > installed Tomcat using apt-get I ran into problems and
> instead
> > > of
> > > > >> > > knocking
> > > > >> > > > my head against the sleep pillow, I downloaded tomcat from
> the
> > > web
> > > > >> and
> > > > >> > > its
> > > > >> > > > working...
> > > > >> > > >
> > > > >> > > > On 2017-01-08 16:10, John Lusk wrote:
> > > > >> > > >
> > > > >> > > >> Ok, friends.  Trying to get JSPWiki set up on a new Amazon
> > EC2
> > > > >> Unbuntu
> > > > >> > > >> 16.04 instance I just stood up, and I'm having some
> trouble.
> > > > Help?
> > > > >> > > >>
> > > > >> > > >> I installed Tomcat8 using apt-get, I wound up with:
> > > > >> > > >>
> > > > >> > > >>    /etc/default/tomcat8
> > > > >> > > >>    /etc/init.d/tomcat8
> > > > >> > > >>    /etc/tomcat8
> > > > >> > > >>       Catalina/localhost/{docs,
> > examples,host-manager,manager}
> > > > .xml
> > > > >> > > >>       (These have docbase pointing to corresponding subdirs
> > of
> > > > >> > > >>       /usr/share.)
> > > > >> > > >>    /usr/share/tomcat8
> > > > >> > > >>    /var/lib/tomcat8, which has a webapps subdir.
> > > > >> > > >>
> > > > >> > > >> It all seems to be working fine.
> > > > >> > > >>
> > > > >> > > >> So, I downloaded jspwiki.war 2.10.2, renamed it to
> > "wiki.war",
> > > > and
> > > > >> > > >> copied it to /var/lib/tomcat8/webapps, where it promptly
> got
> > > > >> unpacked.
> > > > >> > > >>
> > > > >> > > >> Now, I can see it in my Tomcat app manager, but when I
> > attempt
> > > to
> > > > >> > > >> start it, I get failures.
> > > > >> > > >>
> > > > >> > > >> First, I got OutOfMemory errors.
> > > > >> > > >>
> > > > >> > > >> I assume Tomcat's default -Xmx=128m is way too small, so I
> > > bumped
> > > > >> it
> > > > >> > > >> up to 768m (I've only got a 1GB EC2 instance (t2.micro),
> so I
> > > > think
> > > > >> > > >> 768m is living dangerously, eh?).
> > > > >> > > >>
> > > > >> > > >> Now I'm getting errors like
> > > > >> > > >>
> > > > >> > > >>    org.apache.catalina.core.ApplicationContext.log ERROR:
> > > Failed
> > > > >> to
> > > > >> > > >> create
> > > > >> > > >> a Wiki engine: JSPWiki: Unable to load and setup properties
> > > from
> > > > >> > > >> jspwiki.properties. Failed to start. Caused by: Failed to
> > > > >> instantiate
> > > > >> > > >> class
> > > > >> > > >> org.apache.wiki.PageManager; please check log files for
> > better
> > > > >> > > >> information.
> > > > >> > > >>
> > > > >> > > >>    (in localhost.2017-01-08.log)
> > > > >> > > >>
> > > > >> > > >> and
> > > > >> > > >>
> > > > >> > > >>    java.io.FileNotFoundException: jspwiki.log (Permission
> > > denied)
> > > > >> > > >>
> > > > >> > > >>    (in catalina.out)
> > > > >> > > >>
> > > > >> > > >> and
> > > > >> > > >>
> > > > >> > > >>    INFO [__DEFAULT__]
> > > > >> > > >> org.apache.catalina.loader.WebappClassLoaderBase.
> checkStateF
> > > > >> > > >> orResourceLoading
> > > > >> > > >> Illegal access: this web application instance has been
> > stopped
> > > > >> > already.
> > > > >> > > >> Could not load [net/sf/ehcache/version.properties].
> > > > >> > > >>
> > > > >> > > >>    (in catalina.2017-01-08.log)
> > > > >> > > >>
> > > > >> > > >> I grabbed jspwiki.properties with:
> > > > >> > > >>
> > > > >> > > >>    unzip jspwiki-war-2.10.2.jar ini/jspwiki.properties
> > > > >> > > >>
> > > > >> > > >> and modified it as follows (renaming it
> > > > jspwiki-custom.properties):
> > > > >> > > >>
> > > > >> > > >>    51c51
> > > > >> > > >>    < jspwiki.baseURL=http://localhost:8080/JSPWiki/
> > > > >> > > >>    ---
> > > > >> > > >>    > jspwiki.baseURL=http://web.
> how-hard-can-it-be.com/wiki/
> > > > >> > > >>    102c102
> > > > >> > > >>    < #  jspwiki.fileSystemProvider.pageDir =
> > > > >> /p/web/www-data/jspwiki/
> > > > >> > > >>    ---
> > > > >> > > >>    > jspwiki.fileSystemProvider.pageDir =
> /etc/jspwiki/pages
> > > > >> > > >>    144c144
> > > > >> > > >>    < #  jspwiki.basicAttachmentProvider.storageDir =
> > > > >> > C:\\Data\\jspwiki
> > > > >> > > >>    ---
> > > > >> > > >>    > jspwiki.basicAttachmentProvider.storageDir =
> > > > >> > > >> /etc/jspwiki/attachments
> > > > >> > > >>    605c605
> > > > >> > > >>    < #jspwiki.xmlGroupDatabaseFile =
> > > > /etc/tomcat/groupdatabase.xml
> > > > >> > > >>    ---
> > > > >> > > >>    > jspwiki.xmlGroupDatabaseFile =
> > > > /etc/jspwiki/groupdatabase.xml
> > > > >> > > >>    626c626
> > > > >> > > >>    < #jspwiki.xmlUserDatabaseFile =
> > > /etc/tomcat/userdatabase.xml
> > > > >> > > >>    ---
> > > > >> > > >>    > jspwiki.xmlUserDatabaseFile =
> > > /etc/jspwiki/userdatabase.xml
> > > > >> > > >>    885c885
> > > > >> > > >>    < log4j.appender.FileLog.File = jspwiki.log
> > > > >> > > >>    ---
> > > > >> > > >>    > log4j.appender.FileLog.File =
> > /var/log/jspwiki/jspwiki.log
> > > > >> > > >>
> > > > >> > > >> and tried deploying it to various places
> > > > >> > > >> ({/var/lib,/usr/share}/tomcat8,
> > /var/lib/tomcat8/webapps/wiki)
> > > .
> > > > >> > > >>
> > > > >> > > >> All to no avail.
> > > > >> > > >>
> > > > >> > > >> What else can I try?
> > > > >> > > >>
> > > > >> > > >> (I'm kind of a Rip van Winkle Java web app developer -- the
> > > last
> > > > >> time
> > > > >> > > >> I touched this technology stack was more than ten years
> ago,
> > > and
> > > > >> that
> > > > >> > > >> was on JBoss, all of which I've forgotten except the pain.)
> > > > >> > > >>
> > > > >> > > >> Thanks.
> > > > >> > > >>
> > > > >> > > >> John.
> > > > >> > > >>
> > > > >> > > >
> > > > >> > > > --
> > > > >> > > > -------------------------
> > > > >> > > >
> > > > >> > > > _RICK BROCKMAN_
> > > > >> > > >
> > > > >> > > > _28 LANCASTER ST._
> > > > >> > > >
> > > > >> > > > _CHERRY VALLEY, NY 13320_
> > > > >> > > >
> > > > >> > > > _607 434-4746 <(607)%20434-4746>_
> > > > >> > > >
> > > > >> > >
> > > > >> > >
> > > > >> > >
> > > > >> > > --
> > > > >> > > Col
> > > > >> > >
> > > > >> >
> > > > >>
> > > > >
> > > > >
> > > >
> > >
> >
>

Re: Problem getting started on Ubuntu 16.04/Tomcat 8

Posted by John Lusk <jo...@gmail.com>.
Yeah, I saw that, but I wasn't sure what that referred to, since there's
$CATALINA_{HOME,BASE} and I don't recall either of them having a "lib"
subfolder. But, maybe it's $CATALINA_HOME? (Which might leave me vulnerable
to getting zapped by a Tomcat upgrade?)

Anyway, I'll check it out later.

John.

On Wed, Jan 11, 2017 at 1:36 PM, Dirk Frederickx <di...@gmail.com>
wrote:

> FWIW:
>
> In the "Getting Started" page,  you  can read:
>
> In the $TOMCAT_HOME/lib folder (or equivalent based on your servlet
> container), place a jspwiki-custom.properties file, which can contain any
> overrides to the defaults. See Configuration
> <https://jspwiki-wiki.apache.org/Wiki.jsp?page=Configuration> for these
> default values.
>
>
> These properties overwrite the values of the WEB-INF/jspwiki-properties.
> I always keep the  custom properties file there,  and I never have to
> change the exploded war.
>
>
>
> dirk
>
>
> On Wed, Jan 11, 2017 at 5:38 AM, David Vittor <dv...@gmail.com> wrote:
>
> > Yeah - the placing the custom properties file in the expanded war folder
> is
> > one thing I don't like about jspwiki setup either.
> >
> > But I know of no workaround at the moment.
> >
> > Good to see you're making progress.
> >
> > Cheers,
> > David V
> >
> >
> >
> >
> > On Wed, Jan 11, 2017 at 2:28 PM, John Lusk <jo...@gmail.com> wrote:
> >
> > > Also: success, of sorts. Got my main page up, edited it successfully.
> > >
> > > There's something about the work dir not being writable, but from the
> O/S
> > > perspective, it is. More catalina.policy magic?
> > >
> > > Haven't checked the log file yet, but it's probably still wrong.
> > >
> > > More later.
> > >
> > > John.
> > >
> > > On Tue, Jan 10, 2017 at 10:05 PM, John Lusk <jo...@gmail.com>
> wrote:
> > >
> > > > Thanks. Is there another directory than the exploded war file?
> Reason I
> > > > ask is if I get a new war file at some point, that exploded directory
> > > will
> > > > go away, along w/my customized properties file.  (I'll always be able
> > to
> > > > restore it after a certain amount of fumbling around, but I'd expect
> to
> > > put
> > > > customizations elsewhere.)
> > > >
> > > > On Tue, Jan 10, 2017 at 10:01 PM, David Vittor <dv...@gmail.com>
> > > wrote:
> > > >
> > > >> The customized properites file is: jspwiki-custom.properties
> > > >>
> > > >> This should be located in <tomcat>/webapps/wiki/WEB-INF/classes
> > > >>
> > > >> You can change the workDir, or just the log file:
> > > >> jspwiki.workDir=/opt/digitalspider/jspwiki/wikis/testwiki/data/
> > > >> log4j.appender.FileLog.File = /var/jspwiki/logs/jspwiki.log
> > > >>
> > > >> See the docs here:
> > > >> * https://jspwiki-wiki.apache.org/Wiki.jsp?page=Documentation
> > > >> * https://jspwiki-wiki.apache.org/Wiki.jsp?page=Getting%20Started
> > > >>
> > > >> But if you have a permission error, it might be more than just the
> log
> > > >> file.
> > > >>
> > > >> Cheers,
> > > >> David V
> > > >>
> > > >>
> > > >>
> > > >>
> > > >> On Wed, Jan 11, 2017 at 1:07 PM, John Lusk <jo...@gmail.com>
> > wrote:
> > > >>
> > > >> > Ok, so I added the following to my /etc/tomcat8/policy.d/03catali
> > > >> na.policy
> > > >> > file:
> > > >> >
> > > >> > grant codeBase "file:${catalina.base}/webapps/wiki/-" {
> > > >> >   permission java.io.FilePermission "file:/usr/share/jspwiki-
> > > files/-",
> > > >> > "read, write";
> > > >> >   permission java.security.AllPermission;
> > > >> > };
> > > >> >
> > > >> > which (a) doesn't seem to have caused any disasters (yay), but (b)
> > > >> hasn't
> > > >> > done anything nice (boo). I did a /etc/init.d/tomcat8 restart. The
> > > edits
> > > >> > appear in /var/cache/tomcat8/catalina.policy, so I guess that's
> > good.
> > > >> >
> > > >> > Still getting a permission error on jspwiki.log. Golly day, it
> sure
> > > >> would
> > > >> > be nice if I had a complete pathname to work with on this one. Not
> > > juse
> > > >> > "jspwiki.log".
> > > >> >
> > > >> > I have chowned various directories to tomcat8:tomcat8, which is
> the
> > > >> userid
> > > >> > the process runs under.
> > > >> >
> > > >> > Next step: where the heck do I put the customized properties file,
> > > what
> > > >> do
> > > >> > I name it? Possibilities are:
> > > >> >
> > > >> >
> > > >> >    - jspwiki.properties
> > > >> >    - jspwiki-custom.properties
> > > >> >    - wiki.properties
> > > >> >    - wiki-custom.properties
> > > >> >
> > > >> > Maginc incantation, anyone? (Plus path, would be nice.)
> > > >> >
> > > >> > (Thanks.)
> > > >> >
> > > >> > John.
> > > >> >
> > > >> > On Mon, Jan 9, 2017 at 3:31 AM, Col Willis <co...@gmail.com>
> > > >> wrote:
> > > >> >
> > > >> > > I had to do something funky with the catalina.policy file to get
> > > >> jspwiki
> > > >> > > working in tomcat8 (apt-get installed)
> > > >> > >
> > > >> > > grant codeBase "file:/var/lib/tomcat8/webapps/wiki/-" {
> > > >> > >    // !!change the directory to the location you want to locate
> > your
> > > >> > > wiki files!!
> > > >> > >    permission java.io.FilePermission
> > > >> > > "file:/usr/share/tomcat8/jspwiki-files/-", "read, write";
> > > >> > >
> > > >> > >    // just allow the entire codebase permissions to do what it
> > > needs.
> > > >> > >    permission java.security.AllPermission;
> > > >> > > };
> > > >> > >
> > > >> > > // this file does not exist, but it does solve a problem with
> > > >> > > exceptions being thrown in syslog
> > > >> > > grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
> > > >> > >    permission java.io.FilePermission
> > > >> > > "/var/lib/tomcat8/webapps/wiki/WEB-INF/classes/logging.
> > properties",
> > > >> > > "read";
> > > >> > > };
> > > >> > >
> > > >> > >
> > > >> > > On 9 January 2017 at 00:13, Rick Brockman <
> > reb@richardbrockman.info
> > > >
> > > >> > > wrote:
> > > >> > >
> > > >> > > > Like you John I'm a Rip van Winkle of bygone computer days.
> > > When  I
> > > >> > > > installed Tomcat using apt-get I ran into problems and instead
> > of
> > > >> > > knocking
> > > >> > > > my head against the sleep pillow, I downloaded tomcat from the
> > web
> > > >> and
> > > >> > > its
> > > >> > > > working...
> > > >> > > >
> > > >> > > > On 2017-01-08 16:10, John Lusk wrote:
> > > >> > > >
> > > >> > > >> Ok, friends.  Trying to get JSPWiki set up on a new Amazon
> EC2
> > > >> Unbuntu
> > > >> > > >> 16.04 instance I just stood up, and I'm having some trouble.
> > > Help?
> > > >> > > >>
> > > >> > > >> I installed Tomcat8 using apt-get, I wound up with:
> > > >> > > >>
> > > >> > > >>    /etc/default/tomcat8
> > > >> > > >>    /etc/init.d/tomcat8
> > > >> > > >>    /etc/tomcat8
> > > >> > > >>       Catalina/localhost/{docs,
> examples,host-manager,manager}
> > > .xml
> > > >> > > >>       (These have docbase pointing to corresponding subdirs
> of
> > > >> > > >>       /usr/share.)
> > > >> > > >>    /usr/share/tomcat8
> > > >> > > >>    /var/lib/tomcat8, which has a webapps subdir.
> > > >> > > >>
> > > >> > > >> It all seems to be working fine.
> > > >> > > >>
> > > >> > > >> So, I downloaded jspwiki.war 2.10.2, renamed it to
> "wiki.war",
> > > and
> > > >> > > >> copied it to /var/lib/tomcat8/webapps, where it promptly got
> > > >> unpacked.
> > > >> > > >>
> > > >> > > >> Now, I can see it in my Tomcat app manager, but when I
> attempt
> > to
> > > >> > > >> start it, I get failures.
> > > >> > > >>
> > > >> > > >> First, I got OutOfMemory errors.
> > > >> > > >>
> > > >> > > >> I assume Tomcat's default -Xmx=128m is way too small, so I
> > bumped
> > > >> it
> > > >> > > >> up to 768m (I've only got a 1GB EC2 instance (t2.micro), so I
> > > think
> > > >> > > >> 768m is living dangerously, eh?).
> > > >> > > >>
> > > >> > > >> Now I'm getting errors like
> > > >> > > >>
> > > >> > > >>    org.apache.catalina.core.ApplicationContext.log ERROR:
> > Failed
> > > >> to
> > > >> > > >> create
> > > >> > > >> a Wiki engine: JSPWiki: Unable to load and setup properties
> > from
> > > >> > > >> jspwiki.properties. Failed to start. Caused by: Failed to
> > > >> instantiate
> > > >> > > >> class
> > > >> > > >> org.apache.wiki.PageManager; please check log files for
> better
> > > >> > > >> information.
> > > >> > > >>
> > > >> > > >>    (in localhost.2017-01-08.log)
> > > >> > > >>
> > > >> > > >> and
> > > >> > > >>
> > > >> > > >>    java.io.FileNotFoundException: jspwiki.log (Permission
> > denied)
> > > >> > > >>
> > > >> > > >>    (in catalina.out)
> > > >> > > >>
> > > >> > > >> and
> > > >> > > >>
> > > >> > > >>    INFO [__DEFAULT__]
> > > >> > > >> org.apache.catalina.loader.WebappClassLoaderBase.checkStateF
> > > >> > > >> orResourceLoading
> > > >> > > >> Illegal access: this web application instance has been
> stopped
> > > >> > already.
> > > >> > > >> Could not load [net/sf/ehcache/version.properties].
> > > >> > > >>
> > > >> > > >>    (in catalina.2017-01-08.log)
> > > >> > > >>
> > > >> > > >> I grabbed jspwiki.properties with:
> > > >> > > >>
> > > >> > > >>    unzip jspwiki-war-2.10.2.jar ini/jspwiki.properties
> > > >> > > >>
> > > >> > > >> and modified it as follows (renaming it
> > > jspwiki-custom.properties):
> > > >> > > >>
> > > >> > > >>    51c51
> > > >> > > >>    < jspwiki.baseURL=http://localhost:8080/JSPWiki/
> > > >> > > >>    ---
> > > >> > > >>    > jspwiki.baseURL=http://web.how-hard-can-it-be.com/wiki/
> > > >> > > >>    102c102
> > > >> > > >>    < #  jspwiki.fileSystemProvider.pageDir =
> > > >> /p/web/www-data/jspwiki/
> > > >> > > >>    ---
> > > >> > > >>    > jspwiki.fileSystemProvider.pageDir = /etc/jspwiki/pages
> > > >> > > >>    144c144
> > > >> > > >>    < #  jspwiki.basicAttachmentProvider.storageDir =
> > > >> > C:\\Data\\jspwiki
> > > >> > > >>    ---
> > > >> > > >>    > jspwiki.basicAttachmentProvider.storageDir =
> > > >> > > >> /etc/jspwiki/attachments
> > > >> > > >>    605c605
> > > >> > > >>    < #jspwiki.xmlGroupDatabaseFile =
> > > /etc/tomcat/groupdatabase.xml
> > > >> > > >>    ---
> > > >> > > >>    > jspwiki.xmlGroupDatabaseFile =
> > > /etc/jspwiki/groupdatabase.xml
> > > >> > > >>    626c626
> > > >> > > >>    < #jspwiki.xmlUserDatabaseFile =
> > /etc/tomcat/userdatabase.xml
> > > >> > > >>    ---
> > > >> > > >>    > jspwiki.xmlUserDatabaseFile =
> > /etc/jspwiki/userdatabase.xml
> > > >> > > >>    885c885
> > > >> > > >>    < log4j.appender.FileLog.File = jspwiki.log
> > > >> > > >>    ---
> > > >> > > >>    > log4j.appender.FileLog.File =
> /var/log/jspwiki/jspwiki.log
> > > >> > > >>
> > > >> > > >> and tried deploying it to various places
> > > >> > > >> ({/var/lib,/usr/share}/tomcat8,
> /var/lib/tomcat8/webapps/wiki)
> > .
> > > >> > > >>
> > > >> > > >> All to no avail.
> > > >> > > >>
> > > >> > > >> What else can I try?
> > > >> > > >>
> > > >> > > >> (I'm kind of a Rip van Winkle Java web app developer -- the
> > last
> > > >> time
> > > >> > > >> I touched this technology stack was more than ten years ago,
> > and
> > > >> that
> > > >> > > >> was on JBoss, all of which I've forgotten except the pain.)
> > > >> > > >>
> > > >> > > >> Thanks.
> > > >> > > >>
> > > >> > > >> John.
> > > >> > > >>
> > > >> > > >
> > > >> > > > --
> > > >> > > > -------------------------
> > > >> > > >
> > > >> > > > _RICK BROCKMAN_
> > > >> > > >
> > > >> > > > _28 LANCASTER ST._
> > > >> > > >
> > > >> > > > _CHERRY VALLEY, NY 13320_
> > > >> > > >
> > > >> > > > _607 434-4746 <(607)%20434-4746>_
> > > >> > > >
> > > >> > >
> > > >> > >
> > > >> > >
> > > >> > > --
> > > >> > > Col
> > > >> > >
> > > >> >
> > > >>
> > > >
> > > >
> > >
> >
>

Re: Problem getting started on Ubuntu 16.04/Tomcat 8

Posted by Dirk Frederickx <di...@gmail.com>.
FWIW:

In the "Getting Started" page,  you  can read:

In the $TOMCAT_HOME/lib folder (or equivalent based on your servlet
container), place a jspwiki-custom.properties file, which can contain any
overrides to the defaults. See Configuration
<https://jspwiki-wiki.apache.org/Wiki.jsp?page=Configuration> for these
default values.


These properties overwrite the values of the WEB-INF/jspwiki-properties.
I always keep the  custom properties file there,  and I never have to
change the exploded war.



dirk


On Wed, Jan 11, 2017 at 5:38 AM, David Vittor <dv...@gmail.com> wrote:

> Yeah - the placing the custom properties file in the expanded war folder is
> one thing I don't like about jspwiki setup either.
>
> But I know of no workaround at the moment.
>
> Good to see you're making progress.
>
> Cheers,
> David V
>
>
>
>
> On Wed, Jan 11, 2017 at 2:28 PM, John Lusk <jo...@gmail.com> wrote:
>
> > Also: success, of sorts. Got my main page up, edited it successfully.
> >
> > There's something about the work dir not being writable, but from the O/S
> > perspective, it is. More catalina.policy magic?
> >
> > Haven't checked the log file yet, but it's probably still wrong.
> >
> > More later.
> >
> > John.
> >
> > On Tue, Jan 10, 2017 at 10:05 PM, John Lusk <jo...@gmail.com> wrote:
> >
> > > Thanks. Is there another directory than the exploded war file? Reason I
> > > ask is if I get a new war file at some point, that exploded directory
> > will
> > > go away, along w/my customized properties file.  (I'll always be able
> to
> > > restore it after a certain amount of fumbling around, but I'd expect to
> > put
> > > customizations elsewhere.)
> > >
> > > On Tue, Jan 10, 2017 at 10:01 PM, David Vittor <dv...@gmail.com>
> > wrote:
> > >
> > >> The customized properites file is: jspwiki-custom.properties
> > >>
> > >> This should be located in <tomcat>/webapps/wiki/WEB-INF/classes
> > >>
> > >> You can change the workDir, or just the log file:
> > >> jspwiki.workDir=/opt/digitalspider/jspwiki/wikis/testwiki/data/
> > >> log4j.appender.FileLog.File = /var/jspwiki/logs/jspwiki.log
> > >>
> > >> See the docs here:
> > >> * https://jspwiki-wiki.apache.org/Wiki.jsp?page=Documentation
> > >> * https://jspwiki-wiki.apache.org/Wiki.jsp?page=Getting%20Started
> > >>
> > >> But if you have a permission error, it might be more than just the log
> > >> file.
> > >>
> > >> Cheers,
> > >> David V
> > >>
> > >>
> > >>
> > >>
> > >> On Wed, Jan 11, 2017 at 1:07 PM, John Lusk <jo...@gmail.com>
> wrote:
> > >>
> > >> > Ok, so I added the following to my /etc/tomcat8/policy.d/03catali
> > >> na.policy
> > >> > file:
> > >> >
> > >> > grant codeBase "file:${catalina.base}/webapps/wiki/-" {
> > >> >   permission java.io.FilePermission "file:/usr/share/jspwiki-
> > files/-",
> > >> > "read, write";
> > >> >   permission java.security.AllPermission;
> > >> > };
> > >> >
> > >> > which (a) doesn't seem to have caused any disasters (yay), but (b)
> > >> hasn't
> > >> > done anything nice (boo). I did a /etc/init.d/tomcat8 restart. The
> > edits
> > >> > appear in /var/cache/tomcat8/catalina.policy, so I guess that's
> good.
> > >> >
> > >> > Still getting a permission error on jspwiki.log. Golly day, it sure
> > >> would
> > >> > be nice if I had a complete pathname to work with on this one. Not
> > juse
> > >> > "jspwiki.log".
> > >> >
> > >> > I have chowned various directories to tomcat8:tomcat8, which is the
> > >> userid
> > >> > the process runs under.
> > >> >
> > >> > Next step: where the heck do I put the customized properties file,
> > what
> > >> do
> > >> > I name it? Possibilities are:
> > >> >
> > >> >
> > >> >    - jspwiki.properties
> > >> >    - jspwiki-custom.properties
> > >> >    - wiki.properties
> > >> >    - wiki-custom.properties
> > >> >
> > >> > Maginc incantation, anyone? (Plus path, would be nice.)
> > >> >
> > >> > (Thanks.)
> > >> >
> > >> > John.
> > >> >
> > >> > On Mon, Jan 9, 2017 at 3:31 AM, Col Willis <co...@gmail.com>
> > >> wrote:
> > >> >
> > >> > > I had to do something funky with the catalina.policy file to get
> > >> jspwiki
> > >> > > working in tomcat8 (apt-get installed)
> > >> > >
> > >> > > grant codeBase "file:/var/lib/tomcat8/webapps/wiki/-" {
> > >> > >    // !!change the directory to the location you want to locate
> your
> > >> > > wiki files!!
> > >> > >    permission java.io.FilePermission
> > >> > > "file:/usr/share/tomcat8/jspwiki-files/-", "read, write";
> > >> > >
> > >> > >    // just allow the entire codebase permissions to do what it
> > needs.
> > >> > >    permission java.security.AllPermission;
> > >> > > };
> > >> > >
> > >> > > // this file does not exist, but it does solve a problem with
> > >> > > exceptions being thrown in syslog
> > >> > > grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
> > >> > >    permission java.io.FilePermission
> > >> > > "/var/lib/tomcat8/webapps/wiki/WEB-INF/classes/logging.
> properties",
> > >> > > "read";
> > >> > > };
> > >> > >
> > >> > >
> > >> > > On 9 January 2017 at 00:13, Rick Brockman <
> reb@richardbrockman.info
> > >
> > >> > > wrote:
> > >> > >
> > >> > > > Like you John I'm a Rip van Winkle of bygone computer days.
> > When  I
> > >> > > > installed Tomcat using apt-get I ran into problems and instead
> of
> > >> > > knocking
> > >> > > > my head against the sleep pillow, I downloaded tomcat from the
> web
> > >> and
> > >> > > its
> > >> > > > working...
> > >> > > >
> > >> > > > On 2017-01-08 16:10, John Lusk wrote:
> > >> > > >
> > >> > > >> Ok, friends.  Trying to get JSPWiki set up on a new Amazon EC2
> > >> Unbuntu
> > >> > > >> 16.04 instance I just stood up, and I'm having some trouble.
> > Help?
> > >> > > >>
> > >> > > >> I installed Tomcat8 using apt-get, I wound up with:
> > >> > > >>
> > >> > > >>    /etc/default/tomcat8
> > >> > > >>    /etc/init.d/tomcat8
> > >> > > >>    /etc/tomcat8
> > >> > > >>       Catalina/localhost/{docs,examples,host-manager,manager}
> > .xml
> > >> > > >>       (These have docbase pointing to corresponding subdirs of
> > >> > > >>       /usr/share.)
> > >> > > >>    /usr/share/tomcat8
> > >> > > >>    /var/lib/tomcat8, which has a webapps subdir.
> > >> > > >>
> > >> > > >> It all seems to be working fine.
> > >> > > >>
> > >> > > >> So, I downloaded jspwiki.war 2.10.2, renamed it to "wiki.war",
> > and
> > >> > > >> copied it to /var/lib/tomcat8/webapps, where it promptly got
> > >> unpacked.
> > >> > > >>
> > >> > > >> Now, I can see it in my Tomcat app manager, but when I attempt
> to
> > >> > > >> start it, I get failures.
> > >> > > >>
> > >> > > >> First, I got OutOfMemory errors.
> > >> > > >>
> > >> > > >> I assume Tomcat's default -Xmx=128m is way too small, so I
> bumped
> > >> it
> > >> > > >> up to 768m (I've only got a 1GB EC2 instance (t2.micro), so I
> > think
> > >> > > >> 768m is living dangerously, eh?).
> > >> > > >>
> > >> > > >> Now I'm getting errors like
> > >> > > >>
> > >> > > >>    org.apache.catalina.core.ApplicationContext.log ERROR:
> Failed
> > >> to
> > >> > > >> create
> > >> > > >> a Wiki engine: JSPWiki: Unable to load and setup properties
> from
> > >> > > >> jspwiki.properties. Failed to start. Caused by: Failed to
> > >> instantiate
> > >> > > >> class
> > >> > > >> org.apache.wiki.PageManager; please check log files for better
> > >> > > >> information.
> > >> > > >>
> > >> > > >>    (in localhost.2017-01-08.log)
> > >> > > >>
> > >> > > >> and
> > >> > > >>
> > >> > > >>    java.io.FileNotFoundException: jspwiki.log (Permission
> denied)
> > >> > > >>
> > >> > > >>    (in catalina.out)
> > >> > > >>
> > >> > > >> and
> > >> > > >>
> > >> > > >>    INFO [__DEFAULT__]
> > >> > > >> org.apache.catalina.loader.WebappClassLoaderBase.checkStateF
> > >> > > >> orResourceLoading
> > >> > > >> Illegal access: this web application instance has been stopped
> > >> > already.
> > >> > > >> Could not load [net/sf/ehcache/version.properties].
> > >> > > >>
> > >> > > >>    (in catalina.2017-01-08.log)
> > >> > > >>
> > >> > > >> I grabbed jspwiki.properties with:
> > >> > > >>
> > >> > > >>    unzip jspwiki-war-2.10.2.jar ini/jspwiki.properties
> > >> > > >>
> > >> > > >> and modified it as follows (renaming it
> > jspwiki-custom.properties):
> > >> > > >>
> > >> > > >>    51c51
> > >> > > >>    < jspwiki.baseURL=http://localhost:8080/JSPWiki/
> > >> > > >>    ---
> > >> > > >>    > jspwiki.baseURL=http://web.how-hard-can-it-be.com/wiki/
> > >> > > >>    102c102
> > >> > > >>    < #  jspwiki.fileSystemProvider.pageDir =
> > >> /p/web/www-data/jspwiki/
> > >> > > >>    ---
> > >> > > >>    > jspwiki.fileSystemProvider.pageDir = /etc/jspwiki/pages
> > >> > > >>    144c144
> > >> > > >>    < #  jspwiki.basicAttachmentProvider.storageDir =
> > >> > C:\\Data\\jspwiki
> > >> > > >>    ---
> > >> > > >>    > jspwiki.basicAttachmentProvider.storageDir =
> > >> > > >> /etc/jspwiki/attachments
> > >> > > >>    605c605
> > >> > > >>    < #jspwiki.xmlGroupDatabaseFile =
> > /etc/tomcat/groupdatabase.xml
> > >> > > >>    ---
> > >> > > >>    > jspwiki.xmlGroupDatabaseFile =
> > /etc/jspwiki/groupdatabase.xml
> > >> > > >>    626c626
> > >> > > >>    < #jspwiki.xmlUserDatabaseFile =
> /etc/tomcat/userdatabase.xml
> > >> > > >>    ---
> > >> > > >>    > jspwiki.xmlUserDatabaseFile =
> /etc/jspwiki/userdatabase.xml
> > >> > > >>    885c885
> > >> > > >>    < log4j.appender.FileLog.File = jspwiki.log
> > >> > > >>    ---
> > >> > > >>    > log4j.appender.FileLog.File = /var/log/jspwiki/jspwiki.log
> > >> > > >>
> > >> > > >> and tried deploying it to various places
> > >> > > >> ({/var/lib,/usr/share}/tomcat8, /var/lib/tomcat8/webapps/wiki)
> .
> > >> > > >>
> > >> > > >> All to no avail.
> > >> > > >>
> > >> > > >> What else can I try?
> > >> > > >>
> > >> > > >> (I'm kind of a Rip van Winkle Java web app developer -- the
> last
> > >> time
> > >> > > >> I touched this technology stack was more than ten years ago,
> and
> > >> that
> > >> > > >> was on JBoss, all of which I've forgotten except the pain.)
> > >> > > >>
> > >> > > >> Thanks.
> > >> > > >>
> > >> > > >> John.
> > >> > > >>
> > >> > > >
> > >> > > > --
> > >> > > > -------------------------
> > >> > > >
> > >> > > > _RICK BROCKMAN_
> > >> > > >
> > >> > > > _28 LANCASTER ST._
> > >> > > >
> > >> > > > _CHERRY VALLEY, NY 13320_
> > >> > > >
> > >> > > > _607 434-4746 <(607)%20434-4746>_
> > >> > > >
> > >> > >
> > >> > >
> > >> > >
> > >> > > --
> > >> > > Col
> > >> > >
> > >> >
> > >>
> > >
> > >
> >
>

Re: Problem getting started on Ubuntu 16.04/Tomcat 8

Posted by David Vittor <dv...@gmail.com>.
Yeah - the placing the custom properties file in the expanded war folder is
one thing I don't like about jspwiki setup either.

But I know of no workaround at the moment.

Good to see you're making progress.

Cheers,
David V




On Wed, Jan 11, 2017 at 2:28 PM, John Lusk <jo...@gmail.com> wrote:

> Also: success, of sorts. Got my main page up, edited it successfully.
>
> There's something about the work dir not being writable, but from the O/S
> perspective, it is. More catalina.policy magic?
>
> Haven't checked the log file yet, but it's probably still wrong.
>
> More later.
>
> John.
>
> On Tue, Jan 10, 2017 at 10:05 PM, John Lusk <jo...@gmail.com> wrote:
>
> > Thanks. Is there another directory than the exploded war file? Reason I
> > ask is if I get a new war file at some point, that exploded directory
> will
> > go away, along w/my customized properties file.  (I'll always be able to
> > restore it after a certain amount of fumbling around, but I'd expect to
> put
> > customizations elsewhere.)
> >
> > On Tue, Jan 10, 2017 at 10:01 PM, David Vittor <dv...@gmail.com>
> wrote:
> >
> >> The customized properites file is: jspwiki-custom.properties
> >>
> >> This should be located in <tomcat>/webapps/wiki/WEB-INF/classes
> >>
> >> You can change the workDir, or just the log file:
> >> jspwiki.workDir=/opt/digitalspider/jspwiki/wikis/testwiki/data/
> >> log4j.appender.FileLog.File = /var/jspwiki/logs/jspwiki.log
> >>
> >> See the docs here:
> >> * https://jspwiki-wiki.apache.org/Wiki.jsp?page=Documentation
> >> * https://jspwiki-wiki.apache.org/Wiki.jsp?page=Getting%20Started
> >>
> >> But if you have a permission error, it might be more than just the log
> >> file.
> >>
> >> Cheers,
> >> David V
> >>
> >>
> >>
> >>
> >> On Wed, Jan 11, 2017 at 1:07 PM, John Lusk <jo...@gmail.com> wrote:
> >>
> >> > Ok, so I added the following to my /etc/tomcat8/policy.d/03catali
> >> na.policy
> >> > file:
> >> >
> >> > grant codeBase "file:${catalina.base}/webapps/wiki/-" {
> >> >   permission java.io.FilePermission "file:/usr/share/jspwiki-
> files/-",
> >> > "read, write";
> >> >   permission java.security.AllPermission;
> >> > };
> >> >
> >> > which (a) doesn't seem to have caused any disasters (yay), but (b)
> >> hasn't
> >> > done anything nice (boo). I did a /etc/init.d/tomcat8 restart. The
> edits
> >> > appear in /var/cache/tomcat8/catalina.policy, so I guess that's good.
> >> >
> >> > Still getting a permission error on jspwiki.log. Golly day, it sure
> >> would
> >> > be nice if I had a complete pathname to work with on this one. Not
> juse
> >> > "jspwiki.log".
> >> >
> >> > I have chowned various directories to tomcat8:tomcat8, which is the
> >> userid
> >> > the process runs under.
> >> >
> >> > Next step: where the heck do I put the customized properties file,
> what
> >> do
> >> > I name it? Possibilities are:
> >> >
> >> >
> >> >    - jspwiki.properties
> >> >    - jspwiki-custom.properties
> >> >    - wiki.properties
> >> >    - wiki-custom.properties
> >> >
> >> > Maginc incantation, anyone? (Plus path, would be nice.)
> >> >
> >> > (Thanks.)
> >> >
> >> > John.
> >> >
> >> > On Mon, Jan 9, 2017 at 3:31 AM, Col Willis <co...@gmail.com>
> >> wrote:
> >> >
> >> > > I had to do something funky with the catalina.policy file to get
> >> jspwiki
> >> > > working in tomcat8 (apt-get installed)
> >> > >
> >> > > grant codeBase "file:/var/lib/tomcat8/webapps/wiki/-" {
> >> > >    // !!change the directory to the location you want to locate your
> >> > > wiki files!!
> >> > >    permission java.io.FilePermission
> >> > > "file:/usr/share/tomcat8/jspwiki-files/-", "read, write";
> >> > >
> >> > >    // just allow the entire codebase permissions to do what it
> needs.
> >> > >    permission java.security.AllPermission;
> >> > > };
> >> > >
> >> > > // this file does not exist, but it does solve a problem with
> >> > > exceptions being thrown in syslog
> >> > > grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
> >> > >    permission java.io.FilePermission
> >> > > "/var/lib/tomcat8/webapps/wiki/WEB-INF/classes/logging.properties",
> >> > > "read";
> >> > > };
> >> > >
> >> > >
> >> > > On 9 January 2017 at 00:13, Rick Brockman <reb@richardbrockman.info
> >
> >> > > wrote:
> >> > >
> >> > > > Like you John I'm a Rip van Winkle of bygone computer days.
> When  I
> >> > > > installed Tomcat using apt-get I ran into problems and instead of
> >> > > knocking
> >> > > > my head against the sleep pillow, I downloaded tomcat from the web
> >> and
> >> > > its
> >> > > > working...
> >> > > >
> >> > > > On 2017-01-08 16:10, John Lusk wrote:
> >> > > >
> >> > > >> Ok, friends.  Trying to get JSPWiki set up on a new Amazon EC2
> >> Unbuntu
> >> > > >> 16.04 instance I just stood up, and I'm having some trouble.
> Help?
> >> > > >>
> >> > > >> I installed Tomcat8 using apt-get, I wound up with:
> >> > > >>
> >> > > >>    /etc/default/tomcat8
> >> > > >>    /etc/init.d/tomcat8
> >> > > >>    /etc/tomcat8
> >> > > >>       Catalina/localhost/{docs,examples,host-manager,manager}
> .xml
> >> > > >>       (These have docbase pointing to corresponding subdirs of
> >> > > >>       /usr/share.)
> >> > > >>    /usr/share/tomcat8
> >> > > >>    /var/lib/tomcat8, which has a webapps subdir.
> >> > > >>
> >> > > >> It all seems to be working fine.
> >> > > >>
> >> > > >> So, I downloaded jspwiki.war 2.10.2, renamed it to "wiki.war",
> and
> >> > > >> copied it to /var/lib/tomcat8/webapps, where it promptly got
> >> unpacked.
> >> > > >>
> >> > > >> Now, I can see it in my Tomcat app manager, but when I attempt to
> >> > > >> start it, I get failures.
> >> > > >>
> >> > > >> First, I got OutOfMemory errors.
> >> > > >>
> >> > > >> I assume Tomcat's default -Xmx=128m is way too small, so I bumped
> >> it
> >> > > >> up to 768m (I've only got a 1GB EC2 instance (t2.micro), so I
> think
> >> > > >> 768m is living dangerously, eh?).
> >> > > >>
> >> > > >> Now I'm getting errors like
> >> > > >>
> >> > > >>    org.apache.catalina.core.ApplicationContext.log ERROR: Failed
> >> to
> >> > > >> create
> >> > > >> a Wiki engine: JSPWiki: Unable to load and setup properties from
> >> > > >> jspwiki.properties. Failed to start. Caused by: Failed to
> >> instantiate
> >> > > >> class
> >> > > >> org.apache.wiki.PageManager; please check log files for better
> >> > > >> information.
> >> > > >>
> >> > > >>    (in localhost.2017-01-08.log)
> >> > > >>
> >> > > >> and
> >> > > >>
> >> > > >>    java.io.FileNotFoundException: jspwiki.log (Permission denied)
> >> > > >>
> >> > > >>    (in catalina.out)
> >> > > >>
> >> > > >> and
> >> > > >>
> >> > > >>    INFO [__DEFAULT__]
> >> > > >> org.apache.catalina.loader.WebappClassLoaderBase.checkStateF
> >> > > >> orResourceLoading
> >> > > >> Illegal access: this web application instance has been stopped
> >> > already.
> >> > > >> Could not load [net/sf/ehcache/version.properties].
> >> > > >>
> >> > > >>    (in catalina.2017-01-08.log)
> >> > > >>
> >> > > >> I grabbed jspwiki.properties with:
> >> > > >>
> >> > > >>    unzip jspwiki-war-2.10.2.jar ini/jspwiki.properties
> >> > > >>
> >> > > >> and modified it as follows (renaming it
> jspwiki-custom.properties):
> >> > > >>
> >> > > >>    51c51
> >> > > >>    < jspwiki.baseURL=http://localhost:8080/JSPWiki/
> >> > > >>    ---
> >> > > >>    > jspwiki.baseURL=http://web.how-hard-can-it-be.com/wiki/
> >> > > >>    102c102
> >> > > >>    < #  jspwiki.fileSystemProvider.pageDir =
> >> /p/web/www-data/jspwiki/
> >> > > >>    ---
> >> > > >>    > jspwiki.fileSystemProvider.pageDir = /etc/jspwiki/pages
> >> > > >>    144c144
> >> > > >>    < #  jspwiki.basicAttachmentProvider.storageDir =
> >> > C:\\Data\\jspwiki
> >> > > >>    ---
> >> > > >>    > jspwiki.basicAttachmentProvider.storageDir =
> >> > > >> /etc/jspwiki/attachments
> >> > > >>    605c605
> >> > > >>    < #jspwiki.xmlGroupDatabaseFile =
> /etc/tomcat/groupdatabase.xml
> >> > > >>    ---
> >> > > >>    > jspwiki.xmlGroupDatabaseFile =
> /etc/jspwiki/groupdatabase.xml
> >> > > >>    626c626
> >> > > >>    < #jspwiki.xmlUserDatabaseFile = /etc/tomcat/userdatabase.xml
> >> > > >>    ---
> >> > > >>    > jspwiki.xmlUserDatabaseFile = /etc/jspwiki/userdatabase.xml
> >> > > >>    885c885
> >> > > >>    < log4j.appender.FileLog.File = jspwiki.log
> >> > > >>    ---
> >> > > >>    > log4j.appender.FileLog.File = /var/log/jspwiki/jspwiki.log
> >> > > >>
> >> > > >> and tried deploying it to various places
> >> > > >> ({/var/lib,/usr/share}/tomcat8, /var/lib/tomcat8/webapps/wiki).
> >> > > >>
> >> > > >> All to no avail.
> >> > > >>
> >> > > >> What else can I try?
> >> > > >>
> >> > > >> (I'm kind of a Rip van Winkle Java web app developer -- the last
> >> time
> >> > > >> I touched this technology stack was more than ten years ago, and
> >> that
> >> > > >> was on JBoss, all of which I've forgotten except the pain.)
> >> > > >>
> >> > > >> Thanks.
> >> > > >>
> >> > > >> John.
> >> > > >>
> >> > > >
> >> > > > --
> >> > > > -------------------------
> >> > > >
> >> > > > _RICK BROCKMAN_
> >> > > >
> >> > > > _28 LANCASTER ST._
> >> > > >
> >> > > > _CHERRY VALLEY, NY 13320_
> >> > > >
> >> > > > _607 434-4746 <(607)%20434-4746>_
> >> > > >
> >> > >
> >> > >
> >> > >
> >> > > --
> >> > > Col
> >> > >
> >> >
> >>
> >
> >
>

Re: Problem getting started on Ubuntu 16.04/Tomcat 8

Posted by John Lusk <jo...@gmail.com>.
Also: success, of sorts. Got my main page up, edited it successfully.

There's something about the work dir not being writable, but from the O/S
perspective, it is. More catalina.policy magic?

Haven't checked the log file yet, but it's probably still wrong.

More later.

John.

On Tue, Jan 10, 2017 at 10:05 PM, John Lusk <jo...@gmail.com> wrote:

> Thanks. Is there another directory than the exploded war file? Reason I
> ask is if I get a new war file at some point, that exploded directory will
> go away, along w/my customized properties file.  (I'll always be able to
> restore it after a certain amount of fumbling around, but I'd expect to put
> customizations elsewhere.)
>
> On Tue, Jan 10, 2017 at 10:01 PM, David Vittor <dv...@gmail.com> wrote:
>
>> The customized properites file is: jspwiki-custom.properties
>>
>> This should be located in <tomcat>/webapps/wiki/WEB-INF/classes
>>
>> You can change the workDir, or just the log file:
>> jspwiki.workDir=/opt/digitalspider/jspwiki/wikis/testwiki/data/
>> log4j.appender.FileLog.File = /var/jspwiki/logs/jspwiki.log
>>
>> See the docs here:
>> * https://jspwiki-wiki.apache.org/Wiki.jsp?page=Documentation
>> * https://jspwiki-wiki.apache.org/Wiki.jsp?page=Getting%20Started
>>
>> But if you have a permission error, it might be more than just the log
>> file.
>>
>> Cheers,
>> David V
>>
>>
>>
>>
>> On Wed, Jan 11, 2017 at 1:07 PM, John Lusk <jo...@gmail.com> wrote:
>>
>> > Ok, so I added the following to my /etc/tomcat8/policy.d/03catali
>> na.policy
>> > file:
>> >
>> > grant codeBase "file:${catalina.base}/webapps/wiki/-" {
>> >   permission java.io.FilePermission "file:/usr/share/jspwiki-files/-",
>> > "read, write";
>> >   permission java.security.AllPermission;
>> > };
>> >
>> > which (a) doesn't seem to have caused any disasters (yay), but (b)
>> hasn't
>> > done anything nice (boo). I did a /etc/init.d/tomcat8 restart. The edits
>> > appear in /var/cache/tomcat8/catalina.policy, so I guess that's good.
>> >
>> > Still getting a permission error on jspwiki.log. Golly day, it sure
>> would
>> > be nice if I had a complete pathname to work with on this one. Not juse
>> > "jspwiki.log".
>> >
>> > I have chowned various directories to tomcat8:tomcat8, which is the
>> userid
>> > the process runs under.
>> >
>> > Next step: where the heck do I put the customized properties file, what
>> do
>> > I name it? Possibilities are:
>> >
>> >
>> >    - jspwiki.properties
>> >    - jspwiki-custom.properties
>> >    - wiki.properties
>> >    - wiki-custom.properties
>> >
>> > Maginc incantation, anyone? (Plus path, would be nice.)
>> >
>> > (Thanks.)
>> >
>> > John.
>> >
>> > On Mon, Jan 9, 2017 at 3:31 AM, Col Willis <co...@gmail.com>
>> wrote:
>> >
>> > > I had to do something funky with the catalina.policy file to get
>> jspwiki
>> > > working in tomcat8 (apt-get installed)
>> > >
>> > > grant codeBase "file:/var/lib/tomcat8/webapps/wiki/-" {
>> > >    // !!change the directory to the location you want to locate your
>> > > wiki files!!
>> > >    permission java.io.FilePermission
>> > > "file:/usr/share/tomcat8/jspwiki-files/-", "read, write";
>> > >
>> > >    // just allow the entire codebase permissions to do what it needs.
>> > >    permission java.security.AllPermission;
>> > > };
>> > >
>> > > // this file does not exist, but it does solve a problem with
>> > > exceptions being thrown in syslog
>> > > grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
>> > >    permission java.io.FilePermission
>> > > "/var/lib/tomcat8/webapps/wiki/WEB-INF/classes/logging.properties",
>> > > "read";
>> > > };
>> > >
>> > >
>> > > On 9 January 2017 at 00:13, Rick Brockman <re...@richardbrockman.info>
>> > > wrote:
>> > >
>> > > > Like you John I'm a Rip van Winkle of bygone computer days.  When  I
>> > > > installed Tomcat using apt-get I ran into problems and instead of
>> > > knocking
>> > > > my head against the sleep pillow, I downloaded tomcat from the web
>> and
>> > > its
>> > > > working...
>> > > >
>> > > > On 2017-01-08 16:10, John Lusk wrote:
>> > > >
>> > > >> Ok, friends.  Trying to get JSPWiki set up on a new Amazon EC2
>> Unbuntu
>> > > >> 16.04 instance I just stood up, and I'm having some trouble.  Help?
>> > > >>
>> > > >> I installed Tomcat8 using apt-get, I wound up with:
>> > > >>
>> > > >>    /etc/default/tomcat8
>> > > >>    /etc/init.d/tomcat8
>> > > >>    /etc/tomcat8
>> > > >>       Catalina/localhost/{docs,examples,host-manager,manager}.xml
>> > > >>       (These have docbase pointing to corresponding subdirs of
>> > > >>       /usr/share.)
>> > > >>    /usr/share/tomcat8
>> > > >>    /var/lib/tomcat8, which has a webapps subdir.
>> > > >>
>> > > >> It all seems to be working fine.
>> > > >>
>> > > >> So, I downloaded jspwiki.war 2.10.2, renamed it to "wiki.war", and
>> > > >> copied it to /var/lib/tomcat8/webapps, where it promptly got
>> unpacked.
>> > > >>
>> > > >> Now, I can see it in my Tomcat app manager, but when I attempt to
>> > > >> start it, I get failures.
>> > > >>
>> > > >> First, I got OutOfMemory errors.
>> > > >>
>> > > >> I assume Tomcat's default -Xmx=128m is way too small, so I bumped
>> it
>> > > >> up to 768m (I've only got a 1GB EC2 instance (t2.micro), so I think
>> > > >> 768m is living dangerously, eh?).
>> > > >>
>> > > >> Now I'm getting errors like
>> > > >>
>> > > >>    org.apache.catalina.core.ApplicationContext.log ERROR: Failed
>> to
>> > > >> create
>> > > >> a Wiki engine: JSPWiki: Unable to load and setup properties from
>> > > >> jspwiki.properties. Failed to start. Caused by: Failed to
>> instantiate
>> > > >> class
>> > > >> org.apache.wiki.PageManager; please check log files for better
>> > > >> information.
>> > > >>
>> > > >>    (in localhost.2017-01-08.log)
>> > > >>
>> > > >> and
>> > > >>
>> > > >>    java.io.FileNotFoundException: jspwiki.log (Permission denied)
>> > > >>
>> > > >>    (in catalina.out)
>> > > >>
>> > > >> and
>> > > >>
>> > > >>    INFO [__DEFAULT__]
>> > > >> org.apache.catalina.loader.WebappClassLoaderBase.checkStateF
>> > > >> orResourceLoading
>> > > >> Illegal access: this web application instance has been stopped
>> > already.
>> > > >> Could not load [net/sf/ehcache/version.properties].
>> > > >>
>> > > >>    (in catalina.2017-01-08.log)
>> > > >>
>> > > >> I grabbed jspwiki.properties with:
>> > > >>
>> > > >>    unzip jspwiki-war-2.10.2.jar ini/jspwiki.properties
>> > > >>
>> > > >> and modified it as follows (renaming it jspwiki-custom.properties):
>> > > >>
>> > > >>    51c51
>> > > >>    < jspwiki.baseURL=http://localhost:8080/JSPWiki/
>> > > >>    ---
>> > > >>    > jspwiki.baseURL=http://web.how-hard-can-it-be.com/wiki/
>> > > >>    102c102
>> > > >>    < #  jspwiki.fileSystemProvider.pageDir =
>> /p/web/www-data/jspwiki/
>> > > >>    ---
>> > > >>    > jspwiki.fileSystemProvider.pageDir = /etc/jspwiki/pages
>> > > >>    144c144
>> > > >>    < #  jspwiki.basicAttachmentProvider.storageDir =
>> > C:\\Data\\jspwiki
>> > > >>    ---
>> > > >>    > jspwiki.basicAttachmentProvider.storageDir =
>> > > >> /etc/jspwiki/attachments
>> > > >>    605c605
>> > > >>    < #jspwiki.xmlGroupDatabaseFile = /etc/tomcat/groupdatabase.xml
>> > > >>    ---
>> > > >>    > jspwiki.xmlGroupDatabaseFile = /etc/jspwiki/groupdatabase.xml
>> > > >>    626c626
>> > > >>    < #jspwiki.xmlUserDatabaseFile = /etc/tomcat/userdatabase.xml
>> > > >>    ---
>> > > >>    > jspwiki.xmlUserDatabaseFile = /etc/jspwiki/userdatabase.xml
>> > > >>    885c885
>> > > >>    < log4j.appender.FileLog.File = jspwiki.log
>> > > >>    ---
>> > > >>    > log4j.appender.FileLog.File = /var/log/jspwiki/jspwiki.log
>> > > >>
>> > > >> and tried deploying it to various places
>> > > >> ({/var/lib,/usr/share}/tomcat8, /var/lib/tomcat8/webapps/wiki).
>> > > >>
>> > > >> All to no avail.
>> > > >>
>> > > >> What else can I try?
>> > > >>
>> > > >> (I'm kind of a Rip van Winkle Java web app developer -- the last
>> time
>> > > >> I touched this technology stack was more than ten years ago, and
>> that
>> > > >> was on JBoss, all of which I've forgotten except the pain.)
>> > > >>
>> > > >> Thanks.
>> > > >>
>> > > >> John.
>> > > >>
>> > > >
>> > > > --
>> > > > -------------------------
>> > > >
>> > > > _RICK BROCKMAN_
>> > > >
>> > > > _28 LANCASTER ST._
>> > > >
>> > > > _CHERRY VALLEY, NY 13320_
>> > > >
>> > > > _607 434-4746 <(607)%20434-4746>_
>> > > >
>> > >
>> > >
>> > >
>> > > --
>> > > Col
>> > >
>> >
>>
>
>

Re: Problem getting started on Ubuntu 16.04/Tomcat 8

Posted by John Lusk <jo...@gmail.com>.
Thanks. Is there another directory than the exploded war file? Reason I ask
is if I get a new war file at some point, that exploded directory will go
away, along w/my customized properties file.  (I'll always be able to
restore it after a certain amount of fumbling around, but I'd expect to put
customizations elsewhere.)

On Tue, Jan 10, 2017 at 10:01 PM, David Vittor <dv...@gmail.com> wrote:

> The customized properites file is: jspwiki-custom.properties
>
> This should be located in <tomcat>/webapps/wiki/WEB-INF/classes
>
> You can change the workDir, or just the log file:
> jspwiki.workDir=/opt/digitalspider/jspwiki/wikis/testwiki/data/
> log4j.appender.FileLog.File = /var/jspwiki/logs/jspwiki.log
>
> See the docs here:
> * https://jspwiki-wiki.apache.org/Wiki.jsp?page=Documentation
> * https://jspwiki-wiki.apache.org/Wiki.jsp?page=Getting%20Started
>
> But if you have a permission error, it might be more than just the log
> file.
>
> Cheers,
> David V
>
>
>
>
> On Wed, Jan 11, 2017 at 1:07 PM, John Lusk <jo...@gmail.com> wrote:
>
> > Ok, so I added the following to my /etc/tomcat8/policy.d/
> 03catalina.policy
> > file:
> >
> > grant codeBase "file:${catalina.base}/webapps/wiki/-" {
> >   permission java.io.FilePermission "file:/usr/share/jspwiki-files/-",
> > "read, write";
> >   permission java.security.AllPermission;
> > };
> >
> > which (a) doesn't seem to have caused any disasters (yay), but (b) hasn't
> > done anything nice (boo). I did a /etc/init.d/tomcat8 restart. The edits
> > appear in /var/cache/tomcat8/catalina.policy, so I guess that's good.
> >
> > Still getting a permission error on jspwiki.log. Golly day, it sure would
> > be nice if I had a complete pathname to work with on this one. Not juse
> > "jspwiki.log".
> >
> > I have chowned various directories to tomcat8:tomcat8, which is the
> userid
> > the process runs under.
> >
> > Next step: where the heck do I put the customized properties file, what
> do
> > I name it? Possibilities are:
> >
> >
> >    - jspwiki.properties
> >    - jspwiki-custom.properties
> >    - wiki.properties
> >    - wiki-custom.properties
> >
> > Maginc incantation, anyone? (Plus path, would be nice.)
> >
> > (Thanks.)
> >
> > John.
> >
> > On Mon, Jan 9, 2017 at 3:31 AM, Col Willis <co...@gmail.com> wrote:
> >
> > > I had to do something funky with the catalina.policy file to get
> jspwiki
> > > working in tomcat8 (apt-get installed)
> > >
> > > grant codeBase "file:/var/lib/tomcat8/webapps/wiki/-" {
> > >    // !!change the directory to the location you want to locate your
> > > wiki files!!
> > >    permission java.io.FilePermission
> > > "file:/usr/share/tomcat8/jspwiki-files/-", "read, write";
> > >
> > >    // just allow the entire codebase permissions to do what it needs.
> > >    permission java.security.AllPermission;
> > > };
> > >
> > > // this file does not exist, but it does solve a problem with
> > > exceptions being thrown in syslog
> > > grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
> > >    permission java.io.FilePermission
> > > "/var/lib/tomcat8/webapps/wiki/WEB-INF/classes/logging.properties",
> > > "read";
> > > };
> > >
> > >
> > > On 9 January 2017 at 00:13, Rick Brockman <re...@richardbrockman.info>
> > > wrote:
> > >
> > > > Like you John I'm a Rip van Winkle of bygone computer days.  When  I
> > > > installed Tomcat using apt-get I ran into problems and instead of
> > > knocking
> > > > my head against the sleep pillow, I downloaded tomcat from the web
> and
> > > its
> > > > working...
> > > >
> > > > On 2017-01-08 16:10, John Lusk wrote:
> > > >
> > > >> Ok, friends.  Trying to get JSPWiki set up on a new Amazon EC2
> Unbuntu
> > > >> 16.04 instance I just stood up, and I'm having some trouble.  Help?
> > > >>
> > > >> I installed Tomcat8 using apt-get, I wound up with:
> > > >>
> > > >>    /etc/default/tomcat8
> > > >>    /etc/init.d/tomcat8
> > > >>    /etc/tomcat8
> > > >>       Catalina/localhost/{docs,examples,host-manager,manager}.xml
> > > >>       (These have docbase pointing to corresponding subdirs of
> > > >>       /usr/share.)
> > > >>    /usr/share/tomcat8
> > > >>    /var/lib/tomcat8, which has a webapps subdir.
> > > >>
> > > >> It all seems to be working fine.
> > > >>
> > > >> So, I downloaded jspwiki.war 2.10.2, renamed it to "wiki.war", and
> > > >> copied it to /var/lib/tomcat8/webapps, where it promptly got
> unpacked.
> > > >>
> > > >> Now, I can see it in my Tomcat app manager, but when I attempt to
> > > >> start it, I get failures.
> > > >>
> > > >> First, I got OutOfMemory errors.
> > > >>
> > > >> I assume Tomcat's default -Xmx=128m is way too small, so I bumped it
> > > >> up to 768m (I've only got a 1GB EC2 instance (t2.micro), so I think
> > > >> 768m is living dangerously, eh?).
> > > >>
> > > >> Now I'm getting errors like
> > > >>
> > > >>    org.apache.catalina.core.ApplicationContext.log ERROR: Failed to
> > > >> create
> > > >> a Wiki engine: JSPWiki: Unable to load and setup properties from
> > > >> jspwiki.properties. Failed to start. Caused by: Failed to
> instantiate
> > > >> class
> > > >> org.apache.wiki.PageManager; please check log files for better
> > > >> information.
> > > >>
> > > >>    (in localhost.2017-01-08.log)
> > > >>
> > > >> and
> > > >>
> > > >>    java.io.FileNotFoundException: jspwiki.log (Permission denied)
> > > >>
> > > >>    (in catalina.out)
> > > >>
> > > >> and
> > > >>
> > > >>    INFO [__DEFAULT__]
> > > >> org.apache.catalina.loader.WebappClassLoaderBase.checkStateF
> > > >> orResourceLoading
> > > >> Illegal access: this web application instance has been stopped
> > already.
> > > >> Could not load [net/sf/ehcache/version.properties].
> > > >>
> > > >>    (in catalina.2017-01-08.log)
> > > >>
> > > >> I grabbed jspwiki.properties with:
> > > >>
> > > >>    unzip jspwiki-war-2.10.2.jar ini/jspwiki.properties
> > > >>
> > > >> and modified it as follows (renaming it jspwiki-custom.properties):
> > > >>
> > > >>    51c51
> > > >>    < jspwiki.baseURL=http://localhost:8080/JSPWiki/
> > > >>    ---
> > > >>    > jspwiki.baseURL=http://web.how-hard-can-it-be.com/wiki/
> > > >>    102c102
> > > >>    < #  jspwiki.fileSystemProvider.pageDir =
> /p/web/www-data/jspwiki/
> > > >>    ---
> > > >>    > jspwiki.fileSystemProvider.pageDir = /etc/jspwiki/pages
> > > >>    144c144
> > > >>    < #  jspwiki.basicAttachmentProvider.storageDir =
> > C:\\Data\\jspwiki
> > > >>    ---
> > > >>    > jspwiki.basicAttachmentProvider.storageDir =
> > > >> /etc/jspwiki/attachments
> > > >>    605c605
> > > >>    < #jspwiki.xmlGroupDatabaseFile = /etc/tomcat/groupdatabase.xml
> > > >>    ---
> > > >>    > jspwiki.xmlGroupDatabaseFile = /etc/jspwiki/groupdatabase.xml
> > > >>    626c626
> > > >>    < #jspwiki.xmlUserDatabaseFile = /etc/tomcat/userdatabase.xml
> > > >>    ---
> > > >>    > jspwiki.xmlUserDatabaseFile = /etc/jspwiki/userdatabase.xml
> > > >>    885c885
> > > >>    < log4j.appender.FileLog.File = jspwiki.log
> > > >>    ---
> > > >>    > log4j.appender.FileLog.File = /var/log/jspwiki/jspwiki.log
> > > >>
> > > >> and tried deploying it to various places
> > > >> ({/var/lib,/usr/share}/tomcat8, /var/lib/tomcat8/webapps/wiki).
> > > >>
> > > >> All to no avail.
> > > >>
> > > >> What else can I try?
> > > >>
> > > >> (I'm kind of a Rip van Winkle Java web app developer -- the last
> time
> > > >> I touched this technology stack was more than ten years ago, and
> that
> > > >> was on JBoss, all of which I've forgotten except the pain.)
> > > >>
> > > >> Thanks.
> > > >>
> > > >> John.
> > > >>
> > > >
> > > > --
> > > > -------------------------
> > > >
> > > > _RICK BROCKMAN_
> > > >
> > > > _28 LANCASTER ST._
> > > >
> > > > _CHERRY VALLEY, NY 13320_
> > > >
> > > > _607 434-4746_
> > > >
> > >
> > >
> > >
> > > --
> > > Col
> > >
> >
>

Re: Problem getting started on Ubuntu 16.04/Tomcat 8

Posted by David Vittor <dv...@gmail.com>.
The customized properites file is: jspwiki-custom.properties

This should be located in <tomcat>/webapps/wiki/WEB-INF/classes

You can change the workDir, or just the log file:
jspwiki.workDir=/opt/digitalspider/jspwiki/wikis/testwiki/data/
log4j.appender.FileLog.File = /var/jspwiki/logs/jspwiki.log

See the docs here:
* https://jspwiki-wiki.apache.org/Wiki.jsp?page=Documentation
* https://jspwiki-wiki.apache.org/Wiki.jsp?page=Getting%20Started

But if you have a permission error, it might be more than just the log file.

Cheers,
David V




On Wed, Jan 11, 2017 at 1:07 PM, John Lusk <jo...@gmail.com> wrote:

> Ok, so I added the following to my /etc/tomcat8/policy.d/03catalina.policy
> file:
>
> grant codeBase "file:${catalina.base}/webapps/wiki/-" {
>   permission java.io.FilePermission "file:/usr/share/jspwiki-files/-",
> "read, write";
>   permission java.security.AllPermission;
> };
>
> which (a) doesn't seem to have caused any disasters (yay), but (b) hasn't
> done anything nice (boo). I did a /etc/init.d/tomcat8 restart. The edits
> appear in /var/cache/tomcat8/catalina.policy, so I guess that's good.
>
> Still getting a permission error on jspwiki.log. Golly day, it sure would
> be nice if I had a complete pathname to work with on this one. Not juse
> "jspwiki.log".
>
> I have chowned various directories to tomcat8:tomcat8, which is the userid
> the process runs under.
>
> Next step: where the heck do I put the customized properties file, what do
> I name it? Possibilities are:
>
>
>    - jspwiki.properties
>    - jspwiki-custom.properties
>    - wiki.properties
>    - wiki-custom.properties
>
> Maginc incantation, anyone? (Plus path, would be nice.)
>
> (Thanks.)
>
> John.
>
> On Mon, Jan 9, 2017 at 3:31 AM, Col Willis <co...@gmail.com> wrote:
>
> > I had to do something funky with the catalina.policy file to get jspwiki
> > working in tomcat8 (apt-get installed)
> >
> > grant codeBase "file:/var/lib/tomcat8/webapps/wiki/-" {
> >    // !!change the directory to the location you want to locate your
> > wiki files!!
> >    permission java.io.FilePermission
> > "file:/usr/share/tomcat8/jspwiki-files/-", "read, write";
> >
> >    // just allow the entire codebase permissions to do what it needs.
> >    permission java.security.AllPermission;
> > };
> >
> > // this file does not exist, but it does solve a problem with
> > exceptions being thrown in syslog
> > grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
> >    permission java.io.FilePermission
> > "/var/lib/tomcat8/webapps/wiki/WEB-INF/classes/logging.properties",
> > "read";
> > };
> >
> >
> > On 9 January 2017 at 00:13, Rick Brockman <re...@richardbrockman.info>
> > wrote:
> >
> > > Like you John I'm a Rip van Winkle of bygone computer days.  When  I
> > > installed Tomcat using apt-get I ran into problems and instead of
> > knocking
> > > my head against the sleep pillow, I downloaded tomcat from the web and
> > its
> > > working...
> > >
> > > On 2017-01-08 16:10, John Lusk wrote:
> > >
> > >> Ok, friends.  Trying to get JSPWiki set up on a new Amazon EC2 Unbuntu
> > >> 16.04 instance I just stood up, and I'm having some trouble.  Help?
> > >>
> > >> I installed Tomcat8 using apt-get, I wound up with:
> > >>
> > >>    /etc/default/tomcat8
> > >>    /etc/init.d/tomcat8
> > >>    /etc/tomcat8
> > >>       Catalina/localhost/{docs,examples,host-manager,manager}.xml
> > >>       (These have docbase pointing to corresponding subdirs of
> > >>       /usr/share.)
> > >>    /usr/share/tomcat8
> > >>    /var/lib/tomcat8, which has a webapps subdir.
> > >>
> > >> It all seems to be working fine.
> > >>
> > >> So, I downloaded jspwiki.war 2.10.2, renamed it to "wiki.war", and
> > >> copied it to /var/lib/tomcat8/webapps, where it promptly got unpacked.
> > >>
> > >> Now, I can see it in my Tomcat app manager, but when I attempt to
> > >> start it, I get failures.
> > >>
> > >> First, I got OutOfMemory errors.
> > >>
> > >> I assume Tomcat's default -Xmx=128m is way too small, so I bumped it
> > >> up to 768m (I've only got a 1GB EC2 instance (t2.micro), so I think
> > >> 768m is living dangerously, eh?).
> > >>
> > >> Now I'm getting errors like
> > >>
> > >>    org.apache.catalina.core.ApplicationContext.log ERROR: Failed to
> > >> create
> > >> a Wiki engine: JSPWiki: Unable to load and setup properties from
> > >> jspwiki.properties. Failed to start. Caused by: Failed to instantiate
> > >> class
> > >> org.apache.wiki.PageManager; please check log files for better
> > >> information.
> > >>
> > >>    (in localhost.2017-01-08.log)
> > >>
> > >> and
> > >>
> > >>    java.io.FileNotFoundException: jspwiki.log (Permission denied)
> > >>
> > >>    (in catalina.out)
> > >>
> > >> and
> > >>
> > >>    INFO [__DEFAULT__]
> > >> org.apache.catalina.loader.WebappClassLoaderBase.checkStateF
> > >> orResourceLoading
> > >> Illegal access: this web application instance has been stopped
> already.
> > >> Could not load [net/sf/ehcache/version.properties].
> > >>
> > >>    (in catalina.2017-01-08.log)
> > >>
> > >> I grabbed jspwiki.properties with:
> > >>
> > >>    unzip jspwiki-war-2.10.2.jar ini/jspwiki.properties
> > >>
> > >> and modified it as follows (renaming it jspwiki-custom.properties):
> > >>
> > >>    51c51
> > >>    < jspwiki.baseURL=http://localhost:8080/JSPWiki/
> > >>    ---
> > >>    > jspwiki.baseURL=http://web.how-hard-can-it-be.com/wiki/
> > >>    102c102
> > >>    < #  jspwiki.fileSystemProvider.pageDir = /p/web/www-data/jspwiki/
> > >>    ---
> > >>    > jspwiki.fileSystemProvider.pageDir = /etc/jspwiki/pages
> > >>    144c144
> > >>    < #  jspwiki.basicAttachmentProvider.storageDir =
> C:\\Data\\jspwiki
> > >>    ---
> > >>    > jspwiki.basicAttachmentProvider.storageDir =
> > >> /etc/jspwiki/attachments
> > >>    605c605
> > >>    < #jspwiki.xmlGroupDatabaseFile = /etc/tomcat/groupdatabase.xml
> > >>    ---
> > >>    > jspwiki.xmlGroupDatabaseFile = /etc/jspwiki/groupdatabase.xml
> > >>    626c626
> > >>    < #jspwiki.xmlUserDatabaseFile = /etc/tomcat/userdatabase.xml
> > >>    ---
> > >>    > jspwiki.xmlUserDatabaseFile = /etc/jspwiki/userdatabase.xml
> > >>    885c885
> > >>    < log4j.appender.FileLog.File = jspwiki.log
> > >>    ---
> > >>    > log4j.appender.FileLog.File = /var/log/jspwiki/jspwiki.log
> > >>
> > >> and tried deploying it to various places
> > >> ({/var/lib,/usr/share}/tomcat8, /var/lib/tomcat8/webapps/wiki).
> > >>
> > >> All to no avail.
> > >>
> > >> What else can I try?
> > >>
> > >> (I'm kind of a Rip van Winkle Java web app developer -- the last time
> > >> I touched this technology stack was more than ten years ago, and that
> > >> was on JBoss, all of which I've forgotten except the pain.)
> > >>
> > >> Thanks.
> > >>
> > >> John.
> > >>
> > >
> > > --
> > > -------------------------
> > >
> > > _RICK BROCKMAN_
> > >
> > > _28 LANCASTER ST._
> > >
> > > _CHERRY VALLEY, NY 13320_
> > >
> > > _607 434-4746_
> > >
> >
> >
> >
> > --
> > Col
> >
>

Re: Problem getting started on Ubuntu 16.04/Tomcat 8

Posted by John Lusk <jo...@gmail.com>.
Once more, with feeling (and without an attachment):

This file/page/entry is some notes on how I got JSPWiki running on Tomcat8
on an Ubuntu 16.04 LTS
image running on an Amazon Web Services (AWS) Elastic Compute Cloud (EC2)
instance.

It's an edited version of a question I posted to the users' mailing list.

* Initial Setup: Tomcat 8

  I installed Tomcat8 using apt-get, I wound up with:

  #+BEGIN_EXAMPLE
    /etc/default/tomcat8
    /etc/init.d/tomcat8
    /etc/tomcat8
       Catalina/localhost/{docs,examples,host-manager,manager}.xml
       (These have docbase pointing to corresponding subdirs of
       /usr/share.)
    /usr/share/tomcat8
    /var/lib/tomcat8, which has a webapps subdir.
       (Note that the real index.html page seems to be at
       /var/lib/tomcat8/webapps/ROOT,
       not /usr/share/tomcat8-root/default_root/index.html.
       I'm not sure why it's set up this way.)
  #+END_EXAMPLE

  (For good measure, I chown'd a bunch of directories from root to
tomcat8:tomcat8. Basically,
  whatever I thought the Tomcat process would need to have write permission
for.)

  Here's a breakdown of directory contents, as far as I can tell:

  - /etc/default/tomcat8 :: Shell variables for running
=/etc/init.d/tomcat8=.  This is where you
       turn on =authbind= and set the maximum heap size for the JVM.
  - /etc/init.d/tomcat8 :: Script run at boot time (and at shutdown time)
to fire up (and gracefully
       shut down) the Tomcat server.  Uses variables set in
=/etc/default/tomcat8=.
  - /etc/tomcat8 :: Various config files for Tomcat, including
userid/password for running the
       manager app.
    - Catalina/localhost :: Subdirectory containing XML files configuring
various context paths for
         different web apps in Tomcat.  (The "context path" is the part of
the URL that comes after
         the host but before the various nitty-gritty names of web pages
and servlets. It's
         basically the name of the web app, in one sense, and it's what
allows different apps to run
         simultaneously on the same server, since they might have pages
with the same name (e.g.,
         =Login.jsp=).
  - /usr/share/tomcat8 :: The binaries for the Tomcat server itself.
  - /var/lib/tomcat8 :: This is basically where Tomcat apps live (unless
they're configured with
       different paths on a per-app basic with the context XMLs in
       =/etc/tomcat8/Catalina/localhost=, something I don't think you need
to worry about to run
       JSPWiki).
    - webapps :: Where your war file goes (it should be automatically
unzipped as soon as you drop
         it in there), and is also where your =jspwiki-custom.properties=
file goes.
      - ROOT :: Subdir of =webapps= where you will find your static
=index.html= for all of
           Tomcat8 (the "It works!" page).  You can add links to various
apps running on the server
           (such as your wiki) here if you want.

  I also installed =authbind=, in order to bind to ports < 1023 without
running as root.  Can't
  remember where I saw this, but it's pretty much everywhere.

  It all seems to be working fine.

* JSPWiki

  So, I downloaded jspwiki.war 2.10.2, renamed it to "wiki.war" (because
the context path should
  really just be "wiki", so I can switch wiki platforms at some point in
the future (ha!)), and
  copied it to /var/lib/tomcat8/webapps, where it promptly got unpacked.

  Now, I can see it in my Tomcat app manager, but when I attempt to start
it, I get failures.

  First, I got OutOfMemory errors.

  I assume Tomcat's default -Xmx=128m is way too small, so I bumped it up
to 768m in
  =/etc/default/tomcat8=.  (I've only got a 1GB EC2 instance (t2.micro), so
I think 768m is living
  dangerously, eh?).

  Now I'm getting errors like

  #+BEGIN_EXAMPLE
    org.apache.catalina.core.ApplicationContext.log ERROR: Failed to create
a Wiki engine: JSPWiki: Unable to load and setup properties from
jspwiki.properties. Failed to start. Caused by: Failed to instantiate class
org.apache.wiki.PageManager; please check log files for better information.
   #+END_EXAMPLE

  (in localhost.2017-01-08.log)

  and

  #+BEGIN_EXAMPLE
    java.io.FileNotFoundException: jspwiki.log (Permission denied)
  #+END_EXAMPLE

   (in catalina.out)

   and

   #+BEGIN_EXAMPLE
     INFO [__DEFAULT__]
org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading
Illegal access: this web application instance has been stopped already.
Could not load [net/sf/ehcache/version.properties].
   #+END_EXAMPLE

   (in catalina.2017-01-08.log)

   I grabbed jspwiki.properties with:

   : unzip jspwiki-war-2.10.2.jar ini/jspwiki.properties

   renamed it =jspwiki-custom.properties=, modified it as follows:

   #+BEGIN_EXAMPLE
     --- jspwiki.properties  2017-01-21 05:51:16.428657332 +0000
     +++ jspwiki-custom.properties   2017-01-21 05:48:36.894315773 +0000
     @@ -46,7 +46,7 @@
      #  Example:
      #  jspwiki.baseURL = http://jspwiki.apache.org/
      #
     -jspwiki.baseURL=http://localhost:8080/JSPWiki/
     +jspwiki.baseURL=http://web.how-hard-can-it-be.com/wiki/

      #
      #  Which page provider class to use.  Possibilities are:
     @@ -97,7 +97,7 @@
      #
      #  Determines where wiki files are kept for FileSystemProvider i.e.:
      #
     -#  jspwiki.fileSystemProvider.pageDir = /p/web/www-data/jspwiki/
     +jspwiki.fileSystemProvider.pageDir = /usr/share/jspwiki/pages
      #
      #  If you're using Windows, then you must duplicate the backslashes.
      #  For example, use:
     @@ -117,7 +117,7 @@
      #  The working directory is used to cache things like Lucene search
      #  results.
      #
     -#jspwiki.workDir =
     +jspwiki.workDir = /usr/share/jspwiki/work

      #
      #  ATTACHMENTS:
     @@ -139,7 +139,7 @@
      #  If you're using Windows, then you must duplicate the backslashes.
      #  For example, use:
      #
     -#  jspwiki.basicAttachmentProvider.storageDir = C:\\Data\\jspwiki
     +jspwiki.basicAttachmentProvider.storageDir =
/usr/share/jspwiki/attachments
      #
      #  If not provided, will default to a "jspwiki-files" directory
      #  in the user's home folder.
     @@ -376,6 +376,10 @@
      jspwiki.specialPage.Preferences = UserPreferences.jsp
      jspwiki.specialPage.FindPage = FindPage.jsp

     +# From docs on AdminPages (
https://jspwiki-wiki.apache.org/Wiki.jsp?page=AdminPages):
     +jspwiki-x.adminui.enable=true
     +# jspwiki-x.securityconfig.enable=true
     +

#############################################################################
      #
      #  Plugin search paths.
     @@ -600,7 +604,7 @@
      #  ok to leave this un-set, as long as users know that their groups
could
      #  "disappear" if the wiki app is ever redeployed.

     -#jspwiki.xmlGroupDatabaseFile = /etc/tomcat/groupdatabase.xml
     +jspwiki.xmlGroupDatabaseFile = /etc/jspwiki/groupdatabase.xml

      #  USER DATABASE
      #  User's wiki profiles are stored in a UserDatabase. The default
user database
     @@ -621,7 +625,7 @@
      #  ok to leave this un-set, as long as users know that their profiles
could
      #  "disappear" if the wiki app is ever redeployed.

     -#jspwiki.xmlUserDatabaseFile = /etc/tomcat/userdatabase.xml
     +jspwiki.xmlUserDatabaseFile = /etc/jspwiki/userdatabase.xml

      # You can also use a JDBC database for storing user profiles,
      # to be configured below in the JDBC section. See the online
     @@ -880,7 +884,7 @@
      log4j.appender.FileLog = org.apache.log4j.RollingFileAppender
      log4j.appender.FileLog.MaxFileSize    = 10MB
      log4j.appender.FileLog.MaxBackupIndex = 14
     -log4j.appender.FileLog.File = jspwiki.log
     +log4j.appender.FileLog.File = /var/log/jspwiki/jspwiki.log
      log4j.appender.FileLog.layout = org.apache.log4j.PatternLayout
      log4j.appender.FileLog.layout.ConversionPattern=%d [%t] %p %c %x -
%m%n
   #+END_EXAMPLE

   and copied it to =/var/lib/tomcat8/webapps/wiki/WEB-INF/classes=.

   This is all somewhat counterintuitive, but basically (I think), this
directory is on the
   classpath for the webapp, even though it's empty.  (There's also a =lib=
directory that has the
   webapp's .jar files, as opposed to single .class files.)

   *Note the complete pathname for =jspwiki.log= above.*  Now were I to get
a permission error on
   "jspwiki.log", I'd know what path was being attempted.  As it happens, I
made the directory
   read/write by user:group tomcat8:tomcat8, so I get no errors.

* =catalina.policy= hijinks

  *(NOTE: I am certain this section isn't necessary, or even a good idea,
since the specified path
  doesn't exist.  I'm leaving this note in, though, in case it's useful for
somebody else.)*

  Ok, so I added the following to my
/etc/tomcat8/policy.d/03catalina.policy file:

  #+BEGIN_EXAMPLE
    grant codeBase "file:${catalina.base}/webapps/wiki/-" {
    permission java.io.FilePermission "file:/usr/share/jspwiki-files/-",
    "read, write";
    permission java.security.AllPermission;
    };
  #+END_EXAMPLE

  which (a) doesn't seem to have caused any disasters (yay), but (b) hasn't
done anything nice
  (boo). I did a /etc/init.d/tomcat8 restart. The edits appear in
  /var/cache/tomcat8/catalina.policy, so I guess that's good.

* Customization of =jspwiki.policy=

  (In /var/lib/tomcat8/webapps/wiki/WEB-INF.)

  Once I got the wiki working, I proceeded to mangle the webapp's policy
file to allow a
  public-facing blog/wiki ("bliki") in which I am the only author.

  One note: Before I did this, I created a login ("john") and a group with
special name "Admin"
  (case-sensitive?) via the public "create your own account!" page.  Once
that was done, I was able
  to close off the wiki with the following edits.

  #+BEGIN_EXAMPLE
    --- jspwiki.policy.orig 2017-01-21 04:44:47.490238637 +0000
    +++ jspwiki.policy      2017-01-21 05:22:08.370383295 +0000
    @@ -49,8 +49,8 @@

     grant principal org.apache.wiki.auth.authorize.Role "All" {
         permission org.apache.wiki.auth.permissions.PagePermission "*:*",
"view";
    -    permission org.apache.wiki.auth.permissions.WikiPermission "*",
"editPreferences";
    -    permission org.apache.wiki.auth.permissions.WikiPermission "*",
"editProfile";
    +//    permission org.apache.wiki.auth.permissions.WikiPermission "*",
"editPreferences";
    +//    permission org.apache.wiki.auth.permissions.WikiPermission "*",
"editProfile";
         permission org.apache.wiki.auth.permissions.WikiPermission "*",
"login";
     };

    @@ -66,8 +66,8 @@
     // allow editing only, then replace "modify" with "edit".

     grant principal org.apache.wiki.auth.authorize.Role "Anonymous" {
    -    permission org.apache.wiki.auth.permissions.PagePermission "*:*",
"modify";
    -    permission org.apache.wiki.auth.permissions.WikiPermission "*",
"createPages";
    +//    permission org.apache.wiki.auth.permissions.PagePermission
"*:*", "modify";
    +//    permission org.apache.wiki.auth.permissions.WikiPermission "*",
"createPages";
     };


    @@ -77,8 +77,8 @@
     // They can also view the membership list of groups.

     grant principal org.apache.wiki.auth.authorize.Role "Asserted" {
    -    permission org.apache.wiki.auth.permissions.PagePermission "*:*",
"modify";
    -    permission org.apache.wiki.auth.permissions.WikiPermission "*",
"createPages";
    +//    permission org.apache.wiki.auth.permissions.PagePermission
"*:*", "modify";
    +//    permission org.apache.wiki.auth.permissions.WikiPermission "*",
"createPages";
         permission org.apache.wiki.auth.permissions.GroupPermission "*:*",
"view";
     };

    @@ -93,6 +93,9 @@
         permission org.apache.wiki.auth.permissions.GroupPermission "*:*",
"view";
         permission org.apache.wiki.auth.permissions.GroupPermission
"*:<groupmember>", "edit";
         permission org.apache.wiki.auth.permissions.WikiPermission "*",
"createPages,createGroups";
    +       // Permissions xferred from "All" role:
    +    permission org.apache.wiki.auth.permissions.WikiPermission "*",
"editPreferences";
    +    permission org.apache.wiki.auth.permissions.WikiPermission "*",
"editProfile";
     };
  #+END_EXAMPLE



On Sun, Jan 29, 2017 at 9:12 PM, John Lusk <jo...@gmail.com> wrote:

> Ok, gang. Foster Schucker asked for a writeup of my experience, and I'm
> slapping it in here (let's see if I can get away with an attachment). Can
> anybody suggest a place to add it to the JSPWiki wiki? If so, I'll mangle
> it in to Creole; but, if not, I won't bother.
>
> John.
>
>
>
> On Wed, Jan 11, 2017 at 9:24 AM, Foster Schucker <Fo...@schucker.org>
> wrote:
>
>> Once you figure everything out, can you put a page on the JSPWiki site?
>> These config things happen and your work making it work on Amazon is a
>> great thing.
>>
>> Thanks!
>> Foster
>>
>>
>>
>

Re: Problem getting started on Ubuntu 16.04/Tomcat 8

Posted by John Lusk <jo...@gmail.com>.
Ok, gang. Foster Schucker asked for a writeup of my experience, and I'm
slapping it in here (let's see if I can get away with an attachment). Can
anybody suggest a place to add it to the JSPWiki wiki? If so, I'll mangle
it in to Creole; but, if not, I won't bother.

John.



On Wed, Jan 11, 2017 at 9:24 AM, Foster Schucker <Fo...@schucker.org>
wrote:

> Once you figure everything out, can you put a page on the JSPWiki site?
> These config things happen and your work making it work on Amazon is a
> great thing.
>
> Thanks!
> Foster
>
>
>

Re: Problem getting started on Ubuntu 16.04/Tomcat 8

Posted by John Lusk <jo...@gmail.com>.
Ok, so I added the following to my /etc/tomcat8/policy.d/03catalina.policy
file:

grant codeBase "file:${catalina.base}/webapps/wiki/-" {
  permission java.io.FilePermission "file:/usr/share/jspwiki-files/-",
"read, write";
  permission java.security.AllPermission;
};

which (a) doesn't seem to have caused any disasters (yay), but (b) hasn't
done anything nice (boo). I did a /etc/init.d/tomcat8 restart. The edits
appear in /var/cache/tomcat8/catalina.policy, so I guess that's good.

Still getting a permission error on jspwiki.log. Golly day, it sure would
be nice if I had a complete pathname to work with on this one. Not juse
"jspwiki.log".

I have chowned various directories to tomcat8:tomcat8, which is the userid
the process runs under.

Next step: where the heck do I put the customized properties file, what do
I name it? Possibilities are:


   - jspwiki.properties
   - jspwiki-custom.properties
   - wiki.properties
   - wiki-custom.properties

Maginc incantation, anyone? (Plus path, would be nice.)

(Thanks.)

John.

On Mon, Jan 9, 2017 at 3:31 AM, Col Willis <co...@gmail.com> wrote:

> I had to do something funky with the catalina.policy file to get jspwiki
> working in tomcat8 (apt-get installed)
>
> grant codeBase "file:/var/lib/tomcat8/webapps/wiki/-" {
>    // !!change the directory to the location you want to locate your
> wiki files!!
>    permission java.io.FilePermission
> "file:/usr/share/tomcat8/jspwiki-files/-", "read, write";
>
>    // just allow the entire codebase permissions to do what it needs.
>    permission java.security.AllPermission;
> };
>
> // this file does not exist, but it does solve a problem with
> exceptions being thrown in syslog
> grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
>    permission java.io.FilePermission
> "/var/lib/tomcat8/webapps/wiki/WEB-INF/classes/logging.properties",
> "read";
> };
>
>
> On 9 January 2017 at 00:13, Rick Brockman <re...@richardbrockman.info>
> wrote:
>
> > Like you John I'm a Rip van Winkle of bygone computer days.  When  I
> > installed Tomcat using apt-get I ran into problems and instead of
> knocking
> > my head against the sleep pillow, I downloaded tomcat from the web and
> its
> > working...
> >
> > On 2017-01-08 16:10, John Lusk wrote:
> >
> >> Ok, friends.  Trying to get JSPWiki set up on a new Amazon EC2 Unbuntu
> >> 16.04 instance I just stood up, and I'm having some trouble.  Help?
> >>
> >> I installed Tomcat8 using apt-get, I wound up with:
> >>
> >>    /etc/default/tomcat8
> >>    /etc/init.d/tomcat8
> >>    /etc/tomcat8
> >>       Catalina/localhost/{docs,examples,host-manager,manager}.xml
> >>       (These have docbase pointing to corresponding subdirs of
> >>       /usr/share.)
> >>    /usr/share/tomcat8
> >>    /var/lib/tomcat8, which has a webapps subdir.
> >>
> >> It all seems to be working fine.
> >>
> >> So, I downloaded jspwiki.war 2.10.2, renamed it to "wiki.war", and
> >> copied it to /var/lib/tomcat8/webapps, where it promptly got unpacked.
> >>
> >> Now, I can see it in my Tomcat app manager, but when I attempt to
> >> start it, I get failures.
> >>
> >> First, I got OutOfMemory errors.
> >>
> >> I assume Tomcat's default -Xmx=128m is way too small, so I bumped it
> >> up to 768m (I've only got a 1GB EC2 instance (t2.micro), so I think
> >> 768m is living dangerously, eh?).
> >>
> >> Now I'm getting errors like
> >>
> >>    org.apache.catalina.core.ApplicationContext.log ERROR: Failed to
> >> create
> >> a Wiki engine: JSPWiki: Unable to load and setup properties from
> >> jspwiki.properties. Failed to start. Caused by: Failed to instantiate
> >> class
> >> org.apache.wiki.PageManager; please check log files for better
> >> information.
> >>
> >>    (in localhost.2017-01-08.log)
> >>
> >> and
> >>
> >>    java.io.FileNotFoundException: jspwiki.log (Permission denied)
> >>
> >>    (in catalina.out)
> >>
> >> and
> >>
> >>    INFO [__DEFAULT__]
> >> org.apache.catalina.loader.WebappClassLoaderBase.checkStateF
> >> orResourceLoading
> >> Illegal access: this web application instance has been stopped already.
> >> Could not load [net/sf/ehcache/version.properties].
> >>
> >>    (in catalina.2017-01-08.log)
> >>
> >> I grabbed jspwiki.properties with:
> >>
> >>    unzip jspwiki-war-2.10.2.jar ini/jspwiki.properties
> >>
> >> and modified it as follows (renaming it jspwiki-custom.properties):
> >>
> >>    51c51
> >>    < jspwiki.baseURL=http://localhost:8080/JSPWiki/
> >>    ---
> >>    > jspwiki.baseURL=http://web.how-hard-can-it-be.com/wiki/
> >>    102c102
> >>    < #  jspwiki.fileSystemProvider.pageDir = /p/web/www-data/jspwiki/
> >>    ---
> >>    > jspwiki.fileSystemProvider.pageDir = /etc/jspwiki/pages
> >>    144c144
> >>    < #  jspwiki.basicAttachmentProvider.storageDir = C:\\Data\\jspwiki
> >>    ---
> >>    > jspwiki.basicAttachmentProvider.storageDir =
> >> /etc/jspwiki/attachments
> >>    605c605
> >>    < #jspwiki.xmlGroupDatabaseFile = /etc/tomcat/groupdatabase.xml
> >>    ---
> >>    > jspwiki.xmlGroupDatabaseFile = /etc/jspwiki/groupdatabase.xml
> >>    626c626
> >>    < #jspwiki.xmlUserDatabaseFile = /etc/tomcat/userdatabase.xml
> >>    ---
> >>    > jspwiki.xmlUserDatabaseFile = /etc/jspwiki/userdatabase.xml
> >>    885c885
> >>    < log4j.appender.FileLog.File = jspwiki.log
> >>    ---
> >>    > log4j.appender.FileLog.File = /var/log/jspwiki/jspwiki.log
> >>
> >> and tried deploying it to various places
> >> ({/var/lib,/usr/share}/tomcat8, /var/lib/tomcat8/webapps/wiki).
> >>
> >> All to no avail.
> >>
> >> What else can I try?
> >>
> >> (I'm kind of a Rip van Winkle Java web app developer -- the last time
> >> I touched this technology stack was more than ten years ago, and that
> >> was on JBoss, all of which I've forgotten except the pain.)
> >>
> >> Thanks.
> >>
> >> John.
> >>
> >
> > --
> > -------------------------
> >
> > _RICK BROCKMAN_
> >
> > _28 LANCASTER ST._
> >
> > _CHERRY VALLEY, NY 13320_
> >
> > _607 434-4746_
> >
>
>
>
> --
> Col
>

Re: Problem getting started on Ubuntu 16.04/Tomcat 8

Posted by Col Willis <co...@gmail.com>.
I had to do something funky with the catalina.policy file to get jspwiki
working in tomcat8 (apt-get installed)

grant codeBase "file:/var/lib/tomcat8/webapps/wiki/-" {
   // !!change the directory to the location you want to locate your
wiki files!!
   permission java.io.FilePermission
"file:/usr/share/tomcat8/jspwiki-files/-", "read, write";

   // just allow the entire codebase permissions to do what it needs.
   permission java.security.AllPermission;
};

// this file does not exist, but it does solve a problem with
exceptions being thrown in syslog
grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
   permission java.io.FilePermission
"/var/lib/tomcat8/webapps/wiki/WEB-INF/classes/logging.properties",
"read";
};


On 9 January 2017 at 00:13, Rick Brockman <re...@richardbrockman.info> wrote:

> Like you John I'm a Rip van Winkle of bygone computer days.  When  I
> installed Tomcat using apt-get I ran into problems and instead of knocking
> my head against the sleep pillow, I downloaded tomcat from the web and its
> working...
>
> On 2017-01-08 16:10, John Lusk wrote:
>
>> Ok, friends.  Trying to get JSPWiki set up on a new Amazon EC2 Unbuntu
>> 16.04 instance I just stood up, and I'm having some trouble.  Help?
>>
>> I installed Tomcat8 using apt-get, I wound up with:
>>
>>    /etc/default/tomcat8
>>    /etc/init.d/tomcat8
>>    /etc/tomcat8
>>       Catalina/localhost/{docs,examples,host-manager,manager}.xml
>>       (These have docbase pointing to corresponding subdirs of
>>       /usr/share.)
>>    /usr/share/tomcat8
>>    /var/lib/tomcat8, which has a webapps subdir.
>>
>> It all seems to be working fine.
>>
>> So, I downloaded jspwiki.war 2.10.2, renamed it to "wiki.war", and
>> copied it to /var/lib/tomcat8/webapps, where it promptly got unpacked.
>>
>> Now, I can see it in my Tomcat app manager, but when I attempt to
>> start it, I get failures.
>>
>> First, I got OutOfMemory errors.
>>
>> I assume Tomcat's default -Xmx=128m is way too small, so I bumped it
>> up to 768m (I've only got a 1GB EC2 instance (t2.micro), so I think
>> 768m is living dangerously, eh?).
>>
>> Now I'm getting errors like
>>
>>    org.apache.catalina.core.ApplicationContext.log ERROR: Failed to
>> create
>> a Wiki engine: JSPWiki: Unable to load and setup properties from
>> jspwiki.properties. Failed to start. Caused by: Failed to instantiate
>> class
>> org.apache.wiki.PageManager; please check log files for better
>> information.
>>
>>    (in localhost.2017-01-08.log)
>>
>> and
>>
>>    java.io.FileNotFoundException: jspwiki.log (Permission denied)
>>
>>    (in catalina.out)
>>
>> and
>>
>>    INFO [__DEFAULT__]
>> org.apache.catalina.loader.WebappClassLoaderBase.checkStateF
>> orResourceLoading
>> Illegal access: this web application instance has been stopped already.
>> Could not load [net/sf/ehcache/version.properties].
>>
>>    (in catalina.2017-01-08.log)
>>
>> I grabbed jspwiki.properties with:
>>
>>    unzip jspwiki-war-2.10.2.jar ini/jspwiki.properties
>>
>> and modified it as follows (renaming it jspwiki-custom.properties):
>>
>>    51c51
>>    < jspwiki.baseURL=http://localhost:8080/JSPWiki/
>>    ---
>>    > jspwiki.baseURL=http://web.how-hard-can-it-be.com/wiki/
>>    102c102
>>    < #  jspwiki.fileSystemProvider.pageDir = /p/web/www-data/jspwiki/
>>    ---
>>    > jspwiki.fileSystemProvider.pageDir = /etc/jspwiki/pages
>>    144c144
>>    < #  jspwiki.basicAttachmentProvider.storageDir = C:\\Data\\jspwiki
>>    ---
>>    > jspwiki.basicAttachmentProvider.storageDir =
>> /etc/jspwiki/attachments
>>    605c605
>>    < #jspwiki.xmlGroupDatabaseFile = /etc/tomcat/groupdatabase.xml
>>    ---
>>    > jspwiki.xmlGroupDatabaseFile = /etc/jspwiki/groupdatabase.xml
>>    626c626
>>    < #jspwiki.xmlUserDatabaseFile = /etc/tomcat/userdatabase.xml
>>    ---
>>    > jspwiki.xmlUserDatabaseFile = /etc/jspwiki/userdatabase.xml
>>    885c885
>>    < log4j.appender.FileLog.File = jspwiki.log
>>    ---
>>    > log4j.appender.FileLog.File = /var/log/jspwiki/jspwiki.log
>>
>> and tried deploying it to various places
>> ({/var/lib,/usr/share}/tomcat8, /var/lib/tomcat8/webapps/wiki).
>>
>> All to no avail.
>>
>> What else can I try?
>>
>> (I'm kind of a Rip van Winkle Java web app developer -- the last time
>> I touched this technology stack was more than ten years ago, and that
>> was on JBoss, all of which I've forgotten except the pain.)
>>
>> Thanks.
>>
>> John.
>>
>
> --
> -------------------------
>
> _RICK BROCKMAN_
>
> _28 LANCASTER ST._
>
> _CHERRY VALLEY, NY 13320_
>
> _607 434-4746_
>



-- 
Col

Re: Problem getting started on Ubuntu 16.04/Tomcat 8

Posted by Rick Brockman <re...@richardbrockman.info>.
Like you John I'm a Rip van Winkle of bygone computer days.  When  I 
installed Tomcat using apt-get I ran into problems and instead of 
knocking my head against the sleep pillow, I downloaded tomcat from the 
web and its working...

On 2017-01-08 16:10, John Lusk wrote:
> Ok, friends.  Trying to get JSPWiki set up on a new Amazon EC2 Unbuntu
> 16.04 instance I just stood up, and I'm having some trouble.  Help?
> 
> I installed Tomcat8 using apt-get, I wound up with:
> 
>    /etc/default/tomcat8
>    /etc/init.d/tomcat8
>    /etc/tomcat8
>       Catalina/localhost/{docs,examples,host-manager,manager}.xml
>       (These have docbase pointing to corresponding subdirs of
>       /usr/share.)
>    /usr/share/tomcat8
>    /var/lib/tomcat8, which has a webapps subdir.
> 
> It all seems to be working fine.
> 
> So, I downloaded jspwiki.war 2.10.2, renamed it to "wiki.war", and
> copied it to /var/lib/tomcat8/webapps, where it promptly got unpacked.
> 
> Now, I can see it in my Tomcat app manager, but when I attempt to
> start it, I get failures.
> 
> First, I got OutOfMemory errors.
> 
> I assume Tomcat's default -Xmx=128m is way too small, so I bumped it
> up to 768m (I've only got a 1GB EC2 instance (t2.micro), so I think
> 768m is living dangerously, eh?).
> 
> Now I'm getting errors like
> 
>    org.apache.catalina.core.ApplicationContext.log ERROR: Failed to 
> create
> a Wiki engine: JSPWiki: Unable to load and setup properties from
> jspwiki.properties. Failed to start. Caused by: Failed to instantiate 
> class
> org.apache.wiki.PageManager; please check log files for better 
> information.
> 
>    (in localhost.2017-01-08.log)
> 
> and
> 
>    java.io.FileNotFoundException: jspwiki.log (Permission denied)
> 
>    (in catalina.out)
> 
> and
> 
>    INFO [__DEFAULT__]
> org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading
> Illegal access: this web application instance has been stopped already.
> Could not load [net/sf/ehcache/version.properties].
> 
>    (in catalina.2017-01-08.log)
> 
> I grabbed jspwiki.properties with:
> 
>    unzip jspwiki-war-2.10.2.jar ini/jspwiki.properties
> 
> and modified it as follows (renaming it jspwiki-custom.properties):
> 
>    51c51
>    < jspwiki.baseURL=http://localhost:8080/JSPWiki/
>    ---
>    > jspwiki.baseURL=http://web.how-hard-can-it-be.com/wiki/
>    102c102
>    < #  jspwiki.fileSystemProvider.pageDir = /p/web/www-data/jspwiki/
>    ---
>    > jspwiki.fileSystemProvider.pageDir = /etc/jspwiki/pages
>    144c144
>    < #  jspwiki.basicAttachmentProvider.storageDir = C:\\Data\\jspwiki
>    ---
>    > jspwiki.basicAttachmentProvider.storageDir = 
> /etc/jspwiki/attachments
>    605c605
>    < #jspwiki.xmlGroupDatabaseFile = /etc/tomcat/groupdatabase.xml
>    ---
>    > jspwiki.xmlGroupDatabaseFile = /etc/jspwiki/groupdatabase.xml
>    626c626
>    < #jspwiki.xmlUserDatabaseFile = /etc/tomcat/userdatabase.xml
>    ---
>    > jspwiki.xmlUserDatabaseFile = /etc/jspwiki/userdatabase.xml
>    885c885
>    < log4j.appender.FileLog.File = jspwiki.log
>    ---
>    > log4j.appender.FileLog.File = /var/log/jspwiki/jspwiki.log
> 
> and tried deploying it to various places
> ({/var/lib,/usr/share}/tomcat8, /var/lib/tomcat8/webapps/wiki).
> 
> All to no avail.
> 
> What else can I try?
> 
> (I'm kind of a Rip van Winkle Java web app developer -- the last time
> I touched this technology stack was more than ten years ago, and that
> was on JBoss, all of which I've forgotten except the pain.)
> 
> Thanks.
> 
> John.

-- 
-------------------------

_RICK BROCKMAN_

_28 LANCASTER ST._

_CHERRY VALLEY, NY 13320_

_607 434-4746_