Can I have apache and glassfish running on one server machine? - apache

There's a physical server machine with apache running on it, some apps deployed there. I'm gonna need a glassfish server. Is it possible to set it up on that machine and have both apache and glassfish running simultaneously? If yes, then what problems could that cause?

Yes, you can.
Normally this shouldn't cause problems, because Glassfish is running on port 8080 per default and Apache is running on port 80 and 443.
If your Apache is configured to run on port 8080 this won't work or you have to change the default port of your Glassfish server.
See also:
How to run glassfish 4 on port 80 instead of 8080
Binding to Addresses and Ports - Apache HTTP Server Version 2.4

Related

How to change default 80 port to my tomcat 8080 for my domain name

I am using tomcat on Linux centOs server. I want my java application is working fine on mydomain.com:8080. I want that my when some one hit the domain mydomain.com it automatically move to my java application.
Changin server.xml didm't worked for me. as i am also having apache2 on the server
I guess you have an apache server in port 80. I you do not want to remove apache and change directly the tomcat port ( see comments), you will need to redirect all traffic from port 80 to port 8080.
This can be done using tomcat connectors. They are plugins to connect web servers with Tomcat. When a HTTP request arrives, the plugin checks is it has to be redirected, connects to tomcat and returns the response to server
In the case of apache is needed to install mod_jk. In the link you can see the configuration

Tomcat through Apache

I'd like to know if is a good decision to configure tomcat through port 80 (in apache with virtual-hosts ).
I need to setup a tomcat service in the same server I have apache, plus I need to use Tomcat through port 80.
Is this right? or is best to use them in separated servers?
That's OK. But sometimes tomcat is deployed with Apache. The Apache is a front-end server to balance load. And many tomcats are as back-end servers.

Do glassfish application running on port 80

I have a java application running on glassfish 4.1, the url to access the system is a sobdomain, eg
subdomain.mydomain.com:8060/ProjectName
I wanted to make it work without entering the port
(subdomain.mydomain.com/ProjectName)
.
I've tried to change the port of the http-listener-1 to 80, but after that the domain of glassfish does not boot anymore.
Any idea how to run without the user having to enter the port?
There are a couple of reasons why you should not use Glassfish listening to 80 directly.
Firstly port 80 is reserved, it's not easy to make a non special user to open 80 on a *nix environment.
It's common and recommended to install apache or nginx on port 80 and use mod_proxy_ajp to connect Apache or nginx to Glassfish through port 8009
Oracle wiki

Jboss to Apache forwarding

JBoss Enterprise Application Platform 6.1 on Linux Enterprise Redhat
I have seen several examples on how to have Apache forward requests to JBoss. I am looking to have a JBoss server listening on port 80 forward cgi calls to an Apache server. Can JBoss be configured to listen at port 80 and forward all requests containing "cgi-bin" to port 8080 where Apache server is listening?
The need to do this arises from
Jboss not supporting cgi (mod_perl in my case) AFAIK
Since i am migrating from a server where all web requests used port 80, needing to keep the port as 80 to avoid programming changes
99% server calls are handled by JBoss, so i want it to be the primary point of contact
Despite JBoss handling the 99% of calls, the better architecture is to have Apache in front of JBoss.
You would have Apache serve port 80 and forward to JBoss via mod_cluster or mod_jk. This will allow you to control your content via Apache. You should serve your static content directly from Apache as well.
Additionally with this architecture, you can cluster your environment and load balance across multiple servers. This gives you higher fault tolerance (session replication, failover), handle more load, and helps you avoid server outages.
mod_cluster is recommended for EAP 6, but mod_jk works just fine too.

Are there any issues when installing apache tomcat with apache webserver already installed under Windows 7?

I am currently trying to install apache tomcat for running on localhost as I am planning to run a new development project using Java.
Will this be a problem if I have already apache webserver installed locally on my machine already? In other words, will there be any port conflicts or anything other issues with the two servers running on the same machine?
No. Because Tomcat uses default port 8080 for the webserver while the "normal" webserver uses port 80 for html displaying. You can change that in the catalina properties of the tomcat server but on first install the defaults are not causing problems with a port 80 webserver.