服务器管理员

系统和网络管理员的问答

1
以下软件包具有未满足的依赖项:nodejs:冲突:npm
我遵循了这个要旨https://gist.github.com/Goddard/5500157来安装nodejs和npm,但是运行它之后,既不能运行node --version也不可以运行npm --version,从而导致找不到命令错误。我能够卸载nodejs,但是必须进入脚本中描述的temp目录并进行make卸载才能使npm离开。 现在,尝试再次安装nodejs和npm时,我改用此链接http://www.andreagrandi.it/2013/02/08/how-to-install-latest-stable-node-js-on-ubuntu/,但是,如果我尝试同时安装nodejs和npm,则会收到此错误消息。 sudo apt-get install nodejs npm The following packages have unmet dependencies: nodejs : Conflicts: npm E: Unable to correct problems, you have held broken packages. 如果我只是安装nodejs,那可以正常工作。 sudo apt-get install nodejs node --version v0.10.15 但是现在,如果我尝试安装npm,则会显示此错误消息 sudo apt-get install npm The following packages have unmet dependencies: npm : …

2
Chef:为模板创建目录(如果尚不存在)
如果我正在创建模板,如何确保目录存在?例如: template "#{node[:app][:deploy_to]}/#{node[:app][:name]}/shared/config/database.yml" do source 'database.yml.erb' owner node[:user][:username] group node[:user][:username] mode 0644 variables({ :environment => node[:app][:environment], :adapter => node[:database][:adapter], :database => node[:database][:name], :username => node[:database][:username], :password => node[:database][:password], :host => node[:database][:host] }) end 由于/var/www/example/shared/config不存在database.yml要复制到的操作,因此失败。我在考虑p如何允许您“确保”目录存在。
17 chef  chef-solo 

4
为给定的SSH主机设置变量
在中ssh_config,可以选择使用将某些环境变量导出到主机SendEnv。 是否还有一种方法可以为每个主机强制给定此变量的给定值?例如,是否只有在连接到主机时才可以导出$FOO带有值的变量?barexample.com

6
DHCPDISCOVER / DHCPOFFER,但没有DHCPACK
我有一台远程客户端计算机正在发送DHCPDISCOVER。服务器以DHCPOFFER响应,但是没有DHCPACK。 同一台主机大约每30秒重复一次。有什么我可以远程执行的操作,还是需要有人重新启动它?它在数据中心内,所以我可能不得不去那里! 感谢您的建议。我已经重新启动了所有计算机,但是仍然有问题。我认为我的配置有问题。这看起来正确吗? # # /etc/dhcpd.conf for primary DHCP server # authoritative; ddns-update-style none; deny duplicates; default-lease-time 600; max-lease-time 3600; # Our fixed hosts host host2 { hardware ethernet xx:xx:xx:xx:xx:xx; fixed-address x.x.x.202; } host host3 { hardware ethernet xx:xx:xx:xx:xx:xx; fixed-address x.x.x.203; } host host4 { hardware ethernet xx:xx:xx:xx:xx:xx; fixed-address x.x.x.204; …
17 linux  isc-dhcp  dhcpd 

3
在本地网络上进行Git克隆/拉取[关闭]
关闭。这个问题是题外话。它当前不接受答案。 想改善这个问题吗? 更新问题,以使其成为服务器故障的主题。 6年前关闭。 我正在尝试使用Ubuntu Quantal在另一台PC中克隆/拉存储库。我以前在Windows上已经做到了,但是我不知道ubuntu的问题是什么。我尝试了这些: git clone file:////pc-name/repo/repository.git git clone file:////192.168.100.18/repo/repository.git git clone file:////user:pass@pc-name/repo/repository.git git clone smb://c-pc/repo/repository.git git clone //192.168.100.18/repo/repository.git 我总是得到: Cloning into 'intranet'... fatal: '//c-pc/repo/repository.git' does not appear to be a git repository fatal: The remote end hung up unexpectedly 要么 fatal: repository '//192.168.100.18/repo/repository.git' does not exist 更多: …

2
Nginx https重写将POST转换为GET
我的代理服务器在ip A上运行,这是人们访问我的Web服务的方式。Nginx配置将重定向到IP B上的虚拟机。 对于IP A上的代理服务器,我在我的站点中有此服务器 server { listen 443; ssl on; ssl_certificate nginx.pem; ssl_certificate_key nginx.key; client_max_body_size 200M; server_name localhost 127.0.0.1; server_name_in_redirect off; location / { proxy_pass http://10.10.0.59:80; proxy_redirect http://10.10.0.59:80/ /; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } server { listen 80; rewrite ^(.*) https://$http_host$1 permanent; server_name …
17 nginx  rewrite 


2
编辑Nginx配置文件时如何设置Vim文件类型
当我打开vim文件时/etc/nginx/sites-available/default,语法高亮显示正常。但是,如果我创建自己的文件/etc/nginx/sites-available/myapp,vim不会突出显示其语法。我:setf conf每次都要做。 我有什么可以~/.vimrc告诉vim“如果您不知道要使用哪种语法,请使用conf”? 一.vimrc对VIM小白模板也欢迎。我没有将其用作IDE,而是将vim仅用于配置文件。 注意:我在使用Ubuntu 12,以防万一。
17 ubuntu  vim 


2
如何允许通过iptables进行传出连接?
我有两台服务器。第一个程序需要与第二个程序在端口2194上进行通信。 我知道它不起作用,因为当我这样做时: root@server1 [~]# telnet myserver2.com 2194 Trying 123.123.123.98... telnet: connect to address 123.123.123.98: Connection timed out telnet: Unable to connect to remote host: Connection timed out server1# iptables -L -n Chain INPUT (policy DROP) ... ... Chain FORWARD (policy DROP) target prot opt source destination Chain OUTPUT (policy DROP) …

1
如何限制IIS中的应用程序使用的内存?
IIS工作进程正在我们的服务器上占用大量内存。我想限制每个应用程序可以使用的内存。我是否应该为虚拟内存限制或私有内存限制设置一个限制。IIS中的每个应用程序都在其自己的应用程序池中。 如果我将专用内存限制设置为500MB,将虚拟内存限制设置为3GB。应用程序池何时回收?达到500MB或达到3GB后会回收吗?


10
服务器上是否有2个NIC?
除了以下情况之外,是否有任何理由在服务器上有2个NIC? 您需要连接到2个不同的物理网络 冗余(1个NIC发生故障,因此您使用了另一个) 还有其他原因吗?
17 networking  nic 



By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.