Articles of apache 2.2

Nginx / Apache:只有当X-Forwarded-Proto是https时才设置HSTS

我得到了以下设置: Internet => nginx[public:80 +443, SSL termination) => Varnish[localhost:81] => Apache[localhost:82] 现在有些网站只能通过HTTPS和有效的SSL证书进行访问。 对于这几个例外,我想激活HSTS,无论是nginx(首选,或在Apache)。 问题: 在nginx上, if Host = foo.tld则需要一些逻辑,然后设置Strict-Transport-Security xxx ,但根据http://wiki.nginx.org/IfIsEvil, if在某个location 在Apache上,我需要类似于if X-Forwarded-Proto 443 set Strict-Transport-Security xxx ,但我似乎不能用SetEnvIf (Apache 2.2) 我的逻辑是否有缺陷? 另一种方法的想法? 这是当前活动的configuration: nginx的 服务器{ server_tokensclosures; 听xx.xx.xxx.xxx:80; server_name localhost; 位置 / { proxy_pass http://127.0.0.1:81; proxy_set_header X-Real-IP $ remote_addr; proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto […]

Apache Kerberos身份validation到Active Directory不会发生。 (与KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN有关吗?)

我的目标是使用Kerberos对Apache进行身份validation,而不用提示用户名和密码。 它目前总是显示“401未经授权”,并且似乎没有尝试Kerberos。 我找不到任何错误日志,只能find一个显然不起作用的kinit命令,并给出错误 – WireShark中显示的错误为: Linux sends AS-REQ Windows replies KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN 线索还是红鲱鱼? 设置/背景细节 Windows Server 2008 R2 SP1, with Active Directory ("winserver"). CentOS 6.5 ("centos"). configuration主机名和DNS,并在Windows DNS服务器中添加A和PTR条目。 名称parsing显示正常。 使用authconfig-tui创build/etc/krb5.conf和/etc/samba/smb.conf并调整它们。 的krb5.conf `/etc/krb5.conf` [libdefaults] default_realm = SITE.EXAMPLE.COM dns_lookup_realm = false dns_lookup_kdc = false ticket_lifetime = 24h renew_lifetime = 7d forwardable = true [realms] SITE.EXAMPLE.COM = { kdc […]

Apache和MySQL的HAProxy平衡algorithm

就在最近,我对现有的使用Apache Web服务器和MySQL数据库的项目负责。 Web服务器位于HAProxy负载平衡器的后面,应用程序通过另一个HAProxy连接到MySQL从站。 10个networking服务器中的2个是最近添加的,比旧的更强大。 对于MySQL从站也是一样的:这5个从站中有2个有更多的RAM和CPU。 Apache服务器的平衡algorithm是最不安全的 ,而从服务器的平衡algorithm是源代码 。 至lessMySQL服务器的设置我觉得很奇怪,因为在最糟糕的情况下,“最好”的Apache(最重)总能挑选最差劲的MySQL服务器,如果我理解了HAProxy文档的话 。 我会select调整重量的roundrobin : 10个为三个普通的MySQL服务器 20为更强大的MySQL服务器 而且因为在20秒的超时时间后面的HAProxy,我宁愿使用roundrobin 。 10为八个正常的Apache服务器 20为更强大的Apache服务器 (我会用20来开始,我要去看监控,稍后会调整。) 因为这些服务器在主机托pipe(如:我没有root权限,更改请求需要一些时间),我只想对这个主题有第二个(或更多)的意见:改变平衡是一个好主意algorithm都为了循环 ? 如果最近没有任何性能问题,我不会考虑这个,这只是我觉得值得调整的一个地方。 感谢您的任何build议! 问候丹尼斯

了解Apache扩展服务器状态的CPU%

我刚刚将现有的相当高stream量的网站迁移到数字海洋水滴,我查看了Apache扩展服务器状态页面。 它显示下面的信息。 我注意到的一件事是CPU被列在269%的负载。 怎么可能? 这是好还是坏? 我怎样才能解释这些数字? Apache Server Status for xx.xx.xxx Server Version: Apache/2.2.15 (Unix) DAV/2 PHP/5.4.40 mod_ssl/2.2.15 OpenSSL/1.0.1e-fips Server Built: Oct 16 2014 14:48:21 Current Time: Tuesday, 19-May-2015 04:11:17 EDT Restart Time: Tuesday, 19-May-2015 04:06:06 EDT Parent Server Generation: 0 Server uptime: 5 minutes 10 seconds Total accesses: 1139 – Total Traffic: 280.7 MB […]

networking服务器SSD升级:会不会部分FS切换呢?

我们有一个Hetzner的专用服务器。 一旦我们的电子商务实例达到了超过350个并发用户的峰值,我们正在经历一些减速,并决定将内存从16GB升级到32GB,另外还为我们的3TB SATA驱动器添加了240GB SSD驱动器。 将整个系统切换到SSD是相当有问题的,所以我有一个问题,希望你会明白: 我可以将/ var文件夹移动到SSD驱动器。 我们所有的虚拟主机Web数据存储在/ var / www。 这会提高性能吗? 或者其他一些重要的系统元素也应该切换到SSD? 据我所知,SSD的好处是更快,同时读写。 我会通过确保更快地读取/写入我们的Web数据来获得好处吗? 期待很快可以收到你的来信。 谢谢你的帮助

Apache虚拟主机(Ubuntu)的错误文档根

我试图设置一个Apache服务器与几个虚拟主机(www.domain.com&store.domain.com),但由于某种原因,当我刚刚启用它们之一(store.domain.com)Apacheredirect到错误的文档根目录(/ var / www),这显然是默认的。 这是没有正确redirect的虚拟主机configuration文件: <VirtualHost *:80> ServerName store.domain.com ServerAdmin [email protected] DocumentRoot /var/www/store/public_html/ ErrorLog /var/www/store/logs/error.log CustomLog /var/www/store/logs/access.log combined </VirtualHost> 当我运行命令apache2ctl -S我得到以下内容: Name or service not known: AH00547: Could not resolve host name *80 –ignoring! AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using xxx.xxx.xxx.xxx. Set the 'ServerName' directive globally to suppress […]

Apache 2.2,通过ip.ip.ip.ip /文件夹将localhost:3000上的服务器暴露给外部

期望: localhost:3000在ip.ip.ip.ip/folder 现实: ip.ip.ip.ip/folder打开,但包含ip.ip.ip.ip/css/style.css和JS等链接。 目标:(apache conf?)以这样的方式重写所有的链接: ip.ip.ip.ip/folder/css/style.css和JS等等。 它似乎应该作为localhost:3000不使用亲属的URL,但不知道它不。 我不理解什么,我该如何解决? 现场: <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> RewriteEngine […]

503虚拟主机上的错误

我在ubuntu的apache服务器上用下面的代码创build了一个虚拟主机 cd /var/www/ sudo mkdir fd-pro sudo mkdir /var/www/fd-pro/ch-api sudo mkdir /var/www/fd-pro/ch-api/public_html sudo chown -R $USER:$USER /var/www/fd-pro/ch-api/public_html sudo chmod -R 755 /var/www/* nano /var/www/fd-pro/ch-api/public_html/index.html 并创build了index.html 然后 sudo nano /etc/apache2/sites-available/domain.mydomain.com.au.conf <VirtualHost *:80> DocumentRoot /var/www/fd-pro/ch-api/public_html ServerName domain.mydomain.com.au ServerAlias domain.mydomain.com.au <Directory /var/www/fd-pro/ch-api/public_html> AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/domain-error.log LogLevel warn CustomLog ${APACHE_LOG_DIR}/domain-access.log combined </VirtualHost> sudo a2ensite […]

如何检查Apache 2.2中是否存在指令

我正在尝试编辑一个configuration文件,以便在Apache 2.2和Apache 2.4上同时运行。 该文件最初是为Apache 2.2编写的,包含以下configuration: RewriteLogLevel 3 RewriteLog /var/log/httpd/apache_rewrite_log 但是,Apache 2.4不再支持RewriteLogLevel 。 相反,在这种情况下,我需要使用: LogLevel alert rewrite:trace6 基本上我想要做的是: <IfDirective LogLevel> LogLevel alert rewrite:trace6 </IfDirective> <IfDirective RewriteLog> RewriteLogLevel 3 RewriteLog /var/log/httpd/apache_rewrite_log </IfDirective> 但是, IfDirective在Apache中似乎并不是什么东西。

推荐的方式来pipe理Apache Web服务器

我负责将一大堆(20个左右)的网站迁移,其中一些使用SSL证书,一些使用数据库,从旧服务器迁移到新服务器。 有问题的服务器是专用的托pipeLinux机器(旧的是RedHat,新的是CentOS),并且都只安装了Webmin。 我想尝试去除a)迁移站点和b)设置新站点或更改设置的任务。 我想知道是否值得设置cPanel或类似的帮助抽象的工作远离壳(less手册…),或者也许另一个工具… 有问题的业务不转售给乔公共托pipe,更多只是托pipe网站创build和pipe理的网站,所以网站所有者不一定需要访问更改设置等… 想法,build议?