On my local Tomcat 8 I added crossdomain.xml as explained here:
Where do I put a crossdomain XML in Tomcat?
I did the check and I can see
http://localhost:8080/crossdomain.xml
from the browser.
But when I try to send a request from an swf in one of the web projects, it looks like it tries to find
http://localhost/crossdomain.xml
How do I tell Flash to search the file in the 8080 port?
Try using:
Security.loadPolicyFile("http://localhost:8080/crossdomain.xml");
Also try to allow ports in crossdomain.xml itself
<allow-access-from domain="*" to-ports="*"/>
Related
I'm trying to configure Apache on top of Glassfish v3 using apj13.
But when I'm trying to access http://<server_name>/myApp but this is not working. It is keep on loading the page.
From Glassfish side I've not made any changes.
From Apache side I've edited the httpd.conf file to include virtual server using
JkMount /myApp/* worker1
There was no helpful logs in either from Glassfish or Apache.
Update:
Worker.properties file
worker.worker1.port=28081
worker.worker1.host=myservername
worker.worker1.type=ajp13
The application is using Primefaces if that helps.
Any help is much appreciated.!
Thanks.
I found the solution for this.
I was having wrong configuration (incorrect port) in my worker.properties file. Below is the correct one (for me)
worker.worker1.port=8009 //the port was wrong. Instead of having APJ port I had HTTP port
worker.worker1.host=myservername
worker.worker1.type=ajp13
Also I had included socket_connect_timeout to the properties file to check for any errors while communicating with JK and remote host.
Please note that I also had cluster enabled in my GF and I had to manually configured different APJ_LISTENER_PORT value in custer configuration page in Admin Console of GF.
Hope this might help someone.!
I already installed Tomcat server while developing my java web app. But I also needed to get access to my database using PHPMyAdmin and install MySQL as well, so I downloaded XAMPP. I cannot disable apache server since I already have Tomcat. Now my struggle is, I cannot open
"localhost:8080" which was my original port. It's now replaced with simply "localhost".
Can you help me fix this error? THANK YOU :D
Sounds like you now have:
Tomcat serving traffic on port 8080, as it always has (at http://localhost:8080)
Apache/XAMPP serving traffic on port 80 (at http://localhost, obviously with the port missing since 80 is the default http port)
Assuming that's the case, you don't have a problem. Serving http traffic from different ports on the same host is not an issue.
I have Apache tomcat 7 where I build my web application and I also have Apache Web Server where my web site exist wrote on Css and HTML. I want to inject my web app on web site. How can I make my Tomcat as web server and container and transfer web site from Apache WebServer to Tomcat. ???
I know tomcat also can work on 80 port. Just I use to read documentation how to integrate Apache WebServer with Tomcat using mod_jk ajp connectors and etc to do, seems like it doesn't work.
If you want to use Tomcat as your web server (to serve your .html and .css files and probably images), then you can just get rid of the Apache Web Server; you no longer need it, according to your question. Then, after putting all your html/css/etc. under webapps/[app-root]/, make sure that all references to port 8080 in Tomcat's conf/server.xml are changed to port 80, reboot Tomcat, and you'll be good to go.
Basically i want my tomcat to run on PORT 80 how do i do that because whenever i have to access something then i have to go for localhost:8080/resource but instead i want to use the link as only localhost/resource how do i achieve this?
Currently on my machine apache is running on 800 port and tomcat on 8080.
it seems you are looking for something called Reverse Proxy. Using Reverse Proxy, you will have
apache on 80 port
tomcat on 8080 port
so when access http://xxx.test.com/resource, the request first go though apache, apache then pass the request tomcat, tomcat do the corresponding things and return response to client.
have a look at:
http://www.apachetutor.org/admin/reverseproxies
mod_jk: http://tomcat.apache.org/download-connectors.cgi
Tomcat documentation has a HOWTO for this.
http://tomcat.apache.org/connectors-doc/webserver_howto/apache.html
Its a good practice to never expose Tomcat directly internet. You can use Apache for serving static content and send only those requests to tomcat that need dynamic content.
In server.xml find the element that reads
Connector port="8080"
and change it to 80. Save and restart tomcat.
Just make sure that apache is running on port 800 otherwise it will now clash with tomcat.
To modify the HTTP port for Tomcat, modify the configuration file server.xml (located in Tomcat's conf directory). Find the HTTP connector element (that is currently configured to port 8080), change the port number to 80, and restart Tomcat.
Note that this is not going to work if any other running service is currently bound on port 80.
is it possible to configure the httpd.conf which listens the port 843 and serves crossdomain policy tags or file when there is a socket connection? (not for http request, needed it for socket connection from flash)
thank you
Check out this apache module, which will load the necessary socket policy files alongside any other standard crossdomain.xml configurations you need to host on port 80 - http://www.beamartyr.net/articles/adobepolicyfileserver.html
No, it's not.
httpd.conf configures Apache which is a webserver, so expects to receive HTTP requests over the socket. Adobe in their infinite wisdom decided that the Flash security policy file should be served over a home-brew protocol where the first string from the client is "\0".
Since Apache won't recognise that, it can't serve the requested file.
I could have a long rant here about the bogus-ness of this - it would have been (IMO) just as easy for Flash to have sent a "GET /policyfile" request which would have allowed Apache to serve the file, but there we go.
Your only option is to run a different server specifically to serve the policy file - Adobe provide some sample code in Python and other languages that does the job.