我已经开发了一个PHP脚本,我想发送自动邮件给用户。 我用一个PHP脚本成功地实现了一个cron作业,该脚本检出一个PHP邮件队列表,用于挂起邮件。 脚本工作正常,但cron工作奇怪:它发送邮件给用户,但一次3或4。 我只想发一次邮件。 我怎样才能做到这一点? 我使用一个条件来检查邮件是否被发送,如果它是0,那么它将发送邮件并将值更新为1.这种情况工作正常。 此外,相对数据库仅显示每个用户一个条目,因此逻辑上只有一个电子邮件应该发送给用户,而cron作业一次发送3或4个相同的电子邮件给用户。 我每2分钟设置一次cron作业。 命令如下: 2 * * * * wget (Http PATH to SERVER)/Utils/MailQueue.php
我最近在Apache中设置了大容量虚拟主机 ,所以我们需要做的就是创build一个目录来创build一个新的虚拟主机。 然后,我们还使用通配符DNS将所有子域映射到运行我们的Apache实例的服务器。 这工作出色,但是我现在有麻烦configuration它故障转移到适当的默认/错误页面,当虚拟主机目录不存在。 这个问题似乎是由我处理两个错误条件的愿望混合在一起的: 没有findvhost,即没有find与HTTP主机头中提供的主机匹配的目录。 我想这个显示一个合适的网站没有find错误页面。 404页面找不到虚拟主机的情况。 另外我有一个专门的“API”虚拟主机在自己的虚拟主机。 我尝试了一些变化,似乎没有performance出我想要的行为。 以下是我现在正在处理的内容: NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot /var/www/site-not-found ServerName sitenotfound.mydomain.org ErrorDocument 500 /500.html ErrorDocument 404 /500.html </VirtualHost> <VirtualHost *:80> ServerName api.mydomain.org DocumentRoot /var/www/vhosts/api.mydomain.org/current # other directives, eg setting up passenger/rails etc… </VirtualHost> <VirtualHost *:80> # get the server name from the Host: header UseCanonicalName Off VirtualDocumentRoot […]
我正在考虑在Windows 2008 R2 64位/ 16GB服务器上使用Apache 32位进行Moodle安装。 由于可用内存影响可以服务的用户并发数,因此我想知道32位Windows进程的2GB内存限制如何影响Apache + PHP。 是整个服务器的集体限制,还是每个Apachesubprocess/线程分别应用? 如果是单独的,那么有多less个孩子在Windows上启动? 每个请求一个? 每个处理器核心一个? 东西在中间? 这在某种程度上是可configuration的吗?
如果我请求一个类似http://url/T%C3%A4st (http://url/Täst)页面,我的Apache-Error页面会显示错误的编码,例如: 在此服务器上找不到请求的URL /Täst。 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL /Täst was not found on this server.</p> <hr> <address>Apache/2.2.16 (Debian) Server at example.com Port 80</address> </body></html> 这怎么解决?
问题与Apache mod代理,它会停止代理正常重新启动后的请求,但不是所有的时间。 这似乎只发生在周日,当一个平稳的重启被logrotate触发。 [Sun Sep 9 05:25:06 2012] [notice] SIGUSR1 received. Doing graceful restart [Sun Sep 9 05:25:06 2012] [notice] Apache/2.2.22 (Ubuntu) Phusion_Passenger/3.0.11 configured — resuming normal operations [Sun Sep 9 05:25:06 2012] [error] proxy: ap_get_scoreboard_lb(492) failed in child 26153 for worker proxy:reverse [Sun Sep 9 05:25:06 2012] [error] proxy: ap_get_scoreboard_lb(486) failed in child 26153 […]
每次我尝试添加一个额外的后端到我们的VCL文件,它是失败的。 这是我们正在运行的DAEMON_OPTS: DAEMON_OPTS =“ – a:80 \ -T localhost:6082 \ -f /etc/varnish/custom.vcl \ -u varnish -g varnish \ -S / etc / varnish / secret \ -s malloc,10G” 这里是违规的后端(s) 后端b1 {.host =“114.123.456.789”; .port =“8080”; } 后端b2 {.host =“203.123.456.789”; .port =“80”; } 有任何想法吗 ? 直觉可能需要将后端设置在某个地方,但我不确定在哪里。 解决了 所以,事实certificate,我需要在vcl脚本中设置后端,在vcl文件(vcl_recv)中进一步设置。 如果这有助于其他人,这是我复制的代码( https://www.varnish-cache.org/trac/wiki/VCLExampleRestarts ) sub vcl_recv { if (req.restarts == […]
我们为我们的网站启用了SSL,但是现在客户端(Chrome浏览器)报告说内容没有被压缩。 如何检查它是否工作? 如何debugging呢?
我有两个域, mycommunitysite.com和mypersonalblog.com 当我去mypersonalblog.com ,一切正常。 当我去mycommunitysite.com ,它也去到mypersonalblog.com首页。 如果我去mycommunitysite.com/forum ,按预期进入mycommunitysite.com/forum的论坛子目录。 apache中的虚拟主机指令看起来像这样,我的服务器正在运行CentOS,如果这有所作为: NameVirtualHost *:80 <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/mycommunitysite ServerName mycommunitysite.com ServerAlias www.mycommunitysite.com ErrorLog logs/mycommunitysite.com </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/mypersonalblog ServerName mypersonalblog.com ServerAlias www.mypersonalblog.com ErrorLog logs/mypersonalblog.com </VirtualHost> apachectl -S的输出 httpd: Could not reliably determine the server's fully qualified domain name, using 108.166.78.198 for ServerName VirtualHost […]
我们在FreeBSD系统上运行Apache,它有多个Web应用程序(Wordpress,Magento,自定义PHP)。 随着stream量的增加,我们看到越来越多的状态为“lockf”的httpd进程(使用“top”)。 服务器负载增加,直到我们必须重新启动Apache。 据我所知,这个状态Apache等待文件locking。 但是,我们如何才能找出哪些文件被locking/造成瓶颈呢? 没有这些信息,似乎很难解决这个问题。
我用apt-get install apache2安装了apache,然后尝试了wget localhost ,得到: –2012-09-21 23:12:29– http://localhost/ Resolving localhost… 127.0.0.1 Connecting to localhost|127.0.0.1|:80… failed: Connection refused 然后我尝试了/etc/init.d/apache2 status ,果然,apache2没有运行,但是如果我执行了/etc/init.d/apache2 start它仍然不会启动服务。 任何帮助表示赞赏!