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
Related
I am trying to run an ubuntu apache server on Google cloud platform, I have created the VM instances but I can't connect to any other port apart for from 80 and 22.
Here are all the things I've tried so far:
Created Firewall rules to allow ingress traffic to ports 21,20 and 443.
Created FireWall rules on the Ubuntu Machine itself
The only ports that seem to be open are the 80 and 22.
I also allowed both HTTP and HTTPS access in the VM settings
So Basically, what I am trying to do is to open ports on my server. I'm not sure what am doing wrong.
You have already installed apache, and it's running on the port 80 as you can see on the nmap test, a closed port just mean that there's no application running on that port, this is different to filtered, see this for more information, this confirms that your firewall rules are correct (you are allowing traffic from all sources 0.0.0.0/0). By now you should be able to access your website on the port 80, if not I suggest you to follow this GCP guide.
So, if you want to run apache on the port 443 you just need to change its configuration (basically you will need to get a certificate for your server, configure some related parameters and then create a virtualhost listening on the 443 port, there are many guides on the internet for this just google for "enable https apache [your_OS]"), that should be enough since the firewall rules on GCP and your instance appear to be properly configured.
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
I have nginx running at port 80.
After installing apache2, I set its port to 82 (both in ports.conf and 000-default.conf).
I have tried opening the ip (i.e a.b.c.d:82) but its not opening. But if I set port to 80 and stop nginx then its opening.
I tried opening ip with the below format:
a.b.c.d:82
a.b.c.d - opening nginx site
I also tried setting dns to abc.mydomain.com and opened
abc.mydomain.com (opening nginx site)
abc.mydomain.com:82 (not opening anything)
How to access it using apache with some port other than 80 ?
Please let me know for more questions.
Thanks.
The discussion and investigation in the chat revealed that this actually was about a remote system, not a local development setup. That means that typically a package filter ("firewall") is in between client and sever. When using a non standard port for a "well known protocol" you need to open that port in the servers firewall for incoming traffic.
In this case using Ubuntu's ufw tool had been used to setup a simple package filter. Configuring the custom port 82 and allowing incoming traffic to it solved the issue at hand.
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
I want to deploy java web application on 8080 port of tomcat server but i want that URL does not contain port no with domain name.
I can't change the port from 8080 to 80 because i have some other application running on different server with port 80.
You could make an alias here go to Host Name Aliases and configure your name of choice. This way you can skip localhost:port/path/to/project and just have project_name.loc or whatever you come up with.