Articles of apache 2.4

Debian 8上的Apache 2.4 – SSL_ERROR_RX_RECORD_TOO_LONG

我已经读过这个问题的一般解决方法是添加 NameVirtualHost *:80 和 NameVirtualHost *:443 到虚拟主机。 不过Apache 2.4告诉我: AH00548:NameVirtualHost无效,将在下一版本中删除 我不知道该怎么做: 我的ports.conf: Listen 80 <IfModule ssl_module> Listen 443 </IfModule> <IfModule mod_gnutls.c> Listen 443 </IfModule> 添加 <IfModule mod_ssl.c> Listen 443 </IfModule> 而不是上面的ssl_module部分不会改变一件事情。 我的VirtualHost看起来像 <VirtualHost *:443> ServerAdmin [email protected] ServerName www.example.org DocumentRoot /var/www/htdocs/mw/ … <IfModule mod_ssl.c> SSLEngine on SSLCertificateFile /etc/letsencrypt/live/example.org/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/example.org/privkey.pem SSLCertificateChainFile /etc/letsencrypt/live/example.org/chain.pem SSLProtocol all -SSLv2 -SSLv3 […]

服务器通常是很慢的服务网页,需要很长时间ssh进入

首先,我从来没有一个专业的服务器在国内运行了两年左右,所以请记住,我的问题的原因可以是非常基本的和简单的解决scheme。 我的问题是这样的:我的Ubuntu / Apache2服务器托pipe几个网站,他们的工作,没有错误,但偶尔非常缓慢。 最主要的例子就是一个WordPress站点,在站点本身和pipe理站点上,有时你点击一个类别,得到一个正常的快速响应,有时你点击某个地方(你5分钟前的地方)和负载需要3-15秒。 服务器过去一直很快,现在不是。 服务器没有任何重负载(据我所知),上传和下载速度始终是最大的连接表值。 另一个问题(可能相关)是一个非常缓慢的SSHlogin。 如果我禁用反向DNS查找,这将消失,但我不知道这是否是相关的。 如果我提供指向我服务器上托pipe的特定域的链接,这会有帮助吗? 有没有任何日志/configuration值得发布? 我很高兴发布任何要求。 如果有任何我可以提供的信息,请告诉我。 感谢您提供的任何帮助。 编辑: 粗略的估计似乎有点帮助,当我添加条目到/etc/hosts转发每个根域的Wordpress站点到127.0.0.1,但 它没有解决这个问题,只是使它可能小一点 即使它在其他地方出现问题,也可能是一个粗略的解决方法

使用子域自动设置Apache的虚拟主机

我在这里发布,因为我想自动configurationapache虚拟主机,如a.mydomain.com,b.mydomain.com等…但它不起作用。 我已经build立了一个DNS Wilcardlogging(* 3600 IN A 1.2.3.4)。 并设置我的appache像这样: <VirtualHost *:80> ServerName mydomain.com ServerAdmin [email protected] ServerAlias *.mydomain.com DocumentRoot /var/www DirectoryIndex index.html index.php VirtualDocumentRoot /var/www/vhosts/%1 UseCanonicalName Off <Directory /var/www/vhosts> DirectoryIndex index.html index.php Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny Allow from all </Directory> # Custom Errors ErrorDocument 404 /errors/404/index.html RewriteEngine on RewriteCond /var/www/vhosts/%1 -d RewriteRule ^(.*) […]

运行一个Python脚本,用cgi和apache2 2.4版本将文件保存到服务器

我有一个位于/ var / www / html / Python文件夹中的python脚本(python.py)。 该脚本将一些图像保存到另一个目录(/ var / www / html / Data) 我对python.py脚本具有-x文件权限,并且在保存输出的文件上对所有文件具有-rw权限。 我正在运行apache2版本2.4 这就是我的apache2.conf文件的样子: Mutex file:${APACHE_LOCK_DIR} default PidFile ${APACHE_PID_FILE} Timeout 300 KeepAlive On MaxKeepAliveRequests 100 KeepAliveTimeout 5 User ${APACHE_RUN_USER} Group ${APACHE_RUN_GROUP} HostnameLookups Off LogLevel warn IncludeOptional mods-enabled/*.load IncludeOptional mods-enabled/*.conf Include ports.conf <Directory /> Options FollowSymLinks AllowOverride None Require all denied […]

获取python cgi脚本的权限被拒绝

我想运行一个python脚本,它会产生graphics并将它们保存到一个文件夹中。 我在Ubuntu上运行apache 2.4,我的脚本在命令行上工作正常。 CGI模块已启用。 我已经为脚本运行了“全部”的权限,并将下面的代码添加到了我的apache2.config文件中: <Directory "/var/www/html/Python"> Options +ExecCGI AddHandler cgi-script .cgi .pl .py Require all granted </Directory> 根据我在网上阅读的东西,这应该工作,但错误日志说,权限被拒绝。 我错过了什么?

Apache:“黑暗networking”上的中级CA(无法访问Internet)

背景:Apache 2.4(服务器)和Windows 7 Internet Explorer(客户端)使用PKI; 两台机器都处于“黑暗networking”(没有互联网接入)。 问题:在SSL握手中,客户如何接收中间CA? 它不能使用Apache提供的吗? 我的尝试: Apache服务(1)服务器证书,(2)中间CA,(3)根CA到客户端 客户尝试通过互联网validation链,失败,本地检查 故障排除:我已经运行了Fiddler和netsh跟踪,客户端尝试 – 虽然明显失败 – 联系中间CA权限。 最终,SSL连接成功。 我试图了解客户端如何validation中间的CA没有互联网访问,没有本地保存的证书。

如何在apache中使用mod_rewrite作为其他应用程序

我对apache不是很有经验,但是我已经成功地在我的testing框上运行了以下几个月的设置: me@mydev:/etc/apache2/sites-enabled$ vim 000-default.conf <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> 所以基本上,任何时候我在/ var / www / html下创build一个新的文件夹,它都可以在我的浏览器中使用。 但是现在我想尝试做下面的事情: 我创build了一个新的应用程序,具有以下结构: /var/www/html/testrestapp/src/public/index.php 它的工作原理,但我必须导航到: http://localhost/testrestapp/src/public/index.php/hello/sometestname 然后应用程序返回“sometestname” 但我想知道如何configurationApache,以便我可以这样导航: http://localhost/testrestapp/hello/sometestname 并得到相同的结果。 这是我如何修改我的000-default.conf文件(这是启用站点的文件夹中的唯一文件,btw): <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined <Directory "/var/www/html/testrestapp/"> RewriteEngine on RewriteBase /testrestapp/ RewriteRule ^src/public/index.php/hello$ hello/ [R] </Directory> </VirtualHost> […]

HTTP / 2和SPDY在Apache中一起运行

我安装了最新的Apache,目前支持HTTP / 2。 我可以设置SPDY并与HTTP / 2一起运行吗? 我们的目标是利用不支持HTTP / 2的浏览器的SPDY。 谢谢。

Vagrant,Apache和FastCGI使用巨大的CPU

我真的不明白为什么这么慢。 网站加载非常缓慢。 和vboxheadless命中超过100%CPU每个请求。 我使用2048内存和1个CPU。 这里是活动监视器和顶部: http : //imgur.com/a/j4kqA 这是我的/var/log/error.log: [Mon Apr 25 09:47:45.572752 2016] [mpm_prefork:notice] [pid 20447] AH00169: caught SIGTERM, shutting down [Mon Apr 25 09:47:46.617995 2016] [mpm_worker:notice] [pid 16841:tid 140284476835712] AH00292: Apache/2.4.7 (Ubuntu) mod_fastcgi/mod_fastcgi-SNAP-0910052141 c$ [Mon Apr 25 09:47:46.618120 2016] [core:notice] [pid 16841:tid 140284476835712] AH00094: Command line: '/usr/sbin/apache2' [Mon Apr 25 09:47:46.618358 2016] [:notice] […]

Apache LDAP(Active Directory)不起作用

我在Apache和LDAP方面取得了一些成功。 首先,它正在工作,但不完全。 所以,一个基本的LDAPconfiguration,看起来像这样: AuthLDAPBindDN "omitting this" AuthLDAPBindPassword "passwordyeah!" AuthLDAPURL "ldap://DOMAIN.COM/ou=stuff,dc=domain,dc=com?userPrincipalName?sub?(objectClass=user)" LDAPReferrals Off AuthType Basic AuthName "Use your email address to connect." AuthBasicProvider ldap AuthUserFile /dev/null 这其实很好。 这里是奇怪的地方。 如果我把这个: Require user [email protected] 我可以authentication。 我可以使用多个用户,这很好。 如果我放 Require valid-user 身份validation不起作用。 如果我尝试域用户,我会遇到失败。 (所有用户都是其中一员) Require ldap-group CN=Domain Users,CN=Users,DC=DOMAIN,DC=COM 但是,如果我指的是一个较小的团体,那么它是有效的。 所以,当我只需要用户[email protected]进行身份validation时,我看到: AH01697: auth_ldap authenticate: accepting [email protected] 当我把“要求有效的用户”我得到完全相同的消息。 但是,validation对话框反复出现。 每次authentication成功(根据日志) 为了日志的目的。 当我需要LDAP“域用户”我在日志中得到这个: […]