Opened 9 years ago
Last modified 7 years ago
#48302 new submission
tomcat8 @ 8.0.24 looking for review/feedback/help
Reported by: | raupachz (Björn Raupach) | Owned by: | macports-tickets@… |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.3.3 |
Keywords: | Cc: | neverpanic (Clemens Lang) | |
Port: |
Description
MacPorts is missing a current Apache Tomcat 8 port. Unlike tomcat5 and tomcat6 this does not build tomcat. It downloads and extracts a binary from one of the Apache mirror sites.
I am totally new to creating ports files. This is my first attempt and it would be nice if someone is willing to help/work with me on this port. I do have experiences with running Apache Tomcat on *nix servers.
This port is plain and simple it just downloads, extracts and copies files to ${prefix}/share/java. You can start and stop tomcat via the provided scripts in /bin. This is probably not how a server should act.
- Should I create a custom system account and group e.g. tomcat:tomcat?
- Start and stop via launched?
- How should I deal with updates? Lets say I change my server.xml and the port updates? Is it possible to keep files around?
Attachments (2)
Change History (10)
comment:1 Changed 9 years ago by neverpanic (Clemens Lang)
comment:3 Changed 9 years ago by raupachz (Björn Raupach)
I am still working on the custom account for Tomcat and moving files so that they don't get replaced upon an upgrade.
Here are the security considerations from Apache Tomcat Team. I used to run it like this in production unless the distro provided a custom Tomcat installation. So it probably makes sense to set this port up like the developers recommend.
Starting and stopping works now via the startupitem. It is not perfect yet. I am still missing a PID file but that should be easy once I figure out how to deal with /files
in a port.
comment:4 Changed 9 years ago by raupachz (Björn Raupach)
Apache Tomcat does not distribute setenv.sh
. I created a custom one and made sure it is not overridden on updates. We need this file to tell Tomcat to create a PID file.
However there is the conf
directory. Basically all the files in that directory can and will be edited during Tomcat installation. Should I copy them and make .default or .sample files?
Still figuring out how to deal with custom accounts and setting permissions.
Changed 8 years ago by raupachz (Björn Raupach)
comment:5 Changed 8 years ago by raupachz (Björn Raupach)
Oh wow. 16 months ago.
I updated the portfile to Apache Tomcat 8.5.8. The ports loads und loads and I set the permission to tomcat:tomcat.
Anyone else looking for Tomcat port?
comment:6 Changed 7 years ago by kencu (Ken)
Hi. I downloaded the files and installed this just now. I don't know a great deal about tomcat, though. It installed without any errors on 10.6, and then I did sudo port load
to launch it. It seemed to be continually restarting though:
17-05-24 10:17:16 PM org.macports.tomcat8[57243] Tomcat started. 17-05-24 10:17:16 PM com.apple.launchd[1] (org.macports.tomcat8) Throttling respawn: Will start in 10 seconds 17-05-24 10:17:26 PM org.macports.tomcat8[57254] Tomcat started. 17-05-24 10:17:26 PM com.apple.launchd[1] (org.macports.tomcat8) Throttling respawn: Will start in 10 seconds 17-05-24 10:17:36 PM org.macports.tomcat8[57265] Tomcat started. 17-05-24 10:17:36 PM com.apple.launchd[1] (org.macports.tomcat8) Throttling respawn: Will start in 10 seconds 17-05-24 10:17:46 PM org.macports.tomcat8[57276] Tomcat started. 17-05-24 10:17:47 PM com.apple.launchd[1] (org.macports.tomcat8) Throttling respawn: Will start in 10 seconds}}} running the start script manually says it starts: {{{ $ sudo /opt/local/share/java/tomcat8/bin/catalina.sh start Using CATALINA_BASE: /opt/local/share/java/tomcat8 Using CATALINA_HOME: /opt/local/share/java/tomcat8 Using CATALINA_TMPDIR: /opt/local/share/java/tomcat8/temp Using JRE_HOME: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home Using CLASSPATH: /opt/local/share/java/tomcat8/bin/bootstrap.jar:/opt/local/share/java/tomcat8/bin/tomcat-juli.jar Using CATALINA_PID: /opt/local/var/run/tomcat8.pid Existing PID file found during start. Removing/clearing stale PID file. Tomcat started. }}} but I can't connect to it with http://localhost:8080/, and the activity monitor shows no process named tomcat running. Sorry if it's just my ignorance about how to see it work. Otherwise everything went smoothly for the installation.
comment:7 Changed 7 years ago by kencu (Ken)
I did notice that tomcat6 seems to have a load of dependencies when I tried to install that:
$ sudo port -v install tomcat6 ---> Computing dependencies for tomcat6............................ The following dependencies will be installed: apache-ant commons-beanutils commons-codec commons-collections commons-daemon commons-dbcp commons-digester commons-el commons-fileupload commons-httpclient commons-io commons-launcher commons-logging commons-modeler commons-pool hamcrest-core jakarta-bcel jakarta-log4j jakarta-regexp jakarta-taglibs-standard-11 junit mx4j saxpath servlet23-api servlet24-api xalanj xercesj
could some of those be needed for tomcat8 as well?
comment:8 Changed 7 years ago by raupachz (Björn Raupach)
Hi Ken,
Tomcat 8 needs Java 7. Your JRE_HOME points to Java 6.
Tomcat is pretty self contained. You don't need any additional dependencies other than the ones provided. No clue why the ports of tomcat6 is different.
openmaintainer
is meaningless without a real maintainer associated with it. So either add yourself in thedomain.tld:localpart
obfuscated format, or just usenomaintainer
.sha256
andrmd160
checksums nowadays. If you delete the checksums line and runport -v checksum
, the correct line will be printed.depends_lib
linedelete
command that wrapsfile delete
that you could use instead offile delete
in the pre-destroot block. I think it doesn't make a difference in this case, but it's still shorter.destroot.keepdirs
in a phase; do it at the top level of the Portfileadd_users
directive. You could also use OS X' builtin_www
user.port load tomcat8
will start andport unload tomcat8
will stop the server. Search other Portfiles forstartupitem
to see how it's done -- if you need help, please feel free to ask here or on -dev.notes your-text-here
) to tell the user that he needs to configure tomcat by creating the file before starting it.