Articles of apache 2.2

在Apache2后面运行Thin

目前我的Ubuntu服务器使用Apache2 + Passenger运行RubyOnRails应用程序。 现在我需要部署一个Sinatra(普通的Ruby应用程序),它需要在Thin而不是Passenger上运行。 我熟悉configurationApache,并希望继续以这种方式,VirtualHosts(在网站可用)等。 如何将Apache中的VirtualHost“路由”到瘦服务器?

在远程中央日志服务器上处理Apache日志

我们有50个RHEL Apachenetworking服务器。 我们希望所有的Apache日志都可以在专门的服务器上进行处理,因为我们不需要在生产服务器上安装日志处理应用程序的依赖关系。 什么是完成它的最好方法?

为什么在机器上有很多httpd进程,而我只启动一个Apache的httpd服务?

在安装了apache的linux机器上,我通过ps -ef |search了httpd grep httpd, 我看了大约10个httpd进程,为什么呢? myuser 14732 1 0 Jan12 ? 00:00:10 /home/myuser/webserver/bin/httpd -k start myuser 14736 14732 0 Jan12 ? 00:00:00 /home/myuser/webserver/bin/httpd -k start myuser 31309 14732 0 Jan14 ? 00:00:00 /home/myuser/webserver/bin/httpd -k start myuser 31313 14732 0 Jan14 ? 00:00:00 /home/myuser/webserver/bin/httpd -k start 谢谢。

如何计算每个prefork线程需要多less内存,以便在EC2小实例上获得最大的WordPress性能

只要阅读让EC2-Micro上的WordPress稳定 在“调整Apache”部分,我不能完全弄清楚他是如何为自己的preforkconfiguration提供数字的。 他解释了如何获得一个平均的过程,我得到的数字。 但是之后: 或者每个进程大约53MB …在这种情况下,十个线程应该是安全的。 这意味着,如果我们收到超过10个并发请求,其他请求将排队,直到一个工作线程可用。 为了最大限度地提高性能,我们还将configuration系统使这个线程数始终可用。 从每个进程53MB,与613MB的RAM,他不知何故得到这个configuration,我不明白: <IfModule prefork.c> StartServers 10 MinSpareServers 10 MaxSpareServers 10 MaxClients 10 MaxRequestsPerChild 4000 </IfModule> 他是如何从每个进程53MB获得的,限制为613MB? 奖金的问题 从下面的小实例(1.7 GB内存),好的设置是什么? bitnami@ip-10-203-39-166:~$ ps xav |grep httpd 1411 ? Ss 0:00 2 0 114928 15436 0.8 /opt/bitnami/apache2/bin/httpd -f /opt/bitnami/apache2/conf/httpd.conf 1415 ? S 0:06 10 0 125860 55900 3.1 /opt/bitnami/apache2/bin/httpd -f /opt/bitnami/apache2/conf/httpd.conf […]

从linux进程表查找Apache的网站

我正在使用Ubuntu服务器,当我运行ps aux我得到以下进程表http://pastebin.com/NJsASBek,因为我们可以看到apache进程如下所示: www-data 26487 0.0 0.9 245476 14920? Sl 17:32 0:00 / usr / sbin / apache2 -k start 其中2687是PID。 我怎么知道我启用的网站是否属于这个过程? 这是如何定义我的apache网站http://pastebin.com/mcew79sH当然,我愿意编辑我的apache网站,如果需要的话。

Apache – 为什么我的Apache用户是一个数字?

$ ps aux | grep httpd 1003 22806 0.0 0.3 17624 7684 ? S May25 0:00 /opt/web/apache/bin/httpd -k start 1003 4834 0.0 0.3 17624 7684 ? S May28 0:00 /opt/web/apache/bin/httpd -k start 1003 5299 0.0 0.3 17740 7804 ? S May28 0:00 /opt/web/apache/bin/httpd -k start 1003 5503 0.0 0.3 17624 7684 ? S May28 0:00 […]

从root .htaccess重写规则中排除一个目录以允许它被密码保护?

上个星期我花了很多时间来解决这个问题,但不pipe我尝试了什么,我都无法把它工作。 我的网站主持人说,他们没有任何人对htaccess文件有足够的了解,以使其运行起来(鼓励,对吧?),而我从CMS购买CMS的公司也无法确定解决scheme。 我也在这里和其他网站上看过几十个答案,但是我根本无法解决我的问题。 这里的交易:我的CMS – Invision电源板 – 生成以下.htaccess文件,它位于网站的根目录: <IfModule mod_rewrite.c> Options -MultiViews RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} .*\.(jpeg|jpg|gif|png)$ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule . /public/404.php [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> 我有一个子目录sub_dir ,我需要在子目录中使用.htaccess文件进行密码保护。 我通过cPanel设置了密码保护,如果网站根目录下的.htaccess文件被禁用,它可以正常工作。 如果网站根目录下的.htaccess文件没有被禁用,那么当我浏览到sub_dir ,主页被显示。 起初,我认为显示的主页可能与404页面重写有关,但即使我删除了404页面的重写条件和规则,主页仍然显示。 sub_dir .htaccess文件中的sub_dir是: AuthUserFile "/home/[user]/public_html/.htpasswd" AuthType Basic AuthName "subdir" require valid-user 正如我之前提到的,密码保护在根目录中的.htaccess文件被禁用时起作用。 它也适用于当我删除底部重写条件和规则(index.php的行),但删除404页的重写条件和规则不影响任何东西。 […]

如何在没有SSL证书的情况下运行虚拟主机443?

我有一个虚拟主机指令,如果input了无效的子域名,则会提供自定义404错误: <VirtualHost *:80> # the first virtual host ServerName site_not_found RedirectMatch 404 ^/(?!custom_error) </VirtualHost> <VirtualHost *:80> ServerName example.com ServerAlias ??.example.com </VirtualHost> 我想设置一个虚拟主机,通过HTTPS连接显示相同的自定义错误。 我已经尝试了以下内容: <VirtualHost *:443> # the first virtual host ServerName site_not_found RedirectMatch 404 ^/(?!custom_error) </VirtualHost> <VirtualHost *:443> ServerName example.com ServerAlias ??.example.com # SSL options, other options, and stuff defined here. </VirtualHost> 但服务器不会启动并发出错误: 服务器应该是SSL感知的,但没有configuration证书[提示:SSLCertificateFile]((null):0) 看来,即使SSLEngine没有为这个虚拟主机打开,也需要SSL证书。 […]

无法在Apache上安装PHP-FPM(无法连接到FastCGI服务器)

我一直有问题安装php-fpm与apache2-mpm-worker 。 他是我所遵循的向导 。 根据指南的步骤5, Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -pass-header Authorization 但是我找不到/usr/lib php5-fcgi ,只能find/usr/bin/php5-cgi和/usr/bin/php-cgi ,我不确定它们是否相同。 所以我改变了第5步的内容: Alias /php5-fcgi /usr/bin/php5-fcgi FastCgiExternalServer /usr/bin/php5-fcgi -host 127.0.0.1:9000 -pass-header 在重新启动Apache,它的日志给了错误: [notice] caught SIGTERM, shutting down [alert] (4)Interrupted system call: FastCGI: read() from pipe failed (0) [alert] (4)Interrupted system call: FastCGI: the PM is shutting down, Apache seems […]

清漆会生病

我遇到了Varnish的问题,它适用于几个意见,然后生病…奇怪的是,它可以工作大约20或30个请求。 如果我直接调用Apache,它工作正常。 我在Debian Squeeze上运行Varnish Version:3.0.3-1,现在在端口80上运行Apache,在同一台服务器上运行端口8080上的Varnish。 我使用https://github.com/mattiasgeniar/varnish-3.0-configuration-templates作为我的VCL的基础,并修改了VCL来支持Concrete5。 任何人有任何线索我应该如何debugging呢? backend default { .host = "127.0.0.1"; .port = "80"; .connect_timeout = 1.5s; .first_byte_timeout = 45s; .between_bytes_timeout = 30s; .probe = { .url = "/"; .timeout = 1s; .interval = 10s; .window = 10; .threshold = 8; } } LOG 0 CLI – Rd ping 0 CLI – Wr […]