Articles of apache 2.2

htaccess和重写 – 内部redirect在别名

我有一个子目录下面的.htaccess : RewriteEngine on RewriteRule ^file.js$ file.php 包含上述和其他文件的目录如下所示: dir/ ├── index.html └── js ├── file.php └── .htaccess 我想我的file.js被内部redirect到file.php 。 当我在/var/www/html/ dir下finddir ,我的vhost定义如下所示: DocumentRoot /var/www/html <Directory "/var/www/html"> AllowOverride All Require all granted </Directory> #Alias /dir "/tmp/dir" #<Directory "/tmp"> # AllowOverride All # Require all granted #</Directory> 它的作品 ! 但是,当我将dir移动到/tmp/并将vhost更改为如下所示: DocumentRoot /var/www/html #<Directory "/var/www/html"> # AllowOverride All […]

设置我自己的DNS服务器来支持通配符域?

我的注册商不通过他们的DNS系统支持通配符域,但我可以定义我自己的DNS服务, 我不能改变我的注册商(我知道,“为什么”超出了我的问题的范围:)),我想要通配符域。 我的问题是可以设置我自己的DNS服务来支持通配符域 /绕过我的注册服务商的DNS服务限制? 如果是这样,怎么样? 我知道如何configurationApache / httpd.conf来使通配符域工作,我对“设置DNS”部分感兴趣 PS。 我有一个运行CentOS 6.4 + Apache 2.2.15的专用盒子

将服务器从Apache迁移到Nginx – 我的请求如何处理?

我正在尝试将服务从服务器迁移到另一个服务器。 这是一个简单的php应用程序。 在第一台服务器( Apache )上,我可以通过以下方式请求一个JSON : my.vhost.myDomain.tld/apps?query=toto&params=aparam 在第二个( nginx )上,我应该可以用同样的方法来做: my.vhost.myOtherDomain.tld/apps?query=toto&params=aparam 两个应用程序都包含一个由两个Web服务器正确提供的index.php 。 但是, /apps? 在nginx上产生一个404。 我的猜测是, Apache正在寻找一个php文件来处理查询。 然而,我对这个工具是一个小菜鸟,我不明白在Apache服务器上发生了什么,以及如何configurationnginx重现相同的行为… 是index.php文件作为input处理? 到目前为止,我试图指定my.vhost.myOtherDomain.tld/index.php/apps?query=toto&params=aparam成功。 并没有太多的帮助,探索Apacheconfiguration文件。

Mod_security – 语法错误

我的Web服务器上有一个受密码保护的目录。 为了防止暴力攻击,我试图在apache2configuration文件中添加基于IP的BLockingconfiguration。 但每次我重新启动Apache2我得到语法错误。 有谁知道如何解决这个问题? 谢谢 Apache版本:2.2 Mod Security CRS – 2.2.8-1 重新启动Apache时出错 /etc/init.d/apache2 restart * Restarting web server apache2 [fail] * The apache2 configtest failed. Output of config test was: AH00526: Syntax error on line 252 of /etc/apache2/apache2.conf: ModSecurity: No action id present within the rule Action 'configtest' failed. The Apache error log may have […]

奇怪的东西在服务器错误日志?

我有一个基于他们的PIDclosures服务器进程的PHP脚本。 看起来它运行的很好,但是,我在Apache的错误日志中发现了这个奇怪的东西。 有什么想法是什么意思? [Thu Jul 24 10:27:09.609608 2014] [mpm_prefork:notice] [pid 920] AH00169: caught SIGTERM, shutting down [Thu Jul 24 10:27:10.731370 2014] [mpm_prefork:notice] [pid 1548] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.3 configured — resuming normal operations [Thu Jul 24 10:27:10.731516 2014] [core:notice] [pid 1548] AH00094: Command line: '/usr/sbin/apache2' [Thu Jul 24 10:27:17.709118 2014] [mpm_prefork:notice] [pid 1548] AH00169: caught […]

正在运行的太多httpd进程挂起

我已经在Solaris V.10上安装了Web服务器Apache。 当Apache启动时,服务器行为变得exception。 CPU使用率变为96%,服务器慢慢变慢,当我处理apache的grep时,有超过216个httpd进程,这个boost不是渐进的,而是在很短的时间内激增的。 但是,在这台服务器上没有这么大的负载,仍然可以看到这种行为

亚马逊机器图像

我有一个运行在新加坡AWS服务器上的网站。 这是一个EC2实例,网站是使用configuration了Apache和MySQL的django构build的。 我拿着运行网站的实例的亚马逊机器映像(AMI),将AMI复制到N. Virginia位置,并在N.Virginia上使用AMI启动一个新的EC2实例。 由于这是一个完整的机器映像,我希望在访问北弗吉尼亚州的新服务器的公共DNS时看到我的网站。 但是,我收到一个Bad Request (400) 。 有任何想法吗? Apache错误日志: [Fri Jul 25 14:51:19.903606 2014] [mpm_prefork:notice] [pid 1114] AH00169: caught SIGTERM, shutting down [Fri Jul 25 17:29:53.560742 2014] [mpm_prefork:notice] [pid 1230] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.3 mod_wsgi/3.4 Python/2.7.6$ [Fri Jul 25 17:29:53.704627 2014] [core:notice] [pid 1230] AH00094: Command line: '/usr/sbin/apache2' [Fri Jul 25 17:36:53.240811 2014] […]

fail2ban不工作在Apache Ubuntu

即使它在日志中检测到也没有任何反应。 它不会阻止IP。 它适用于VSFTP,但不适用于Apache。 请帮忙。 你可以看到下面的configuration和日志。 jail.localconfiguration文件: [apache] enabled = true port = 80,443 filter = apache-auth logpath = /var/log/apache*/*error.log maxretry = 2 # default action is now multiport, so apache-multiport jail was left # for compatibility with previous (<0.7.6-2) releases [apache-multiport] enabled = true port = http,https filter = apache-auth logpath = /var/log/apache*/*error.log maxretry = […]

Apache重写删除“www”不工作(全局)

我把Apache Server Configs全局.htaccess文件放在我的Web服务器上,如/etc/apache2/apache-server-configs.conf 。 然后在我的/etc/apache2/apache2.conf文件中,我已经得到了这个文件的结尾: # Include of directories ignores editors' and dpkg's backup files, # see the comments above for details. # Apache Server Configs Include apache-server-configs.conf # Include generic snippets of statements Include conf.d/ # Include the virtual host configurations: Include sites-enabled/ 正在包含apache-server-configs.conf文件,但是这段代码无法工作: RewriteCond %{HTTPS} !=on RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteRule ^ http://%1%{REQUEST_URI} […]

如何识别哪个特定的php文件/函数正在导致508错误(资源耗尽)

我的客户本周末出现这个错误。 我在这个WordPress的网站上进行维护,它已经在线了大约10年 资源限制已到达 网站暂时无法为您的请求提供服务,因为它超出了资源限制。 请稍后再试。 Apache / 2.2.27(Unix)mod_ssl / 2.2.27 OpenSSL / 1.0.1e-fips DAV / 2 mod_bwlimited / 1.4 PHP / 5.4.30服务器,位于www.clientwebsite.com 80端口 我试图解决它使用top -c命令监视服务器上的活动和exit(); 命令在我的wp-config.php在各个点上,但它并没有缩小问题的范围。 如果你在某个阶段遇到了这个问题,并有一些build议,我会非常感激。 编辑:忘记提及,当我正在监视使用顶部-c的细节,这是我得到: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 733791 vdog 20 0 345m 73m 12m R 100.0 0.5 1:02.26 /usr/local/apache/bin/httpd -k start -DSSL […]