Articles of apache 2.2

未能在Ubuntu上正确configurationApache2子域

我租了一个运行Ubuntu的小型虚拟专用服务器,我试图configuration一个子域。 感谢几个资源,我已经知道我应该如何做到这一点,但仍然没有成功。 希望有人能帮我找出我做错了什么。 我在/etc/apache2/sites-available创build了一个名为<domain>.conf的文件。 它包含以下内容: NameVirtualHost *:80 # Configuration for index.<domain> and <domain>. <VirtualHost *:80> ServerAdmin administrator@<domain> DocumentRoot /var/www/sites/<domain>/index ServerName index.<domain> ServerAlias <domain> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> 我已经使用以下命令启用了该网站: sudo a2ensite /etc/apache2/sites-available/<domain>.conf 此外,我已经configurationDNS设置如下: Name Type Value <domain> A <ip-address> index.|DOMAIN| A <ip-address> 打开http://<domain>工作得很好,但打开http://index.<domain>不会。 相反,我收到一条消息,告诉我“这个网页不可用”。 apache2ctl -S返回以下内容: AH00558: apache2: Could not reliably determine the server's […]

debugging客户端证书问题

我正在尝试configurationApache安装来接受客户端证书。 当我使用自签名证书(Apache身份不明)和使用Firefox时,它在SSLVerifyClient设置为optional_no_ca时SSLVerifyClient 。 但是,我们也尝试从WebMethods SAP连接,并给出一个错误消息(消息说“服务器证书被链validation器拒绝”),但是我看不到我的Apache安装中发生了什么。 有没有办法看到Apache从这个客户端接收/发送什么? 我的日志都是空的这个IP地址。 通过将LogLevel进行debug我得到了更多的日志logging。 这是我现在得到的消息: SSL图书馆错误:错误:14094412:SSL例程:SSL3_READ_BYTES:sslv3警报错误证书(SSL警报号码42) – 证书中的Subject CN不是服务器名称或与CA相同? 这是什么意思,并且客户证书是否需要有服务器CN呢?

mod_rewritedate子文件夹不工作

我有一个奇怪的问题,我感到困惑。 我会和那个正则expression式的前奏不是我的强项。 我需要社区的反馈来实现这一目标。 如果我有以下url: http://example.com/2015-03-25/ 我想通过一个PHP文件运行这些。 这条规则对于下面的mod_rewrite很有效: RewriteRule ^/?([0-9]){4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/(.*)$ show_page.php?page=$3 [NC,L] 但是我想把文件夹移到: http://example.com/my_pages/2015-03-25/ 此规则不起作用: RewriteRule ^/my_pages/?([0-9]){4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/(.*)$ show_page.php?page=$3 [NC,L] 此规则也不起作用: RewriteRule ^my_pages/?([0-9]){4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/(.*)$ show_page.php?page=$3 [NC,L] 我在这里错过了什么? 社区的帮助非常感谢。 UPDATE! 这是我所做的解决这个问题: RewriteRule ^my_pages\/([0-9]){4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/(.*)$ show_page.php?page=$3 [NC,L] 与 RewriteRule ^/my_pages/?([0-9]){4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/(.*)$ show_page.php?page=$3 [NC,L] 奇怪的是,在Apache 2.4上,正确的语法实际上是。 RewriteRule ^my_pages/?([0-9]){4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/(.*)$ show_page.php?page=$3 [NC,L]

“正常”数量的进程/线程

考虑一个标准的LAMP服务器(又名虚拟主机)什么应该是在进程/线程数量的限制? ps -elfT | wc -l 475 “限制”我的意思是:在DDOS上,httpd的subprocess数量可能会很快增加。

Apahce MPM ITK放弃了连接

我目前在专用的Mac Mini服务器上使用Apache MPM ITK,以允许Apache在多个用户帐户下运行不同的虚拟主机。 我遇到了一个问题,大约1-2%的时间,当我刷新页面,我会得到一个“服务器丢弃连接”的错误。 只有在模块已安装并处于活动状态时才会发生。 我想知道是否有人经历过这个问题,或者对我如何追踪这个问题有深入的了解。

Apache在CentOS 6上无反应

今天早上有两次,今天凌晨八点到九点,我们的Apache服务器没有响应,虽然服务显示为正在运行。 我们重置它与服务httpd重启,这似乎解决了这个问题。 在此之前,我们的服务器已经运行了大约三个月。 我读了另一篇文章,并将MaxClients和其他值从256更改为512,因为有一个“[错误]服务器达到MaxClients设置,考虑提高MaxClients设置”显示,但是在今天上午9:05。 今天早些时候没有一个人表示“崩溃”。 以下是一些当前的error_log: [Tue Mar 31 01:22:11 2015] [error] [client 192.187.126.162] script '/home/www/www.pixelark.com/www/wp-login.php' not found or unable to stat [Tue Mar 31 02:09:13 2015] [error] [client 198.252.44.11] File does not exist: /home/www/www.pixelark.com/www/player.vimeo.com [Tue Mar 31 02:09:13 2015] [error] [client 198.252.44.11] File does not exist: /home/www/www.pixelark.com/www/player.vimeo.com [Tue Mar 31 02:32:59 2015] [error] [client […]

无法将大file upload到nginx后面的服务器作为反向代理

我使用nginx作为反向代理。 在它后面是apache hoo foo.com。 为了上传一个大文件,我在php.ini中设置了post_max_size = 20M和upload_max_filesize = 20M 。 但是我无法上传大小超过2MB的文件。 我的nginxconfiguration是: server { listen 80; server_name .foo.com; if ($http_host != "www.foo.com") { rewrite ^ http://www.foo.com$request_uri permanent; } access_log /var/log/nginx/foo.access.log; error_log /var/log/nginx/foo.error.log; index index.php index.html; location / { proxy_pass http://192.168.1.2:80/; include /etc/nginx/proxy_params; proxy_buffering off; chunked_transfer_encoding on; } } 另外我configurationnginx.conf如下: http { … sendfile on; tcp_nopush […]

为什么apache SSL证书和密钥需要在/ etc / pki / tls / private /中?

我有一个运行在CentOS 6.6上的Apache 2.2 web服务器。 我有一个证书和密钥文件,当文件在这个目录中时, SSLCertificateFile "/etc/pki/tls/private/certs/mycert.crt" SSLCertificateKeyFile "/etc/pki/tls/private/mycert.key" 但是当相同的文件在不同的目录中时失败 drwxr-xr-x. 2 root root 4096 Apr 8 16:41 ssl SSLCertificateFile "/etc/ssl/mycert.crt" SSLCertificateKeyFile "/etc/ssl/mycert.key" Apache的错误日志包含 [error] Init: Private key not found SELinux被禁用。 什么会导致这样的行为? UPDATE 这两个目录中的文件的权限是相同的: -rw-r–r– 1 root root 2253 Apr 8 16:40 mycert.crt -rw——- 1 root root 1675 Apr 8 16:40 mycert.key

运行php exec函数来停止windows服务

我已经写了一个Web程序在PHP中需要停止一个Windows服务,并启动它时,像这样运行: exec('net stop spooler'); //to stop printer spooler exec('net start spooler'); //to start printer spooler 上面的代码不会停止打印机后台处理程序,我想我知道为什么,因为当我打开cmd-命令提示符正常和键入net start spooler我得到访问拒绝…但是当我打开命令行pipe理员命令行将工作,所以我认为Apache还需要给予pipe理员权限,以便上述代码可以工作,但我不知道如何授予代码以pipe理员身份运行。 打印机后台打印程序的Windows服务可以find,当你点击开始>types运行>在运行命令typesservices.msc然后你会看到打印机后台打印作为Windows服务之一…当上面的代码运行…它应该停止服务或启动它

将apache转发代理用户redirect到本地apache站点

我希望连接到我的apache代理的所有用户都被redirect到同一个服务器上托pipe的一个apache页面。 我很舒服代理重写,301s,proxypass等,但不知道如何将所有请求redirect到自我。 我在/etc/httpd/conf.d/proxy.conf中input了以下内容 ProxyRequests On ProxyVia On <Proxy *> Order deny,allow Deny from all Allow from internal.example.com </Proxy> 我需要做的只是添加一个重写规则到上面? 例如: RewriteEngine on RewriteRule . index.php [L]