Articles of apache 2.4

apache 2.4 + php-fpm + mod_proxy_fcgi +别名

我有以下configuration:Apache 2.4,PHP的FPM,mod_proxy_fgci。 问题是我的configuration不能使用别名指令:我已经安装了phpredmin,但别名指令不能与ProxyPass一起使用。 有人能把我推向正确的方向吗? 这是configuration: <VirtualHost *:80> ServerName default # Directory DocumentRoot /var/www/default/wwwroot <Directory /var/www/default/wwwroot> Options +FollowSymLinks +ExecCGI +Includes AllowOverride All Require all granted </Directory> # PHP-FPM Server <LocationMatch "^/(.*\.php(/.*)?)$"> ProxyPass fcgi://127.0.0.1:9000/var/www/default/wwwroot/$1 </LocationMatch> # Directory indexes <IfModule dir_module> DirectoryIndex index.htm index.html index.shtml index.php index.phtml </IfModule> Alias /phpredmin /var/www/default/wwwroot/phpredmin/public <Directory "/var/www/default/wwwroot/phpredmin/"> AllowOverride All require ip 127.0.0.1 […]

Apacheconfiguration中的通配符子域(* .example.com)是否也包含根(example.com)?

在Apacheconfiguration文件(如ServerAlias , RewriteRule ,…)中有什么东西有通配线 *.example.com 还包括根 example.com 还是必须单独添加此条目(如ServerAlias *.example.com example.com )?

htaccess仅在两台服务器中的一台上redirect循环

我有两个服务器上安装的Web应用程序。 在其中一台服务器上,当我访问主页时,在浏览器中出现“错误代码:ERR_TOO_MANY_REDIRECTS”错误,而另一台服务器正常工作。 两台服务器都运行apache 2.4。 Apacheconfiguration的哪一部分与redirect规则有关? 我应该在哪里寻找两种configuration之间的差异? 以防万一,这里是htaccess文件: <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine On # Get rid of index.php RewriteCond %{REQUEST_URI} /index\.php RewriteRule (.*) index.php?rewrite=2 [L,QSA] # Rewrite all directory-looking urls RewriteCond %{REQUEST_URI} /index.php/$ RewriteRule (.*) index.php?rewrite=1 [L,QSA] # Try to route missing files RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} public\/ [OR] RewriteCond %{REQUEST_FILENAME} \.(jpg|gif|png|ico|flv|htm|html|php|css|js)$ RewriteRule . […]

将wwwredirect到非www(apache,letsencrypt)

Ubuntu 14.04 Apache 2.4.18 我已经使用letsencrypt设置了一个SSL证书。 它工作正常,但为了工作,我不能在一个虚拟主机configuration文件中定义多个虚拟主机。 每个虚拟主机必须在/ etc / apache2 / sites-available中的自己的.conf文件中。 我需要确保对www.example.com的所有请求都redirect到example.com。 由于我需要解决它在唯一的虚拟主机文件,我试图包括一个重写规则里面执行redirect,但到目前为止它失败默默地:所有的https://www.example.com请求没有被redirect到https ://example.com,并显示“不安全的网站”警告。 这是domain.com-le-ssl.conf的虚拟主机configuration文件。 <IfModule mod_ssl.c> <VirtualHost *:443> ServerName example.com ServerAlias www.example.com RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.(.+) [NC] RewriteRule ^ https://%1%{REQUEST_URI} [L,R=301] DocumentRoot /home/user_account/www/example.com/public <Directory /home/user_account/www/example.com/public> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/home/user_account/www/example.com/public/$1 SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem Include […]

无法连接到通过端口80运行Apache的服务器

为什么通过浏览器连接到xx.xx.xx.xx会给我一个连接超时? 新的实例,RHEL 7.新鲜的Apache安装。 版本2.4.6 Port 80打开,Apache正在监听 netstat -anp | grep 80 tcp6 0 0 :::80 :::* LISTEN 5651/httpd apache访问日志是空的。 空格错误日志是空的。 curl 127.0.0.1 返回页面。 还有什么可以导致这个? 我应该在哪里看? 从来没有与2.2.x的问题 编辑:更新httpd.conf使用IPV4后: tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 10569/httpd

升级Apache + OpenSSL后重新authentication

这可能是一个noobenstein队长的问题,但我不知道如何谷歌这个问题的答案。 我刚从Apache 2.4.10 w / OpenSSL 1.0.1j升级到Apache 2.4.18 w / OpenSSL 1.0.2e 我是否需要重新生成SSL文件并使用我的证书颁发机构进行重新validation? 如果不是,那为什么? FWIW 我以前的.key和.csr文件是这样创build的: openssl.exe genrsa -out {The_FQDN}.key 2048 openssl.exe req -new -sha256 -key {The_FQDN}.key -out {The_FQDN}.csr

2个IP地址相同的用户超时

我们有两台运行centos7和apache 2.4的服务器,只用于完全内部使用。 当办公室里有两个人当然是同一个IP,通过浏览器(查看报告,testing代码等等)尝试使用服务器时,问题就会随机超时。 他们都完全安装了apache 2.4,只需通过以下方法完成: yum install httpd PHP也安装了,但我也尝试删除PHP的结果相同,所以它似乎孤立的Apache。 两台服务器都是最新的补丁明智的,我不知道还有什么可以尝试找出正在发生的事情。 我还要提到的是,服务器不在办公室,而是在外部托pipe设施。 任何人有任何想法? 谢谢

白屏 – Ubuntu 16.04上的PHP 7无法渲染脚本

我无法在本地主机上运行PHP脚本,浏览器呈现白色屏幕。 如果我查看页面的来源,我可以看到PHP文件的内容。 使用: $ sudo apt-get install libapache2-mod-php7.0 Reading package lists… Done Building dependency tree Reading state information… Done libapache2-mod-php7.0 is already the newest version (7.0.6-6+donate.sury.org~xenial+1). The following packages were automatically installed and are no longer required: libgsoap8 libvncserver1 Use 'sudo apt autoremove' to remove them. 0 to upgrade, 0 to newly install, 0 to […]

AWS WordPress网站 – OOM杀死Apache

这个问题最初是在StackOverflow.com上提出的,我已经将它复制到更合适的ServerFault.com站点。 原来的问题,我已经投票结束,可以在这里find 我有一个AWS上托pipe的小型低stream量WordPress博客。 不幸的是,大约每周一次,该网站变得不可用,试图访问该网站留下用户挂起,直到连接超时。 在这些停机期间,我也无法通过SSH访问服务器,直到服务器重新启动。 它在重新启动实例后总是立即恢复。 AWS EC2日志的最后一行(30,000个字符限制,防止发布所有内容): [1079988.125918] Out of memory: Kill process 32620 (httpd) score 16 or sacrifice child [1079988.130913] Killed process 32620 (httpd) total-vm:510348kB, anon-rss:32328kB, file-rss:0kB [1079996.872570] httpd invoked oom-killer: gfp_mask=0x24280ca, order=0, oom_score_adj=0 [1079996.887776] httpd cpuset=/ mems_allowed=0 [1079996.892671] CPU: 0 PID: 374 Comm: httpd Tainted: GE 4.4.5-15.26.amzn1.x86_64 #1 [1079996.896664] Hardware name: Xen […]

RewriteEngine追加/%25 /到我的目录http-> https

我有我的configuration文件设置如下所示: <VirtualHost *:80> RewriteEngine on RewriteCond %{HTTPS} off RewriteRule (.*) https://example.com/%$1 [R,L] </VirtualHost> <VirtualHost *:443> ServerAdmin webmaster@localhost DocumentRoot /ssd/www/ SSLEngine on SSLCertificateFile /ssd/certs/example_com.crt SSLCertificateKeyFile /ssd/certs/example_com.key SSLCertificateChainFile /ssd/certs/example_com.ca-bundle ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> 问题是,当它redirect时浏览到一个标准的HTTP页面附加/%25/到域,所以例如.. http://example.com更改为https://example.com/%25/更改为https://example.com/%25/my-category/my-page 。