hostname

Android ADB connect empty host name

丶灬走出姿态 提交于 2019-12-07 01:16:58
问题 I use ADB over WiFi to connect to an Android device. When I type adb connect <device ip> I get error empty hostname 回答1: For me, simply restarting adb solved the problem adb kill-server adb start-server 回答2: You need to change net.hostname property on your device. The easiest way is to use the setprop command via a root shell on the device. setprop net.hostname TypeAnyHostName If this is not working for you, see other solutions here. This is a temporal solution, the problem repeats again some

Django - How to simply get domain name? [duplicate]

故事扮演 提交于 2019-12-06 18:40:30
问题 This question already has answers here : Django: get URL of current page, including parameters, in a template (6 answers) Closed 4 years ago . Firstly, I want to say that I'm a beginner in Django. I'm looking for a simple way to retrieve the domain name of my Django website. I want to do this in my settings.py. I've already tried with the socket something like this: socket.gethostname() but this doesn't work correctly. 回答1: If you have a request object,do request.META['HTTP_HOST'] This would

Dynamic apache log directory based on hostname

萝らか妹 提交于 2019-12-06 16:46:53
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/access.log when a request to example.com is made. Is there a viable way to do this? I've looked at

Is there a way to specify hostname when starting container on azure cloud instance

坚强是说给别人听的谎言 提交于 2019-12-06 16:09:11
问题 I have been trying to setup a docker image on Azure and am running into an issue. The image has been designed to require a -h hostname argument when starting it using the docker commands. The image is here: https://hub.docker.com/r/sverhoeven/cartodb/ I can't translate these commands into something I can do on Azure. The options for -h are as follows: How to use a different hostname: For example to use cartodb.example.com as a hostname start with: docker run -d -p 80:80 -h cartodb.example.com

port redirect to docker containers by hostname

99封情书 提交于 2019-12-06 11:01:41
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 hostname. As far as I'm aware docker does not have such functionality built in, nor it should. To

ASP .NET Core 2.0 Change “localhost” to a “hostname”

心不动则不痛 提交于 2019-12-06 10:28:08
问题 I have a Web App written based on MVC framework. It runs really well on the localhost and default port 51290. Now I need to run it using my domain name e.g. myhostname. What I have tried is to add a line in "applicationhost.config" section: <binding protocol="http" bindingInformation="*:80:myhostname" /> When I press Ctr+F5, I got an error msg saying port 80 is in use. The server is IIS express. Can someone please instruct how should I run this App using host name? Thanks. 回答1: After I run

Centos7(RHEL)修改主机名(hostname)

一笑奈何 提交于 2019-12-06 10:04:25
在CentOS或RHEL中,有三种定义的主机名: 静态的(static), 瞬态的(transient), 灵活的(pretty)。 “静态”主机名也称为内核主机名,是系统在启动时从/etc/hostname自动初始化的主机名。“瞬态”主机名是在系统运行时临时分配的主机名,例如,通过DHCP或mDNS服务器分配。静态主机名和瞬态主机名都遵从作为互联网域名同样的字符限制规则。而另一方面,“灵活”主机名则允许使用自由形式(包括特殊/空白字符)的主机名,以展示给终端用户(如mss01)。 centos7和之前的修改hostname的方式不同,之前修改/etc/sysconfig/network里面的配置文件即可,centos7可以 在CentOS/RHEL 7中,可以用hostnamectl命令查看或修改与主机名相关的配置。 可以使用hostnamectl set-hostname命令来修改hostname 修改pretty级别的hostname可以使用hostnamectl --pretty set-hostname [主机名]来修改 要永久修改主机名,你可以修改静态主机名: hostnamectl --static set-hostname [主机名] 来源: oschina 链接: https://my.oschina.net/u/698000/blog/741988

Linux 修改主机名(hostname)

有些话、适合烂在心里 提交于 2019-12-06 10:04:11
1.查看原机器名 # hostname localhost.localdomain 2.修改新机器名(localhost.localdomain 改为 新机器名.localdomain) # vim /etc/sysconfig/network NETWORKING=yes HOSTNAME=localhost.localdomain # vim /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 3.重启系统 # reboot 或 # shutdown -r now 来源: oschina 链接: https://my.oschina.net/u/2276973/blog/347380

Linux hostname主机名的配置文件/etc/hosts详细介绍

早过忘川 提交于 2019-12-06 10:01:19
1、 什么是Linux主机名 无论在局域网还是INTERNET上,每台主机都有一个IP地址,是为了区分此台主机和彼台主机,也就是说IP地址就是主机的门牌号。但IP地址不 方便记忆,所以又有了域名。域名只是在公网(INtERNET)中存在(以实验为目的的局域网域网实验性除外),每个域名都对应一个IP地址,但一个IP 地址可有对应多个域名。域名类型 Linux sir.org 这样的; 主机名是用于什么的呢?在一个局域网中,每台机器都有一个主机名,用于主机与主机之间的便于区分,就可以为每台机器设置主机名,以便于以容易记忆的方法来相互访问。比如我们在局域网中可以为根据每台机器的功用来为其命名。主机名相关的配置文件:/etc/hosts; 2. Linux主机名配置文件 主机名的配置文件大多是/etc/hosts ;hosts - The static table lookup for Linux hostname(主机名查询静态表);由于 Linux发行版本众多,与主机名相关的配置文件有时也有所不同。现在我们说说常见版本的主机名配置文件; 2.1 Linux主机名置文件 /etc/hosts Fedora/Redhat 或以Fedora/Redhat为基础打包的发行版,主机名配置文件是 /etc/hosts Debian或以Debian为基础打包的发行版,主机名配置文件是 /etc

Rails: Get hostname in an initializer

梦想与她 提交于 2019-12-06 07:23:12
问题 I'm using Sorcery for Authentication, and I need to setup third party authentication in its initializer. The initializer has a line that looks like this: config.twitter.callback_url "http://example.dev/auth/callback?provider=twitter" ...where example.dev is the hostname when I'm using Pow in local development. This needs to be example.com if the app is in production, or staging.example.com if it's in staging, etc. I would like to set this line to be something like this: config.twitter