我502 Gateway在访问目录 ( http://example.com/dev/index.php) 中的 PHP 文件时遇到错误。日志只是这样说:
2011/09/30 23:47:54 [error] 31160#0: *35 connect() failed (111: Connection refused) while connecting to upstream, client: xx.xx.xx.xx, server: domain.com, request: "GET /dev/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "domain.com"
Run Code Online (Sandbox Code Playgroud)
我以前从未经历过这种情况。此类502 Gateway错误的解决方案是什么?
这是nginx.conf:
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64; …Run Code Online (Sandbox Code Playgroud) 我刚刚从我的服务器(Ubuntu 11.04)完全卸载了 nginx 1.0.6 使用
apt-get remove nginx
rm -rf /etc/nginx/
rm -rf /usr/sbin/nginx
rm /usr/share/man/man1/nginx.1.gz
apt-get remove nginx*
Run Code Online (Sandbox Code Playgroud)
现在我想再次安装它,但是在启动 nginx 时,我收到如下错误:
重启 nginx: nginx: [emerg] open() "/etc/nginx/nginx.conf" failed (2: No such file or directory)
然后我放置了我自己的conf文件,然后我收到一个新错误:
重新启动 nginx: nginx: [emerg] open() "/etc/nginx/mime.types" failed (2: No such file or directory) in /etc/nginx/nginx.conf:12
现在好像apt-get install nginx没有完全安装好,我清空了apt-get缓存,好像没有用。如何使用 apt-get 获得 nginx的完整安装?
我正在使用 Squid,我想知道如何建立特定 IP 范围的允许连接,我使用这个
acl permittedips src 77.86.72.49
http_access allow permittedips
Run Code Online (Sandbox Code Playgroud)
但我想制作一个允许 from70.*.*.*到90.*.*.*. 我怎样才能以最简单的方式做到这一点?
我不确定如何使用 OpenSSL重新编译PHP?我一直在寻找的OpenSSL的PHP页面和OpenSSL的教程左右,但我没有看到任何openssl.so或php-openssl.so在我的服务器?
apt-get频道上是否有一个简单的包,以便我可以从那里安装它?
我只需要使用 OpenSSL 重新编译 PHP,但我不知道如何执行此操作。
编辑:我运行一个专用服务器,它是 Ubuntu 11.10。
我正在创建一个退回电子邮件系统,收件人可以在其中回复我网站上的消息。
但是,当电子邮件发送给包含上一条消息的用户时,该Reply-To字段包含这样的地址notification-message-988742@mysite.com(末尾包含 ID)。
如果用户回复,回复消息将被发送回notification-message-988742@mysite.com,当然,没有自己的邮箱,除了notification@mysite.com.
如何将来自特定通配符的所有传入消息重定向notification-message-*@mysite.com到notification@mysite.com?我做了一些研究,但没有任何可靠的部分起作用,包括luser_relay = notification@mysite.com并放入notification-message-*后缀别名表中,notification@有一个 Maildir,所以邮件会进入它。
概念图:

我正在使用 Ubuntu 11.04。
我正在尝试重新加载 nginx,我有一个从 namecheap 获得的域的通配符证书,现在我已将其移至我的服务器,并为此分配了一个 nginx 配置规则:
ssl_certificate /etc/nginx/certs/website.com.crt;
ssl_certificate_key /etc/nginx/certs/website.com.key;
ssl_ciphers ECDHE-RSA-AES128-SHA256:AES128-GCM-SHA256:RC4:HIGH:!aNULL:!MD5:!EDH;
add_header Strict-Transport-Security max-age=15768000;
ssl_session_cache shared:SSL:10m;
Run Code Online (Sandbox Code Playgroud)
现在,当我通过执行重新加载 nginx 时service nginx reload,我不断收到提示:
重新加载 nginx 配置:输入 PEM 密码:
不幸的是,我不知道 PEM 密码短语,但是当我使用 OpenSSL 生成 CSR 时我确实有密码短语,但这与 PEM 密码短语不匹配。
我不知道我能做什么,我怎样才能恢复它,或者能够删除它(如果它不影响安全性)
我正在运行 Ubuntu 12.04.1 LTS 和 nginx 1.2.6。
基本上,我试图在访问子域的特定部分时启用身份验证模块,它们是dev.domain.com和pma.domain.com,它们都必须加载身份验证模块。我似乎无法弄清楚为什么我的 nginx 配置文件不起作用。
在第二个服务器块中,您可以看到带有身份验证模块的pma和dev,当我访问pma.domain.com或 时dev.domain.com,我没有看到浏览器中显示的身份验证模块,也没有存储任何错误日志。
无论如何,我只需要修复以启用对它们两个子域的身份验证,而不是完全重写我的 nginx 配置文件。
server {
server_name domain.com;
root /var/www/domain.com/www;
index index.php index.htm index.html;
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
access_log /var/www/domain.com/logs/access.log;
error_log /var/www/domain.com/logs/errors.log;
error_page 404 /index.php;
location ~ \.php$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/domain.com/www$fastcgi_script_name;
include fastcgi_params;
}
}
server {
server_name ~^(.+)\.domain\.com$;
set $file_path $1;
root /var/www/domain.com/www/$file_path;
index index.html index.php;
access_log /var/www/domain.com/logs/access.log;
error_log /var/www/domain.com/logs/errors.log;
location /
{ …Run Code Online (Sandbox Code Playgroud) 我刚刚在 Mac OS X 10.6.8 上安装了 memcached。它安装完美,当我memcached在终端中输入时,我得到了这个:
failed to listen on TCP port 11211 tcp
listen: Address already in use
Run Code Online (Sandbox Code Playgroud)
我的本地主机中有一个包含以下内容的脚本:
$memcache = new Memcache();
Run Code Online (Sandbox Code Playgroud)
但是我收到一个错误,说Fatal error: Class 'Memcache' not found.
我怎样才能让 memcached 工作,是不是因为端口 11211 没有被监听,这可能不会让 memcached 工作?
我设法找到了用于创建子域的重写(我有一个指向我的服务器的通配符域;*.domain.com.
如果我去test.domain.com,它可以很好地横向于:
/var/www/domain.com/www/test/
如果我这样做example.test.domain.com,它应该这样做:
/var/www/domain.com/www/test/example/
这是目录中的另一个test目录。
这是我发现使用的重写,但是我应该如何在这实现两个目录子域?
if ($host !~* ^www\.domain\.domain$) {}
if ($host ~* ^([^.]+)\.domain\.com$) {
set $auto_subdomain $1;
}
if (-d /var/www/domain.com/www/$auto_subdomain) {}
if (-f /var/www/domain.com/www/$auto_subdomain$uri) {
rewrite ^(.*)$ /$auto_subdomain$uri;
break;
}
Run Code Online (Sandbox Code Playgroud) 目前,我有大约5台服务器,一个我想作为一个SVN服务器发展的原因使用,但我希望它能够更新外部服务器,例如通过FTP(或任何复制提交的文件到外部服务器保证器传输) .
基本上,当我使用需要更改的文件提交到我的 SVN 服务器时,它应该将这些文件从 SVN 服务器复制到我的主站点。有什么方法可以做到这一点吗?
我正在运行 nginx 和 Ubuntu 11.04。
我一直使用 Apache 2 进行身份验证,现在我使用的是 nginx,我不知道如何为 nginx 包含身份验证,我还使用该.htaccess文件吗?
我想在/var/www/priv目录上使用身份验证模块,如何将 nginx 用于其他模块,例如重写,我在问您如何使用 nginx,一个具有此类规则的典型文件?
我的 nginx 配置文件包含:
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on; …Run Code Online (Sandbox Code Playgroud) 我刚刚完成了为我的网站编写的脚本。购买了VPS,现在不知道有什么有效的方法可以将15,000+共享主机上的图像移动到新的VPS(单独的经销商主机)。
我只想到一个,所有的图片下载到我的硬盘驱动器,然后上传到VPS通过FTP,但我没有体面的速度~160kb/s和上传速度大约是~60/70kb/s。
将15,000+图像从共享主机传输到全新 VPS的最有效方法是什么?
我有一个包含破折号的域,例如the-domain.com,当我使用我的域的服务器名称创建服务器块并重新启动 nginx 时,我收到警告:
重新启动 nginx: nginx: [warn] server name "/var/www/domain.com/www/thedomain" 在 /etc/nginx/sites-enabled/domain.com:56 nginx 中有奇怪的符号。
所以我将域更改为我拥有的另一个域,它仍然继续从上面说同样的错误。我不明白为什么当我将其更改为合适的时会这样说?
这是重复的错误:
重新启动 nginx: nginx: [warn] server name "/var/www/domain.com/www/domaindir" 在 /etc/nginx/sites-enabled/domain.com:56 nginx 中有奇怪的符号。
我的域配置文件如下所示:
server {
server_name domain.com;
root /var/www/domain.com/www;
index index.php index.htm index.html;
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
access_log /var/www/domain.com/logs/access.log;
error_log /var/www/domain.com/logs/errors.log;
error_page 404 /index.php;
location ~ \.php$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/domain.com/www$fastcgi_script_name;
include fastcgi_params;
}
}
server {
server_name ~^(.+)\.domain\.com$;
set $file_path $1;
root /var/www/domain.com/www/$file_path; …Run Code Online (Sandbox Code Playgroud)