Articles of httpd

在Azure Linux上定义虚拟主机

我正在使用Azure Linux(Ubuntu 14.04),我需要按照以下方式定义两个VirtualHost。 但是,我看不到任何httpd文件夹。 我在哪里可以做到? <VirtualHost app1.example.com:80> ServerName app1.example.com DocumentRoot /var/www/sites/app1 ProxyPreserveHost On <Proxy *> Order allow,deny Allow from all </Proxy> ProxyPass / http://localhost:3000/ ProxyPassReverse / http://localhost:3000/ </VirtualHost> <VirtualHost app2.example.com:80> ServerName app2.example.com DocumentRoot /var/www/sites/app2 ProxyPreserveHost On <Proxy *> Order allow,deny Allow from all </Proxy> ProxyPass / http://localhost:3000/ ProxyPassReverse / http://localhost:3000/ </VirtualHost>

在httpd.conf文件阻止规则中允许域

我有一个httpd.conf的“规则”来popup一个窗口,如果有人试图访问wordpress安装的任何域的wp-admin部分。 有了这个规则,我阻止了访问wp-admin文件夹的引导,并阻止暴力攻击。 # BEGIN BLOCK-WP-ADMIN-ATTACK <Files wp-login.php> AuthType basic AuthName "EN: Human Check – U: human P: letmein" AuthBasicProvider file AuthUserFile /home/wp-admin-attack-htpasswd-file Require valid-user ErrorDocument 401 "<center><h1>Warning!</h1>You failed to authenticate.<p><br />Extra security has been temporarily enabled due to an ongoing attack against WordPress logins on this server.<br /> <b>If you are a real user, please […]

使用mod_proxy隐藏原始URL

我已成功地使用ProxyPass和ProxyPassReverse来反向代理在Tomcat服务器下运行的应用程序。 然而,挑战是我想使用一个假的URL来完全混淆原始应用程序的path。 假设我的Apache服务器正在侦听端口9999,原始应用程序的内部path是192.168.1.55:8080/myapp。 目前,我使用ApacheIP:9999 / myapp ,它工作得很好。 当我尝试使用伪造的“别名”,例如从myapp到business ,Apache返回一个HTTP错误代码(404)。 这是我的httpd.conf的一个非常简短的摘录: ProxyPass /myapp http://192.168.1.55:8080/myapp Keepalive=On timeout=600 ProxyPassReverse /myapp http://192.168.1.55:8080/myapp

防止apache启动的ssl错误

今天,我在生产服务器上安装了monit,因为mysqld会周期性地崩溃。 几个小时后,monit试图重新启动apache,但失败了,我无法手动启动它。 错误是: [error] Unable to configure verify locations for client authentication [Sat Dec 12 05:32:49 2015] [error] SSL Library Error: 151441510 error:0906D066:PEM routines:PEM_read_bio:bad end line [Sat Dec 12 05:32:49 2015] [error] SSL Library Error: 185090057 error:0B084009:x509 certificate routines:X509_load_cert_crl_file:PEM lib 对文件date的检查显示,没有一个证书文件突然被破坏(所有的date都在一个月前),也没有/etc/httpd/conf.d/ssl.conf 我想我一个星期前成功地重启了apache。 什么是最好的方式再次获得网站(有或没有SSL) Mysql版本 – 5.5.46 CentOS版本 – 6.7 Apache版本 – 2.2.15

哪个configuration值是apache加载?

在启动新服务器后,我今天遇到了一些麻烦。 我做了以下几点: 安装了CentOS 7 安装了Apache + PHP 使用SSL保护我的服务器(letsencrypt) 但是当我用SSL-Test(ssllabs.com)检查我的configuration时,我得到了一个C级。 这是因为我仍然启用了SSLv3。 有线。 我已经在letsencryptconfiguration文件中禁用了它。 但一段时间后,我发现,还有另一个SSLconfiguration文件。 在默认情况下,SSLv3没有被禁用,并且Apache加载了这个值。 我的问题是我有2个文件: /etc/letsencrypt/options-ssl-apache.conf :让我们对每个虚拟主机定义中包含的configuration文件进行encryption。 /etc/httpd/conf.d/ssl.conf :“标准”SSLconfiguration文件。 在“标准”configuration中禁用SSLv3后,我获得了A +评分。 看起来,Apache从第二个文件中抓取了“SSLProtocol”定义,但从第一个文件中抓取了所有其他选项。 我怎样才能确定,Apache正在加载哪个值,从哪个文件?

Webserver运行速度非常慢

我将尝试将所有相关信息发布到我的问题,所以我不会downvoted。 任何帮助/指导将不胜感激。 2天前,我的网站: http : //ianon.info,http : //ianon.info/pet_support/login2b.php 开始运行非常缓慢。 我有我的虚拟专用服务器上安装的Apache,它是CENTOS。 我甚至不知道如何开始解决我的网站缓慢。 我知道这不仅仅是一个PHP的问题,因为服务器上的HTML网站需要很长的时间来加载。 我重新启动了我的Apache几次,它仍然运行非常缓慢。 当我平了,我得到: 64 bytes from ip-50-62-78-126.ip.secureserver.net (50.62.78.126): icmp_seq=1 ttl=64 time=0.025 ms 64 bytes from ip-50-62-78-126.ip.secureserver.net (50.62.78.126): icmp_seq=2 ttl=64 time=0.028 ms 64 bytes from ip-50-62-78-126.ip.secureserver.net (50.62.78.126): icmp_seq=3 ttl=64 time=0.031 ms 64 bytes from ip-50-62-78-126.ip.secureserver.net (50.62.78.126): icmp_seq=4 ttl=64 time=0.038 ms 当我traceroute我得到: traceroute to ianon.info (50.62.78.126), […]

子域错误:无法find服务器的DNS地址

我试图添加子域到我的域名。 我刚刚在我干净的centos 7上安装了httpd。起初,我使用以下内容创build了文件/etc/httpd/conf.d/htmltest.mydomain.com.conf: <VirtualHost *:80> # Admin email, Server Name (domain name), and any aliases ServerAdmin [email protected] ServerName htmltest.mydomain.com DirectoryIndex index.html index.php DocumentRoot /www/sites/htmltest.mydomain.com/htdocs # Log file locations LogLevel warn ErrorLog /www/sites/htmltest.mydomain.com/log/error.log CustomLog /www/sites/htmltest.mydomain.com/log/access.log combined </VirtualHost> <Directory "/www/sites/htmltest.mydomain.com/htdocs"> Options Indexes FollowSymlinks AllowOverride None Require all granted </Directory> 另外/www/sites/htmltest.mydomain.com/htdocs文件夹是用index.html文件创build的。 有了这个configuration,我尝试访问htmltest.mydomain.com在浏览器中给出'服务器DNS地址无法find'的错误。 但是,mydomain.com会打开htmltest子域index.html。 在我的托pipeCP DNS设置有mydomain.com与htmltest'A'logging指向服务器IP,以及WWWlogging。 我怎样才能解决这个问题? UPD:我已经改变域使用vultr nameservers,它现在正常工作。

一个站点处理https请求,没有正确的ssl,其他生成\ x16 \ x03 \ x01错误

我们有两个站点,sub.example1.com和example2.com。 两者都不是专门configuration来处理SSL请求。 一个站点https:/sub.example1.com通过处理作为http请求来成功处理到端口443的安全请求。 对其他站点https://example2.com的安全请求超时并在Apache日志中logging“\ x16 \ x03 \ x01”错误。 这里是/ etc / httpd / sites-enabled / ServerAdmin webmaster @ localhost ServerName sub.example1.com DocumentRoot /opt/example1/web/ DirectoryIndex index.php index.html <Directory /> Options FollowSymLinks AllowOverride All </Directory> <Directory /opt/example/web/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all # This directive allows us to have apache2's […]

AH00027:从Apache 2.2升级到2.4后没有validation完成错误

我最近更新在OS OS 7上的Apache从2.2到2.4,更新后,我无法访问根文件夹, 我得到以下错误: [Fri Apr 29 16:30:19.977037 2016] [core:error] [pid 32095] [client 10.211.55.1:44429] AH00027: No authentication done but request not allowed without authentication for /. Authentication not configured? 正如在授权部分中提到的,您仍然可以使用旧指令Order,Allow,Deny和Satisfy通过加载模块(我明显加载): LoadModule access_compat_module modules/mod_access_compat.so 我的目录指令如下: <Directory /> Options FollowSymLinks AllowOverride All </Directory> 我不确定这个问题会是什么,我真的很感谢这里的一些帮助。

如何将请求从Apache转移到多个服务器端口(Zope 8080,Tomcat 8081等)?

您好,我在同一台机器上运行多个应用程序,如使用ZOPE应用程序服务器在端口8080上运行的Plone和Tomcat托pipe多个Web应用程序并在端口8081上运行。 我想将所有传入的stream量从运行在端口80上的apache服务器redirect到这些服务器上,这样外部世界将只能看到apache的默认端口80.我尝试了许多configuration来做同样的事情,但是没有一个似乎在为两个服务器,但是,如果我正在configuration其工作完美无瑕。 所以,只有一个configuration正在使用,另一个没有效果。 我的configuration看起来像: Pastebin Link 我也尝试了以下configuration: <VirtualHost *:80> ServerName web.url.in ProxyPreserveHost On ProxyPass /MNCD2016 http://web.url.in:8081/MNCD2016 ProxyPassReverse /MNCD2016 http://web.url.in:8081/MNCD2016 RewriteEngine on RewriteRule ^/$ http://web.url.in/MNCD2016 </VirtualHost> <VirtualHost *:80> ServerName web.url.in ProxyPreserveHost On ProxyPass / http://web.url.in:8080/ ProxyPassReverse / http://web.url.in:8080/ RewriteEngine on RewriteRule ^/$ http://web.url.in/ckpw </VirtualHost> 问题是configuration只适用于任何一个端口而不是两个端口。 例如,如果Plone重写规则在上面,它将优先,其他tomcatconfiguration将不起作用。 单独他们工作顺利。 我怎样才能使他们同时工作的两个服务器(Zope,Tomcat)可能在未来甚至更多。 所以,我可以将所有传入的请求从Apache转移到这些服务器,外部世界应该只看到前面的Apache而不是这些服务器。 这是我为Ploneconfiguration所遵循的链接 。