Articles of apache 2.2

mod_pagespeed拒绝刷新caching

我有我的Dreamhost Ubuntu 12.04 VPS上运行的mod_pagespeed。 每当我再次打开mod_pagespeed 时 ,旧的标题显示(顶部黑色栏中的数据被移除)显示在所有页面上,尽pipe新版本已经打​​开了几天,而且我正在运行命令 sudo touch /var/mod_pagespeed/cache.flush 这里的命令和path是由Dreamhostbuild议的,与Google本身的build议一样。 当我closuresmod_pagespeed并重新启动VPS的最新版本返回。 但是我真的很想用mod_pagespeed。 任何想法如何解决这个问题,并得到mod_pagespeed加载正确的内容?

与许多用户和虚拟主机的Logrotate通配符

我正在托pipe多个Apache虚拟主机,具有相似的结构: – /var/www/ – domain – documentroot – logs 我已经修改了logrotate.d/apache2规则 /var/log/apache2/*.log /var/www/*/logs/*.log { … rule details … } 现在的问题,logrotate不允许我轮stream的文件夹,因为他们是由用户和组拥有根据虚拟主机(组通常有多个用户,一个用户等于一个虚拟主机) 错误讯息是 错误:跳过“/var/www/default/logs/access.log”,因为父目录具有不安全的权限(它是世界上可写或不是“root”的组可写)在configuration文件中设置“su”指令告诉logrotate哪用户/组应该用于旋转。 我如何configurationlogrotate从父文件夹使用用户和组? VirtualHosts在MPM-ITK模块下运行,以分离基础apache / php-cgi进程的权限。 是否可以避免分别为每个虚拟主机创buildconfiguration规则?

php-fpm-5.6.2和mod_vhost_alias ProxyPassMatch

我一直在使用PHP和mod_vhost_alias成功的fcgi。 现在用新的服务器,我正在寻找在Apache / 2.4.6 CentOS 7看起来很有趣的php-fpm。php-fpm安装程序工作正常,但与mod_vhost_alias一起,我无法构build适当的ProxyPassMatch规则。 我的mod_vhost_alias设置是VirtualDocumentRoot /var/www/vhosts/%-2.0.%-1.0/%-3+/ 任何想法如何创build任何.php适当的匹配传递到fcgi://127.0.0.1:9000上运行的php-fpm。 无论我做什么我只得到AH01071:有错误'主脚本未知\ n'

将域和子域添加到服务器

问候,请原谅,如果这是一个非常基本的问题。 问题: 目前我已经从Godaddy.com买了一个域名(crazywebsite.com),我在Site5.com有一个非托pipe的VPS。 我在我的Debian机器 Site5.com中build立了一个LAMP栈 (Debian,Apache2,MySQL,PHP Laravel),目前我有我的IP和网站外观,可以像这样访问: 292.168.0.1./website (Just an example IP) 292.168.0.1./forum 问题是: 我如何实现以下目标? crazywebsite.com => 292.168.0.1./website forum.crazywebsite.com => 292.168.0.1./forum 所以当你写下我买的域名时,你会看到网站的内容(当然不是通过IP链接访问它)。 任何想法或链接如何做到这一点? 目前我已经尝试了以下内容: 添加了以下设置: 在/ etc / apache2的/网站可用/默认 至: # website <VirtualHost *:80> ServerName crazywebsite.com ServerAlias crazywebsite.com DocumentRoot /var/www/website </VirtualHost> <VirtualHost *:80> ServerName www.crazywebsite.com ServerAlias www.crazywebsite.com DocumentRoot /var/www/website </VirtualHost> # forum <VirtualHost *:80> ServerName […]

git -http-backend和LDAPauthentication,推送错误:请求的URL返回错误:401授权必需

我的设置 操作系统:debian git:v 1.7.10 apache(与suexec模式启用)configuration与git-http-backend和LDAP授权git回购这适用于克隆操作,但不适用于推,这就是问题。 我使用HTTPS作为我的git服务器的通信协议。 这是我的configuration: VirtualHostconfiguration: <IfModule mod_ssl.c> <VirtualHost _default_:443> DocumentRoot /git/myrepos <Directory "/git/myrepos"> Allow from All Options +ExecCGI AllowOverride All </Directory> ScriptAlias /git /git/myrepos/bin/suexec-wrapper.sh SSLEngine on SSLCertificateFile /etc/ssl/git.crt SSLCertificateKeyFile /etc/ssl/git.key <FilesMatch "\.(cgi|shtml|phtml|php)$"> SSLOptions +StdEnvVars </FilesMatch> <Directory /usr/lib/cgi-bin> SSLOptions +StdEnvVars </Directory> /git/myrepos/bin/suexec-wrapper.sh: #!/bin/bash PATH_INFO=$SCRIPT_URL GIT_PROJECT_ROOT=/git/myrepos REMOTE_USER=$REDIRECT_REMOTE_USER export GIT_HTTP_EXPORT_ALL=true /usr/lib/git-core/git-http-backend 克隆回购的工作,因为它应该(例如git clone https://192.168.0.1/repo1.git )。 […]

Apache CentOS Server非常慢! 错误的configuration?

我在Apacheconfiguration8gb的RAM 1and1.com虚拟服务器上遇到服务器超载的问题。 服务器一旦达到100多个活跃用户(根据谷歌分析)在select时间变得非常缓慢。 我已经完成了包围和loadimpacttesting,并对httpd.conf文件进行了一些configuration更改,但是我不知道是否足够。 也许我只需要更多像16GB的内存或我错过了什么? 我知道我可以优化编程,但我不明白它将如何大幅度提高性能。 有趣的是,在过载期间,并行内存使用率只显示10-20%,但网站太慢了! 帮帮我! Avg. site file size is 1.5MB (We have lots of pictures) Avg. load time: 1.8s (during normal days) – 1,600 page views, 270 highest sessions p/h 这是一个非常缓慢的服务器日的分析统计: Highest sessions per hour: 420 – 700 Total sessions: 4,300 – 37,000 Page views: 25,300 – 361,500 Avg. Session duration: […]

很多apache2进程导致高服务器负载

我注意到,我的网站今天下降,当我进入我的箱子,跑到top ,我注意到,我的服务器负载超高。 我迅速closures了apache并等待直到负载下降,但是一旦我启动apache备份负载并且进程开始非常迅速地爬升。 该网站是一个基本的WordPress博客。 这是top的输出 top – 15:24:50 up 11:19, 1 user, load average: 29.76, 24.04, 19.27 Tasks: 129 total, 33 running, 96 sleeping, 0 stopped, 0 zombie %Cpu(s): 30.5 us, 2.8 sy, 0.0 ni, 0.0 id, 0.0 wa, 0.0 hi, 0.0 si, 66.8 st KiB Mem: 2048448 total, 1092188 used, 956260 free, 162896 buffers […]

Apache为meta-data.xml.md5返回不正确的mimetypes

我努力让apache2提供正确的MIMEtypes的文件。 我在Ubuntu上安装了apt-get安装的apache 2.2。 有问题的文件是一个名为maven-metadata.xml.md5的Maven仓库文件。 由于某种原因apache坚持这是types的Content-Type: application/xml这显然是不正确的,因为该文件的全部内容: 443219553065c4885947185d40d2a04e 我只能假定这个决定是由apache制作的,因为文件名是“xml”,但是在上下文中没有意义。 我已经尝试添加md5到/etc/mime.types作为text/plain但我仍然得到相同的结果。 完整的标题是: HTTP/1.1 200 OK Date: Fri, 19 Dec 2014 22:58:30 GMT Server: Apache/2 Last-Modified: Thu, 18 Dec 2014 14:56:57 GMT ETag: "6e8e3cb-20-50a7ecdb68040" Accept-Ranges: bytes Content-Length: 32 Keep-Alive: timeout=30 Connection: Keep-Alive Content-Type: application/xml 有什么build议么? 编辑我想我可能已经错过了一个明显的步骤,如添加md5到/etc/mime.types后重新启动服务器。

如何在Apache2上只使用SSL保护一个页面?

我的Web服务器托pipe许多页面。 不过,我只需要用SSL保护其中的一个。 我知道如何创build自签名证书以及如何将其安装在Apache2上。 我的问题是完全不同的:因为我的Web服务器托pipe许多页面,我只需要保护其中的一个,我应该configuration什么(以及在哪里和如何)? 谢谢! 我使用的是x86_64 GNU / Linux Ubuntu。

无法configurationMaxMindDB的Apache模块

我最近成功安装了MaxMind的MaxMindDB apache模块。 我添加了一个名为geoip.conf的新文件到/etc/httpd/conf.d/ ,内容如下: <IfModule mod_maxminddb.c> MaxMindDBEnable On MaxMindDBFile COUNTRY_DB /some/dir/GeoLite2-Country.mmdb MaxMindDBEnv MM_COUNTRY COUNTRY_DB/country/iso_code SetEnvIf MM_COUNTRY US AllowUS Deny from all Allow from env=AllowUS </IfModule> 当运行apachectl -t我得到以下错误: Syntax error on line 11 of /etc/httpd/conf.d/geoip.conf: deny not allowed here 当我评论“拒绝所有”行时,我得到了一个类似的错误,说明allow not allowed here 我无法在网上find任何东西,因为这个模块几乎没有文档。 有谁知道如何解决这一问题?