How can I give a name to an IP address? [closed] - tomcat6

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I am developing a web app using Tomcat. I want to give a name (a domain name) like "google" to access my site.
How can I do that?

If you only want to give a fake, temporal domain name for demo purposes on your development computer, you can add a line in your hosts file (typically located in /etc/hosts in UNIX/Linux systems):
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
# My fake domain name for demo purposes
192.168.1.121 google.com
Then, when you open the 'google.com' domain name on your computer, it will redirect you to the specified IP address.
Note that this won't work if you want to access your application from other machines. You would have to make the same change in every computer's hosts file for that to happen.
And obviously, you won't be able to access the real google.com website while having that line in your hosts file.
For Windows systems, the only thing that changes is the location of the hosts file (you must be an Administrator to edit this file):
Windows XP/Vista/Windows7:
c:\windows\system32\drivers\etc\hosts

I think you need to read up on the Domain Name System (DNS). The RFC is a bit dry so maybe start with wikipedia.
Once you understand the basics it's time to purchase a domain from a registrar and set it up.

You need to register a domain name, then set up DNS records (including an A record that points the name to the IP address) on nameservers somewhere, and that IP address has to be accessible from the 'net. You may need web hosting for that, unless you have an always-on internet connection, in which case you need to configure your router to pass through port 80 traffic to the computer running the app.
There are many web hosting companies that will do the name registration and DNS setup and hosting for you if you host the site with them.

You need some hosting to get your site on the internet
You need to register a domain name and point it at your hosting
Most hosting companies provide both services, which means you don't need to worry about "HOW" you do any of this.

Related

Change the 10.20.20.1 network to my VMware network

I installed MicroStack in Ubuntu for the virtual machine. My instance floating IP is 10.20.20.238. I want to access my instance from Windows cmd,only can ping 172.21.10.13, but can't ping 10.20.20.238,so I want to change the 10.20.20.1 network to my own network. What should I do?enter image description here
Stackoverflow is about code development, not IT management. serverfault.com would be a more appropriate forum, or perhaps superuser.com.
microstack "fakes" the external network. It's not really external, but only exists on br-ex, the external bridge. It doesn't look like you can create a microstack cloud with a different external network CIDR, but you can try adding a subnet to the external network, inserting ens33 in br-ex and adding IP address 172.21.10.13 to br-ex . I have not tried this.
However, if your only requirement is to access the instance from the PC, you can create a tunnel or add a route. What makes sense in your case depends on the virtual machine hypervisor you are using (yours seems to be VMware - I can't comment on that) and the operating system on which this hypervisor runs.

XAMPP - Share my PC localhost on mobile hotspot to any devices

I wanted to try localhost in my mobile, so I can see if it is really responsive cause in the chrome there are only few selections like iPad,etc.. so My PC has a mobile hotspot. Is it possible to share my localhost to the connected devices?
Why are you using your PC as mobile hotspot? Isn't there another network that both your PC and other devices can connect to and find each other on?
Either way, localhost is just a shorthand for the local loopback IP address (127.0.0.1), which is used for a computer to handle network requests to itself. Now, if the other devices can connect to the PC, then all you need to do is find out what your IP address on the local network is, if XAMPP's Apache server is listening for requests on the network and if any local Firewall isn't blocking access.
(Windows)Before you do anything else, make sure Windows IIS isn't running! It occupies the default http port (80) and is going to cause problems if it's there!
First up, figuring out your IP address:
(Windows)Open the commandprompt (start -> search cmd.exe or run and enter cmd) // (Linux/Unix/Mac)Open a terminal
(Windows)run ip-config and look for the line that specifies your IPv4 address, write it down if you have to // (Linux/Unix/Mac)run ifconfig and look for the line stating inet.
Either way, this address probably looks like 192.168.X.Y
Next, check to see if Apache is listening
As this is often the default setting, it probably is. So grab any other device connected on the same network and open a browser
In the address bar type the 192.168.X.Y IP address of the PC running XAMPP
If you don't see an error, go to your files and enjoy!
If you do get an error, change the config for Apache (httpd.conf) and search for a line containing "Listen 80", if you can't find it then it's probably listening to 0.0.0.0:80 and you need to edit that line to "Listen 80" as that will allow it to listen to all addresses on the network.
Finally, you can't reach it so check if your firewall is blocking access. This is usually Windows firewall not trusting anything that doesn't carry a Microsoft label
Go to Control Panel > Windows Firewall > Allow a program to communicate through windows firewall > Add another program Name: http Port: 80
If it still doesn't work and you're running Windows, refer to this Stack Overflow question as you are not the first person that has trouble setting things up.

Windows Azure - Web Role and Virtual Machines Securely Communicating

I am attempting to deploy an app to Windows Azure and I am having some trouble figuring out how I can achieve my optimal configuration because of lack of documentation and newness of the Azure infrastructure. I need to have two virtual machines configured (One Linux box and one Windows Server with SQL Server) to communicate with one Web Role Instance. The Web Role should have the only end point accessible from the outside world. It should be able to communicate with SQL Server and the Linux machine (these machines don’t need to communicate with each other). I can achieve this if I open up endpoints on the VM (for example Port 1433 on the Windows machine and the same port in the VM’s firewall), however I am concerned about the security risk of doing this and would rather have the Web Role communicate directly with my virtual machine WITHOUT opening up an endpoint (using the Azure Portal). I have read some examples that refer to deploying the items as a cloud service, but none include a Web Role AND a CUSTOMIZED Virtual Machine. I have seen references made to using a Virtual Network, but no examples. I have looked everywhere for a solution to no success. This seems like a common scenario, so I don’t think it should be this difficult. Am I missing something?
Well you have 2 options here: use Windows Azure Connect or use Virtual Networks. Since you're really trying to make a network of different machines I would suggest to use a Virtual Network (I think this is the most flexible option). And connecting your Virtual Machines to your Cloud Services is pretty easy:
Create a Virtual Network as described here: Create a Virtual Network in Windows Azure
Add your Virtual Machines to that network as described here: Add a Virtual Machine to a Virtual Network
Modify the ServiceConfiguration.cscfg of your cloud service to connect to your Virtual Network. The schema is available on MSDN or you can follow the blog post on Michael Washam's blog.
I marked the answer above as correct, because it does provide the answer especially if you are only creating a virtual network with MS products. What they fail to point out in the majority of their documentation, is that VN functionality is limited for Linux machines while VMs and VNs are in their current preview. However, this does not mean you can't add a Linux VM to a VN. After searching for sometime and piecing information together, Linux machines can be added to an existing VN rather simply by using PowerShell and cmdlets. The following generic script can be run from a PowerShell ISE with your own information in order to create and add a Linux VM in your VN.
$vm = New-AzureVMConfig -Name $vmname -InstanceSize ExtraSmall -ImageName $img |
Add-AzureProvisioningConfig -Linux –LinuxUser $user -Password $pass |
Set-AzureSubnet -SubnetNames $subnet
New-AzureVM -ServiceName $cloudSvcName -AffinityGroup $affinitygroup -VNetName $vnetname -VMs $vm
Hope this helps someone from pulling their hair out.

simple server in C [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I created a simple TCP/IP server in c and it runs smoothly from my Linux machine. I can connect as localhost:80 as well as from different machines, but I obviously have to use the lab computer's IP.
My question is: how do I run a server form my own Mac OS X machine, let's say, and connect to it form outside? Not sure how to properly ask the question... how to assign a specific IP to my server? Sorry, I am still exploring this field!
Thanks!
If your local proxy or box is configured to allow entering connections, the easiest is to assign a fixed name that will be mapped to your (dynamic) IP.
There are a lot of dynamic DNS free solutions on the web (ex : http://www.no-ip.com/)
If you just want to make a one time test, you can see what IP you have with a service like this one : http://www.whatismyip.com/
All you need is a machine that has globally routable static ip address. And run your server on that machine.
Running it on your Mac laptop is okay but as you hop from one wifi network to other your server is no longer available.
Best way is to find a machine , a desktop in your lab or ar home connected to say comcast isp that has a static globally rout able ip and run your server on there.

Find machine name and IP address in OOB SL5 app

How can I obtain the client machine name and IP address when running my Silverlight 5 application out-of-browser (i.e. installed on the local machine and NOT running via the web)?
It looks like there's no way to gather this information using just Silverlight. You'd have to do something like this. The short version is you use an AutomationFactory to create an unmanaged object which contains that information (in this case, a WMI Win32_NetworkAdapterConfiguration object). That means this probably won't work on a Mac. If you need something truly cross platform, it seems like the way is to create a really simple web service that simply returns the requestor's IP and hostname.
I dont know what is your exact requirement .We had similar requirement some time back to get the local ip address to call a local service which is supposed to be present in client machine.
In that case we just built the local service url by hard coding the loopback address.ie localhost.

Resources