hostname

In Java 8, how do I get my hostname without hard-coding it in my environment?

好久不见. 提交于 2019-12-09 07:46:30
问题 We just upgraded to Java 8 on Amazon Linux. We are using Spring 4.3.8.RELEASE. It used to be that we could get our machine hostname by setting up beans in our application context file like so ... <bean id="localhostInetAddress" class="java.net.InetAddress" factory-method="getLocalHost" /> <bean id="hostname" factory-bean="localhostInetAddress" factory-method="getHostName" /> But with Java 8, the bean "hostname" now contains the string localhost Before Java 8, it used to contain the "hostname"

Javascript: Difference between location.hostname and document.domain?

坚强是说给别人听的谎言 提交于 2019-12-09 07:38:06
问题 What is the difference between using location.hostname and document.domain? I think an explanation with an example would be helpful. 回答1: It seems that document.domain is a read only property, except in Mozilla, which lets you change the value of the domain that is used for the same origin policy of (for example) AJAX requests without actually updating the page. The restrictions on this are the same rules of the Same Origin Policy. At least this is my understanding of the MDC docs for

Dynamic apache log directory based on hostname

可紊 提交于 2019-12-08 08:10:42
问题 I have a PHP application which is used by multiple domains. To avoid maintaining multiple vhosts, I have just setup a single "default" Apache vhost to direct any incoming request to the server to the application directory. What I want to do is to set the Apache access and error log paths dynamically based on the hostname hitting the server. For example, I would like to set the log paths to be something like: /var/log/application_name/example.com/error.log /var/log/application_name/example.com

Disable hostname verification in c# httpwebrequest

百般思念 提交于 2019-12-08 07:39:11
问题 I'm implementing web services in a c# environment. I'm using a SSL connection. My url is seomthing like: https://pseudoservername:8443/services/... But the certificate expects it to be: https://ourcompany.services.public.com:8443/services/... So I got a hostname mismatch. In Java you can simply turn off this hostname verification by making your own hostnameVerifier class and letting the JVM use that one instead of the normal one. This is really useful because the effect are only local (only

Map my web app context path to hostname in Glassfish or Tomcat

走远了吗. 提交于 2019-12-08 04:52:36
问题 Is it possible to map a web application running on Glassfish with context="MyApp1" to www.myFirstApp.com for example and another web app in the same domain with another context path to another hostname (www.mySecondApp.com)? Examples http://127.0.0.1:8080/MyApp1/ >> To >> http://www.myFirstApp.com http://127.0.0.1:8080/MyApp2/ >> To >> http://www.mySecondApp.com I want to bypass web app context path on my deploy-server. 回答1: You'll want to use a virtual server. The documentation will be

port redirect to docker containers by hostname

孤街醉人 提交于 2019-12-07 22:25:55
问题 I want to setup serve multiple sites from one server: 1. http://www.example.org => node.js-www (running on port (50000) 2. http://files.example.org => node.js-files (running on port 50001) Until now I only found out to have docker doing port redirect when using static ips. Is is actual possible to use docker for port redirection via hostname? I use a free amazon EC2 insance. Thanks Bo EDIT : I want to have multiple nodes applications running on the same port but however serving a different

How to get device type from MAC or IP address?

戏子无情 提交于 2019-12-07 17:25:18
问题 I am making a Device Discovery windows application in C#. Is this possible to know the device type if I have MAC address or IP address? device type means either it is computer or router or mobile or any other device? Note: HostName entry is not useful for it because Host Name is defined by User. for example i may assign "Nokia N70" name to my computer. Thanks in anticipation. 回答1: You can get the manufacturer from the MAC address. In order to get any more information you'd need to do a port

C# Dns.GetHostEntry doesn't return names of mobile devices connected to WiFi

让人想犯罪 __ 提交于 2019-12-07 16:25:17
问题 I have a windows form application in C# and I'm trying to get the host name of all the clients that I have in a list. Given below is a code example by ra00l from this link: GetHostEntry is very slow (I have a similar code made but this one is cleaner) private delegate IPHostEntry GetHostEntryHandler(string ip); public string GetReverseDNS(string ip, int timeout) { try { GetHostEntryHandler callback = new GetHostEntryHandler(Dns.GetHostEntry); IAsyncResult result = callback.BeginInvoke(ip,null

hostname in certificate didn't match:<>!=<> WSO2 APIM

僤鯓⒐⒋嵵緔 提交于 2019-12-07 10:31:15
问题 I have a https endpoint and I need to access it from wso2 API manager. (uses 1.10).I already added the certificate files to "client-truststore.jks" file. But now it gives an error as follows. hostname in certificate didn't match:<ip>!=<entry name>. I have already updated the axis2.xml file as follows also. <parameter name="HostnameVerifier">AllowAll</parameter> How can I solve this issue with WSO2 APIManager to access this https backend service 回答1: The CN of the certificate should match with

Host name resolution without modifying the hosts file

感情迁移 提交于 2019-12-07 02:51:58
问题 I'm trying to figure out how if there's a way to make a hostname resolve to a certain IP without DNS or host file modification. Using C#, I'm making a request from client to server, but I have to use the hostname in the request so that the certificates will properly authenticate the request. However, my program is meant to run without admin rights, so I can't modify the host file. I have the correct IP and the host name, is there any other way to make the computer resolve the host name to the