Domain Name Instead of Localhost In Eclipse - eclipse

I've got a tomcat server instance running inside of eclipse. By default it uses a hostname similar to http://localhost:8080/MyApp/ is there some way to proxy this so I can use a domain name like http://example.com/ instead?
On the production server I use apache to proxy the request to point to the tomcat instance, but within eclipse I don't have that luxury.
I'm using Ubuntu. I thought maybe I could map the domain to point to the localhost version in /etc/hosts but that seems to only be the first step. From there I can't figure out how to point the domain to the tomcat url.

Add this to your hosts file, to access via domain name : localhost example.com
Now, You have couple of options :
Host file doesn't know about ports. You have to access your app like http://example.com:8080/MyApp
You can change your tomcat port 8080 to 80 so that you dont have to access it via port like this http://example.com/MyApp
To access your web application via http://example.com, you have to deploy your application in tomcat root. For that refer Deploying my application at the root in Tomcat

Related

Keep port in url when usung redirect in Zend Framework

I have a Windows development machine with an Ubuntu VM set up via vagrant. The VM has Nginx running on port 80 and the Vagrant configuration maps port 8080 on the host Windows machine to port 80 on the VM. For various reasons the project that I'm working uses 127.0.0.1 instead of localhost so, in my browser on the Windows machine, I hit a URL such as:
http://127.0.0.1:8080/foo/bar/baz
The application on the VM is built with Zend Framework 1.12.
If I click a link that has an href="/foo/bar/baz" then all is fine and I go to:
http://127.0.0.1:8080/foo/bar/baz
However, if in one of my controllers I use a redirect to "/foo/bar/baz" then the browser loads:
http://127.0.0.1/foo/bar/baz - i.e without the port in it.
If I then manually edit the URL in the browser's address bar to add the port and hit enter then the page comes up correctly.
I've tried various ways of doing the redirect programatically in ZF, and even tried typing a hard coded URL into the code, but whatever I do it always strips out the port component when the redirect takes place.
Any ideas/suggestions as to how to keep the port in the redirect would be much appreciated.

How to access JBOSS Restful web service using IP and Port

I created a test JBOSS web service and there is only one test method in it. I access this using http://localhost:8070/MyWebService/MyRESTApplication
and it shows the result from the web service. I tried this in both Eclipse and Browser and it works.
But when i want to access this web service using IP address of my system then it shows ERROR message that Page cannot be displayed (in fact browser is not able to find this web service).
I want to access like this http://IPaddress:8070/MyWebService/MyRESTApplication
what should i do so that i can access it using my IP from some computer
You have to start JBoss using :
./run.sh -b [your_IPaddress]
On windows:
start run.bat -b 0.0.0.0
This will tell it to start and bind to all network interfaces. You can also replace 0.0.0.0 with your actual IP if you only want it to bind to that network interface.
I find it easier for debugging to have it come up on all network interfaces because this will work when you are running a virtual machine to debug something like Internet Explorer.
Open your server setting in Eclipse and set Host name as your IP address or 0.0.0.0

How to make JBoss accessible using IP?

My JBoss server is running in my system and trying to access it from other system using ip address of my system, but its not accessible and even from my own system i am not able to access using ip.
How can i make jboss enable using ip address.
Thanks
We can run JBoss as ./run.sh -b 127.0.0.1 or run.bat -b 127.0.0.1
This will make JBoss accessible using ip.
If the JBoss is running on your machine you can access it using this URL
http://localhost:<portnumber>
If you have started the JBoss using the command
run.bat>
then you can access the JBoss through above URL only.
If you use this command to start the JBoss :
run –b 0.0.0.0.>
then you can access the JBoss using this URL also
http://<ipaddress>:<portnumber>
In addition to this, if in place of IP address if you want to use some domain name then add that domain name
<IP address> <domain name>
into the host file at this path:
C:\WINDOWS\system32\drivers\etc>
then you can access your jboss through this url
http://<domain name>:<portnumber>
For more details you can check this blog http://tarunjain-jaintarun.blogspot.com/2012/08/acessing-jboss-using-ipaddress.html

How to configure Symfony project to listen to port 80 of Web Server

I have build a web project in Symfony 1.4 and ORM as Propel. we have a VPS to host our web site, I have created my project on web server and configured it with the IP on port no 8080,
like http://s.o.m.e.i.p:8080. it works fine, but we bought a Domainname as "mysite.com" and it is pointing towards the web server ip i.e http://s.o.m.e.i.p. How can i configure my Symfony Project to http://s.o.m.e.i.p so that it will point the domain name.
This is not doable only in Symfony - you have to alter your apache configuration to use port 80.

Run jsp in eclipse on specific port and ssl

I have used Eclipse 3.4 to create a Dynamic Web Project. I have also configured my server to use port 8443 with ssl. If I start my server I can access my test.jsp by going to it's address
https://localhost:8443/TestContext/test.jsp
In eclipse, I have installed this server and added my project to the server. If I Run test.jsp it always launches as
http://localhost:8080/TestContext/test.jsp
My question is: How can I set up eclipse to run this on https://localhost:8443/ rather than the default 8080? Thanks in advance.
You should have a project called "Servers". There your tomcat should have its folder - for example "Tomcat 6.0.20 at localhost-config". There is server.xml there, in which you can enable SSL.
When you enable the SSL, the server accepts requests on port 8443 as well as on 8080. The server is not run on a port - it accepts connections on multiple ports. So just type https://localhost:8443/