Hot answers tagged

4

Running Apache and Tomcat on the same computer is no problem. It's pretty common to run Tomcat on port 8080, run Apache on port 80/443, and use mod_proxy to allow Apache to serve apps hosted by Tomcat. You might set up Apache so that any requests going to /app on port 80 get proxied to localhost:8080/app, which is Tomcat, but the end user doesn't know or ...


4

Well I don't think that keytool command is asking you the password for tomcat user. Generating a self-signed certificate has nothing to do with the system user. Keytool command ask you to set the password for the certificate you are generating. keytool -genkey -alias tomcat -keyalg RSA -keystore /applications/certs/test.key Enter keystore password: Re-...


3

Since you are on Amazon EC2, and it's working local to the instance but not to its IP address, check your host's network ACL (i.e. security group). The wizard guides you to set up a very restrictive policy, and if you try to do something like open up HTTP to the world, it will just open inbound port 80.


3

According to the Tomcat deployment howto, the exploded webapp "is removed, and the .WAR is expanded again". So the whole /webapps/myApp directory gets deleted upon deployment. There is no way to keep the files in it. If you want to keep the uploaded files, you should define a directory outside your webapp dir, and use that from within the web application.


3

I have a similar use case, which is to enable Tomcat 7 to strictly use only TLSv1.2, not to fall back to earlier SSL protocols such as TLSv1.1 or SSLv3. I am using: C:\apache-tomcat-7.0.64-64bit and C:\Java64\jdk1.8.0_60. Following this instruction: https://tomcat.apache.org/tomcat-7.0-doc/security-howto.html. Tomcat is relatively simple to setup SSL ...


3

The correct answer is online: http://www.laliluna.de/articles/2008/09/14/apache_tomcat_mod_jk_selinux.html The part you need is near the bottom, which I will copy and paste here in case that page goes away: # mkdir /var/run/mod_jk # semanage fcontext -a -t httpd_var_run_t "/var/run/mod_jk(/.*)?" This apparently configures SELinux to allow mod_jk to work....


3

As well as disabling export DHE cipher suites, you need to use a 2048-bit Diffie-Helman group rather than the 1024-bit that Tomcat is probably using. It's believed that someone with the resources of the NSA could break 1024-bit. To do so, add -Djdk.tls.ephemeralDHKeySize=2048 to your Java or Catalina options. Note that this only works in Java 8 or later -- ...


3

Tomcat needs an certificate stored in an Java key store (jks). Java comes usually with the keytool tool already installed. You should use keytool to generate a self-signed certificate like this: keytool -genkey -alias mydomain -keyalg RSA -keystore keystore.jks -keysize 2048 Consult this site for more information on the use of keytool.


3

Permission denied - /var/lib/tomcat8/enterprise/ROOT/WEB-INF/log and Errno::EACCES: Permission denied - /var/lib/tomcat8/enterprise/ROOT/WEB-INF/log I would work on clearing those first. Who knows it may solve the problem. Perhaps mkdir -p /var/lib/tomcat8/enterprise/ROOT/WEB-INF/log would be a place to start


3

Considering you have only one IP and one server, i would: Put one instance of apache Listening on port 80 with Name based virtual hosting (as you have only one IP, beware of eventual SSL problems if you plan to use HTTPS, check here: https://wiki.apache.org/httpd/NameBasedSSLVHosts) So you'll have a virtual host for each subdomain, let's say your domain is ...


2

Ok, I'll try answering you. Consider Apache HTTPD and Apache Tomcat two friends (I'll call them in short HTTPD and Tomcat). Each of them has means of comunicating with other people, let's say by mobile phone and lineland phone or IM. Tomcat has three phones for recieving calls: One for recieving international calls in which he speaks the langauage spoken ...


2

I realize this question is pretty old but for anyone who may find it useful I'll mention what works for me: use CN to enter some human friendly name like "our cool JIRA server" ;-) enter san like this: -ext san=dns:jira,dns:jira.example.com BTW, you can also add IP addresses if you like. I personaly use the following for my development computer: keytool ...


2

Create a new directory for example /opt/static/ and chown it to www-data or the equivalent on your OS and put your static stuff in there. This will totally bypass tomcat for the static assets (a good thing IMO) and then change your vhost definition to this (I am assuming that all your api calls are in the api url - it will also enable client side caching ...


2

In most cases (obviously not in your case) the reason will be that you are running out of iNodes. To check this run df -i: Filesystem Inodes IUsed IFree IUse% Mounted on [...] 25600 25600 0 100% /foo Here you can see the use of iNodes is 100%. Bad news is, according to http://superuser.com/questions/585641/...


2

For Tomcat 8 / Tomcat 9 properties should be added in conf/context.xml as follows <Context> <Resources antiResourceLocking="false" cachingAllowed="false" /> ... </Context> You might have to delete the application cache folder in /work/Catalina/localhost after changing the cachingAllowed flag. Also clear the cache of IntelliJ IDEA (if ...


2

The ports are right -- shutdown is on 8005 in server.xml, which is what was expected -- but from what you've shown it appears as though your first attempt to restart Alfresco stopped it, but didn't start it. Your second attempt (by calling restart again) first tries to stop the Tomcat server, but since it isn't running it tells you that there's no response ...


2

Will a ramdisk software work in a vmware virtual machine? Yes, of course. Is there better options? If you can live with the volatility then no, RAM's pretty damn fast, even in a VM - if you need nonvolatility then look at something like NVMe-based storage.


2

I was finally able to solve this problem by changing it to the following config : Tomcat's server.xml : <Connector port="8080" proxyPort="80" redirectPort="443" protocol="HTTP/1.1" compression="force" compressionMinSize="1024" connectionTimeout="20000" maxPostSize="5242880" URIEncoding="utf-8" compressableMimeType="text/...


2

/opt/apache-tomcat-7.0.67/bin/catalina.sh: line 439: /usr/local/jdk/bin/java: No such file or directory What's not to understand about that ? It looks like your JRE_HOME may be incorrect.


2

You can configure Tomcat to remove the old applications. You need to add the undeployOldVersions attribute to the Host element and set it to true. You'll need to modify your host in server.xml to something like the following: <Host undeployOldVersions="true" ...> ... </Host> See the Host documentation for details. In particular, this only ...


2

Tomcat needs the certificate stored in a Java keystore. You however have set keystoreFile to a cert file. You need to import your certificate into a JKS keystore and change the keystoreFile parameter to that file. Java comes with keytool utility. The keytool programm covers everything you need to deal with JKS. Take a look at this website for the most ...


1

I had too many issues with using client certificates with java apps (on client side as well as on a server). APR helps but it has issues of its own. Eventually, I decided to stop trying and now I offload SSL processing to a proxy in front of the app. Both Apache and Nginx work well in this role.


1

Try sc config tomcat6 depend= mysql Note the space after depend=


1

You could use only tomcat if you like. However, be careful! Tomcat is a servlet container. It uses JSSE to implement TLS, and by default it exposes management services on the network. It also has had a large number of security vulnerabilities (see https://tomcat.apache.org/security-7.html for example). It is somewhat slow and it's extremely complex. ...


1

/etc/nginx/sites-enabled/default is the path given to the default website for Debian based systems. They are usually links to files contained /etc/nginx/sites-available. /etc/nginx/conf.d is a path used in most configurations including Debian derivatives like Ubuntu and other distro's like CentOS etc. /etc/nginx/nginx.conf is the main configuration file ...


1

You can use the proxy module in Nginx. Something like this should work: server { listen *:80; server_name yourserver.com; location / { proxy_pass http://127.0.0.1:8080; include proxy_params } } http://stackoverflow.com/questions/12847771/configure-nginx-with-proxy-pass


1

You can use mod_rewrite.c to redirect a request to https. Though make sure you don't enable SSLEngine on the page you want to redirect from. In this example I'm redirecting all traffic coming in to test.mydomainintereactive.com on port 80 to test.mydomainintereactive.com on port 443 (standard https port) <VirtualHost *:80> ServerName test....


1

MySQL manual for Connector/J indicates it's possible. Note that you need to configure your MySQL servers to replicate with each other (master-master replication). You should use at least MySQL version 5.6, as it has greatly improved replication reliability. It is however still possible that your application will try to read a data row only written recently ...


1

On Tomcat's web you have a HowTo explaining how to use apache to connect to Tomcat, so users will connect to apache (without need of specify a port) then apache will pass requests to Tomcat. You can also user ProxyPass on your apache and just forward requests to Tomcat, you only need to search on internet next keywords apache tomcat proxypass


1

I suggest you to enable AJP connector in both Tomcat and Apache httpd. This binary protocol is dedicated for Java HTTP proxying. Using it may save you configuration time and effort and lower bandwith and resource requirement. Btw., <Proxy *> directive is irrelevant on reverse proxies.



Only top voted, non community-wiki answers of a minimum length are eligible