Articles of apache 2.4

获取HTTP / 2在Apache上工作

我现在更像是一个nginx头(我没有任何问题让HTTP / 2能够正常工作),但是我完全被Apache搞糊涂了,似乎无法让它通过HTTP / 2服务于一个站点。 服务器是Debian 8.我已经安装了Apache 2.4.27和openssl1.1.0f,启用了Debian的“testing”回购。 这里有一些有用的信息和服务器configuration: Apache版本 root@server:~# apachectl -V Server version: Apache/2.4.27 (Debian) Server built: 2017-07-16T21:01:10 Server's Module Magic Number: 20120211:68 Server loaded: APR 1.5.1, APR-UTIL 1.5.4 Compiled using: APR 1.5.2, APR-UTIL 1.5.4 Architecture: 64-bit Server MPM: prefork threaded: no forked: yes (variable process count) Server compiled with…. -D APR_HAS_SENDFILE -D […]

无法使用Vagrant转发服务器上的端口

我已经在开发服务器上安装了Vagrant,我已经用wget和curltesting了它,从物理服务器(主机)访问VM(guest)。 我想通过端口80将主机的stream量转发给访客的服务器。 我在configuration文件Vagrantfile添加了一行: config.vm.network "forwarded_port", guest: 80, host: 80 当我做一个vagrant up ,它显示了在VM初始化日志的输出消息中成功的端口转发,如下所示: homestead-7: 80 (guest) => 80 (host) (adapter 1) 当我做一个netstat -an | grep 80 netstat -an | grep 80 ,我只看到…0.0.0.0:8000…这是什么stream氓做自动。 任何build议如何强制服务器打开访客虚拟机端口? (HOST上的Apache被禁用)

让SSI的`exec`与apache一起工作

所以我有一个apache-2.4.25(在Debian / stretch中打包),并且想要使用SSI的exec方法。 <!–#exec cmd="ls" –> 不幸的是,这给了我一个错误: [an error occurred while processing this directive] 在它所说的日志文件中 unknown directive "exec" in parsed doc /path/to/some/user/public_html/ssitest/index.shtml 我追踪到在我的userdir.conf (禁用SSI的exec指令)中启用了Options +IncludesNOEXEC 。 所以我试着把这个选项closures一个特定的VHost,把以下内容放到VirtualHost部分: Options -IncludesNOEXEC Options +Includes 不幸的是,这并没有帮助。 所以我尝试在Directory部分,但仍然没有运气: Alias /ssitest/ /path/to/some/user/public_html/ssitest/ Options -IncludesNOEXEC Options +Includes <Directory /path/to/some/user/public_html/ssitest/> Options -IncludesNOEXEC Options +Includes </Directory> 每当我尝试访问我的页面时,遇到处理此指令错误时发生的错误。 那么有没有办法来禁用以前设置的选项?

迁移服务器后SSL_ERROR_RX_RECORD_TOO_LONG

我有一个OVH VPS(debian,apache,SSL)完整的function网站。 我试图将它迁移到一个等高线VPS。 我更改了DNS条目,我复制了Apacheconfiguration文件和证书文件,但它没有工作。 然后我尝试使用letsencrypt生成一个新证书,但是当我尝试通过https连接我的网站时,仍然收到SSL_ERROR_RX_RECORD_TOO_LONG。 这是我的apacheconfiguration文件: Listen 80 Listen 443 https <VirtualHost mydomain.fr:80> ServerName mydomain.fr DocumentRoot /var/www/html </VirtualHost> <IfModule mod_ssl.c> <VirtualHost mydomain.fr:443> ServerName mydomain.fr DocumentRoot /var/www/html SSLCertificateFile /etc/letsencrypt/live/mydomain.fr/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/mydomain.fr/privkey.pem Include /etc/letsencrypt/options-ssl-apache.conf </VirtualHost> </IfModule> 奇怪的是,certbot脚本返回成功,但ssllabs.com网站诊断问题。 certbot certonly -d mydomain.fr 给我 Renewing an existing certificate Performing the following challenges: tls-sni-01 challenge for mydomain.fr Waiting for verification… […]

如何将所有通配符子域redirect到特定的子域? 与运行下一个云服务器的子域有问题

我想要像x.example.com , y.example.com等不存在的通配符子域名redirect到404.example.com 。 我正在使用Apache 2.4。 我怎样才能做到这一点? 我试过的: 我的404.conf: <VirtualHost *:80> ServerName 404.example.com ServerAlias *.example.com ServerAdmin webmaster@localhost DocumentRoot "/var/web/404" ErrorLog ${APACHE_LOG_DIR}/404-error.log CustomLog ${APACHE_LOG_DIR}/404-access.log combined </VirtualHost> <VirtualHost *:443> ServerName 404.example.com ServerAlias *.example.com ServerAdmin webmaster@localhost DocumentRoot "/var/web/404" ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined SSLCertificateFile /fullchain.pem SSLCertificateKeyFile /privkey.pem </VirtualHost> <Directory "/var/web/404"> Options FollowSymlinks ExecCGI AllowOverride None Require all granted […]

证书链(自签名根CA)

我正在为内部使用创build一个自签名的根CA,我决定使用中间证书。 但是,我遇到了Chromium和Firefox 54.0不相信证书链的问题。 内容通过Ubuntu 16.04上的Apache 2.4.18进行托pipe,具有以下configuration: <VirtualHost *:443> DocumentRoot /var/www/html/ SSLCertificateFile /etc/apache2/ssl/server.crt SSLCertificateKeyFile /etc/apache2/ssl/server.key SSLCertificateChainFile /etc/apache2/ssl/fullchain.crt </VirtualHost> Chromium正在报告“网站证书链存在问题”,以及Firefox“错误代码:SEC_ERROR_CA_CERT_INVALID”。 Chromium和Firefox都将Root CA安装在其信任存储中,作为validation网站的可信证书。 以下是用于生成,签名和validation证书的设置 #Generate and self-sign the Root CA #=========================================================== openssl genrsa -out ca.key 2048 #openssl genrsa -aes256 -out ca.key 4096 openssl req -new -x509 -days 3650 -key ca.key -subj "/C=UK/ST=London/L=/O=SWS, Inc./CN=X1 SWS Root CA" -out ca.crt […]

Apache代理“404未find”

我想使用Apache代理路由子域到不同的端口。 我正在使用这个configuration: <VirtualHost *:80> ServerName test.domain.com ProxyPass / http://localhost:20003/ ProxyPassReverse / http://localhost:20003/ ProxyRequests Off <Proxy http://localhost:20003/> Order deny,allow Allow from all </Proxy> </VirtualHost> 代理模块已启用。 当我重新启动Apache并尝试访问该网站时,显示一个错误: 未find 在此服务器上找不到请求的URL /。 Apache正在运行。 我究竟做错了什么 ??

Apache ProxyPass到socket.io有加载问题

我有一个服务于PHP网站的networking服务器。 这个服务器有一个socket.io服务器。 Apacheconfiguration为代理通过socket.io请求到端口8000上运行的节点服务器。一切工作正常。 但在过去几天,服务器负载超过100,但CPU,内存和磁盘利用率非常低。 当有良好的stream量时,apache进程数量不断增加,负载也随之增加。 我怀疑,Apache处理不断等待的东西。 stace输出有这样的: read(22, 0x7f024a144048, 8000) = -1 EAGAIN (Resource temporarily unavailable) lsof -p xxxx | grep 22的输出显示了这个: apache2 20687 www-data 22u IPv4 2406045 0t0 TCP PROD2:59319->PROD2:http-alt (ESTABLISHED) Apacheconfiguration: <VirtualHost *:443> ServerAdmin xxxx ServerName xxxx ServerAlias xxxx DocumentRoot /var/www/html SSLEngine on SSLProxyEngine On SSLCertificateFile /etc/xxxx/a32d505bae7b7403.crt SSLCertificateKeyFile /etc/xxxx/xxxx.key SSLCertificateChainFile /etc/xxxx/gd_bundle-g2-g1.crt ErrorLog ${APACHE_LOG_DIR}/error.log […]

通过apache慢winbind身份validation

我有一个Linux机器设置来使用Active Directory与samba / winbind进行身份validation用户。 然后设置Apache来使用它来authentication用户。 这是通过使用: <IfModule mod_authnz_external.c> AddExternalAuth pwauth /usr/sbin/pwauth SetExternalAuthMethod pwauth pipe </IfModule> 但是没有authentication的页面请求less于1秒现在需要> 6秒。 查看/var/log/samba/log.winbindd中的日志不会显示任何错误,但每个页面加载似乎都需要大量的身份validation请求。 基本上似乎有一个身份validation每个资源加载,例如对于每个CSS文件。 在/etc/samba/smb.conf我试图玩一些设置,如winbind cache time = 300和winbind offline logon = yes 。 我也尝试将idmap后端从tdb更改为ad。 在页面加载期间,winbindd的CPU使用率非常高,〜50-60%,而其他进程似乎没有超过10-20%。 我错过了一些可以加快速度的configuration,还是有更好的办法来解决这个问题(比如使用mod_authnz_external之外的东西)?

过多的时间到第一个字节

我的网站正受到恶意的botstream量的攻击,我一直试图在过去一周内干扰。 它出现在我的'other_vhost_access.log'中: www.mywebsite.com:80 217.96.40.85 – – [01/Sep/2017:12:21:08 +0000] "HEAD http://xxx.xxx.xxx.xxx:80/phpmyadmin/ HTTP/1.1" 302 237 "-" "Mozilla/5.0 Jorgee ” 和: www.mywebsite.com:80 173.208.148.218 – – [31/Aug/2017:09:32:10 +0000] "POST /FlashChat/upload.php HTTP/1.1" 302 523 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)" www.mywebsite.com:80 173.208.148.218 – – [31/Aug/2017:09:32:11 +0000] "GET /FlashChat/temp/error.php HTTP/1.1" 302 531 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows […]