对于一个实际的项目,我必须build立一个高可用的存储服务器,可以存储和发布(http)1.5亿张7种尺寸的照片,总计10亿5000万个文件。 对于每张照片,我们都需要总共200 KB的空间来存储它们共计28 TB的7种尺寸。 其实我有两个服务器(2个E5620,12GB内存,Raid控制器1GB NVcaching,2个160GB的磁盘操作系统),都有一个存储arrays(DAS)与12x3TB SAS磁盘。 我不确定我的计划设置是否是最好的解决scheme: 操作系统:RHEL 6 磁盘arrays:Raid 6,ext4 / rsync或gfs2 HTTP服务器:Apache Traffic Server 3或nginx 通过这种方式,服务器存储和发布照片。 对我有什么build议? 我可以根据需要添加更多的服务器。 什么文件系统是正确的路要走? Raid 6好吗?
我正在尝试在CentoOS服务器上安装Nginx并且很难。 我大部分是CentOS的新手,但我对Debian很熟悉(但是这台服务器必须是CentOS) joinEPEL回购后,我跑了: yum install nginx 直到现在,它做了它的事情: –> Finished Dependency Resolution nginx-0.8.55-1.el5.x86_64 from epel has depsolving problems –> Missing Dependency: kernel >= 2.6.18-181 is needed by package nginx-0.8.55-1.el5.x86_64 (epel) Error: Missing Dependency: kernel >= 2.6.18-181 is needed by package nginx-0.8.55-1.el5.x86_64 (epel) You could try using –skip-broken to work around the problem You could try running: […]
是否有一个应用程序通过nginx日志并阻止提出常见webapp漏洞请求的IP? 我有一个只提供静态内容的nginx web服务器。 我经常得到GET /db/websql/main.php或GET /db/phpMyAdmin2/main.php请求。 这些是有人扫描漏洞的明显迹象。 是否有一个应用程序可以通过nginx日志,认识到这些尝试利用常见的漏洞,并阻止有问题的IP? 我的想法是,即使我不容易受到这些攻击,相同的IP也可能在我的networking上的同一个盒子或其他盒子上进行其他types的攻击:SMTP,SSH,其他带有Web应用程序的Web服务器。 在cookiesjar子里用手抓住它们看起来是一个很好的方法。 Fail2ban为SSH和HTTPauthentication尝试做类似的事情。 也许它可以与configuration一起使用,其中包括用于漏洞的众所周知的地址列表。 有没有这样的configuration可用?
我有我的configuration文件中的这一行 server_name site.com m.site.com 我的代码检查,如果url是m.site.com并提供移动版本。 但是,当我这样做去m.site.com/abc将显示我的代码site.com/abc这是错误的。 如果我复制/粘贴整个块,并将site.com更改为m.site.com它工作正常。 但我宁愿没有重复的configuration(或代码)。 有没有解决的办法?
最近转移到新的服务器与CentOS 5.4和64位,而不是我们的旧的32位。 现在有了双处理器和更高的内存。 但是我意识到,apache一直在大量占用内存,有时会导致系统交换。 目前的设置在前面有Nginx 1.0.8来提供静态内容,Apache 2.2提供dynamic内容(PHP)。 我也安装了APC。 什么可能导致这种内存使用率高峰? 我尝试调整configuration文件的Apache,但它会工作,如果我把某些指令到一个荒谬的低数字。 在旧机器上之前,我可以使用默认设置,对于所有的apache进程,内存使用量不超过260MB: <IfModule prefork.c> StartServers 8 MinSpareServers 5 MaxSpareServers 20 ServerLimit 256 MaxClients 256 MaxRequestsPerChild 4000 </IfModule> 但现在新机器正在使用这个高内存使用率,它可以得到高达600MB +: <IfModule prefork.c> StartServers 5 MinSpareServers 5 MaxSpareServers 10 MaxClients 20 MaxRequestsPerChild 500 </IfModule> APC设置如下: extension = apc.so apc.enabled=1 apc.shm_segments=1 apc.optimization=0 apc.shm_size=64M apc.ttl=0 apc.user_ttl=7200 apc.num_files_hint=1024 apc.mmap_file_mask=/tmp/apc.XXXXXX apc.enable_cli=1 apc.cache_by_default=1 […]
如果我有: # … http { include mime.types; # … types { } } # … 第二种types覆盖包含或附加到MIMEtypes的types?
我有一个在Nginx中设置的301重写列表。 我想指定完整的uri而不是使用正则expression式。 写这种方式是什么? 这是我认为应该做的事情: rewrite /o-atipico /rogerio-madureira.htm permanent; rewrite /CHANGELOG.txt / permanent; rewrite /MaxLucado / permanent; rewrite /adwords / permanent; rewrite /animals.txt / permanent; rewrite /apresentacao / permanent; rewrite /arquivos / permanent; rewrite /atipico / permanent; rewrite /atipico.com.br / permanent; rewrite /baix / permanent; rewrite /baixe.asp / permanent; rewrite /blog / permanent; rewrite /c / […]
现在我正在用varnish前端在nginx上运行Wordpress w / W3 Cache。 我正在尝试使用WordPress的WP Touch Pro插件来显示移动网站,但它不工作。 仍然显示桌面主题。 我已经将移动用户代理放在了w3caching中的拒绝用户代理框中。 这里是nginxconfigurationw3caching吐出来: BEGIN W3TC Page Cache cache location ~ /wp-content/w3tc/pgcache.*html$ { expires modified 3600s; add_header X-Powered-By "W3 Total Cache/0.9.2.4"; add_header Vary "Accept-Encoding, Cookie"; } location ~ /wp-content/w3tc/pgcache.*gzip$ { gzip off; types {} default_type text/html; expires modified 3600s; add_header X-Powered-By "W3 Total Cache/0.9.2.4"; add_header Vary "Accept-Encoding, Cookie"; […]
对于正常的公共页面,我做了一个 proxy_cache assets; proxy_cache_key backend$request_uri; proxy_cache_valid 200 302 100d; proxy_cache_valid 404 1m; proxy_cache_use_stale error timeout invalid_header; caching内容。 是否有per user或基于IP的caching机制,将允许我caching内容。 我的主要目的是为了防止快速刷新,用户在短时间内(例如30秒或一分钟内)caching页面。 我了解NAT的含义。 但是我很好。
我正在运行一个nginx实例,它充当EC2虚拟服务器上的SSL端点和基本负载平衡器,并且看到来自上游源的SSL页面的性能很差。 EC2实例是一个c1.medium,应该能够维持合理的吞吐量,但是我不能每秒超过60个事务。 服务于nginx状态页直接离开服务器,我pipe理的吞吐量是十倍以上,所以它不是纯粹的SSL开销,但是如果我重新configuration它服务相同的内容没有SSL我也做的更好,所以它也不是上游高架。 当CPU每秒处理60个事务时,CPU 已经最大化了。 我正在使用ab来testing它,参数为“-n 1000 -c 50 -k” – 1000个命中,并发度为50,启用了keepalives,以便SSL会话caching应该可以工作。 这是一个简短的configuration: user www-data; worker_processes 4; pid /var/run/nginx.pid; events { worker_connections 4096; } http { sendfile off; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/json; log_format standard '$remote_addr – $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"'; access_log /var/log/nginx/access.log standard; error_log […]