Articles of apache 2.2

apache vhost将所有子域redirect到根(SSL vhosts)

如何将所有子域redirect到根域? 它适用于非SSL域,但不适用于SSL域! 例如 Works! wee.domain.com => https://domain.com www.domain.com => https://domain.com Doesn't work! (no redirecting) https://wee.domain.com => https://domain.com https://www.domain.com => https://domain.com 虚拟主机 <VirtualHost *:80> ServerName domain.com # force https RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,QSA] … </VirtualHost> <VirtualHost *:443> ServerName domain.com SSLEngine on … </VirtualHost> <VirtualHost *:80> ServerAlias *.domain.com RewriteEngine on # Redirect […]

如何在使用apache的托pipe网站的相同物理服务器上设置反向代理?

我如何使用一台服务器来完成以下两项任务: 服务于http://foo.bar.com上的网站 使用反向代理将所有用于http://loremipsum.bar.com的stream量指向“http:// www。acme.com:87 60 / Application”。 该网站已经存在和configuration正确,我只需要添加#2的function。 我怎样才能在同一台物理服务器上做到这一点? 我想象的答案是使用虚拟主机,但我不知道如何在一个物理盒子上做两个。

服务器跑出了HD房间

一个stream氓脚本把我的基于centOS的服务器跪下,导致剩下0个字节的HD房间。 我解决了这个问题,似乎一切正常。 所以我的问题是,我应该怎么做检查/修复损坏的文件系统? 命中0字节是否意味着文件系统损坏? 谢谢你的帮助。

Apache多个ProxyPass 404

我试图在Ubuntu 14.04上通过Apache 2设置代理。 我有两个代理我想要使用。 一个是在本地运行的Ruby瘦服务器。 另一个是电话统计页面。 我已经configuration了一个conf文件,内容如下: <VirtualHost *:80> Redirect permanent / <ssl_site> </VirtualHost> <VirtualHost _default_:443> –snip certificate info– –snip contact info– LogLevel debug –snip log info– ProxyRequests Off ProxyPreserveHost On <Proxy *> Order Allow,Deny Allow from all </Proxy> SSLProxyEngine On <Location /> ProxyPass <Ruby thin server> ProxyPassReverse <Ruby thin server> </Location> <Location /phonestats/> RequestHeader […]

重启专用服务器后无法启动apache

我有一些在专用服务器上运行的网站。 其中一个是我用CodeIgniter编写的,并且已经集成了wordpress。 今晚,这一连串的事件发生了: 由于我的错误,WordPress的自动更新,并重新提出了一个错误(严重),2个月前通过编辑核心修复。 由于这个错误,页面需要几年的时间来加载(因为其中一个数据库表是巨大的) 所以我尝试了一些debugging来重新修复它。 在debugging过程中,我多次打开其中一个页面来testing修复。 突然我无法打开任何网站,因此我认为服务器崩溃了,我认为这是由于这个错误(大部分时间CPU运行在100%)的超载。 我硬重启了服务器。 重新启动99%的时间解决了很多问题,我认为这是一个很好的解决scheme… 重启后,我意识到我无法启动Apache了。 我试图通过SSHlogin(工程),但一旦我尝试通过使用apachectl -k graceful启动apache我得到以下错误: Warning: DocumentRoot [/home/racebook/sd/download/www] does not exist httpd not running, trying to start (98)Address already in use: make_sock: could not bind to address [::]:80 (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable […]

HAProxy后端与TLS停止工作

我遇到了一个使用TLS后端的HAProxy-Server问题。 启动HAProxy时,后端会将所有服务器报告为closures状态: Server web_remote/apache_rem_1 is DOWN, reason: Layer6 invalid response, info: "SSL handshake failure", check duration: 41ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue. 后端的configuration如下: backend web_remote balance leastconn option httpchk HEAD / option redispatch retries 3 default-server inter 5000 rise 2 fall 5 maxconn 10000 […]

SELinux的 – mysql /和httpdoc /在同一个文件夹?

看起来我的老忠实的LAMP目录结构已经与SELinux脱钩。 我更喜欢在同一个地方的一切。 CentOS 6.6 Apache 2.2.15 MySQL 6.5 /DATA/ /DATA/httpdocs/ /DATA/mysql/ /DATA/server-config.php /DATA/httpd-error.logs… 如果我这样做,然后Apache工作正常,但MySQL不会启动。 chcon -R -t httpd_sys_content_t /DATA/ chcon -R -t mysqld_db_t /DATA/mysql chcon -R -t httpd_sys_content_t /DATA/httpdocs 如果我这样做,然后MySQL将启动,但Apache不会启动。 chcon -R -t mysqld_db_t /DATA chcon -R -t mysqld_db_t /DATA/mysql chcon -R -t httpd_sys_content_t /DATA/httpdocs 我知道这是关联到我附加到根/ DATA文件夹的标签,他们不能有两个? 是的,如果我禁用SELinux,所有的问题都会消失,但是这个项目是必需的。 这些文件夹是chown和chmod罚款。 对于mysql的情况下,错误是 2015-04-24 14:17:56 3391 [Warning] Can't […]

当涉及到内存时,如何决定VPS良好的PHP和WordPress的默认值?

我有(只)512MB空余。 在我的VPS上运行的唯一的东西是PHP / MySQL,并在它的顶部的WordPress的。 没有邮件服务器或任何其他应用程序,只是Wordpress和LAMP堆栈。 如何决定给PHP和Wordpress多less内存? 现在PHP可以有128MB,增加多less安全量呢? 我试图谷歌的问题,但从来没有真正find任何答案。

我在哪里可以了解到Apache

我使用Apache Web服务器在Python中进行web开发。 我面对的最大的问题是设置环境。 我无法理解/etc/apache2 and /private/etc/apache2之间的区别。 另外,像/etc/private/apache2/httpd.conf and /etc/private/apache2/original/httpd.conf 。 他们都一样吗? 哪一个改变? 每次我遇到一些设置问题,我都会继续按照用户写的一样白痴的指令。 另外,我不明白apache如何指向自定义目录(哪些文件需要更改),localhost会打开该目录(〜站点)中的文档。 我想学习所有关于Apache环境。 所有目录是什么意思? 哪些是重要的文件,哪些不是? 我去了Apache的文档,但他们非常混乱。 看起来要花费我几年的时间来阅读所有的内容。 任何人都可以帮助我find一个不错的启动文章。 一些教程?

清漆4不caching

我是新的与清漆工作。 我安装了它,我认为我configuration正确。 为了testing这是我做了什么: 我创build了一个只有string“testing”的testing页面。 我去了页面,它有这些标题: Accept-Ranges:bytes Age:0 Cache-Control:max-age=120 Connection:keep-alive Content-Length:6 Content-Type:text/html; charset=UTF-8 Date:Tue, 12 May 2015 19:35:34 GMT Expires:Tue, 12 May 2015 19:37:34 GMT Server:Apache/2.2.15 (CentOS) Via:1.1 varnish-v4 X-Powered-By:PHP/5.3.3 X-Varnish:32829 我将文件中的文本更改为“test2”我去了页面,它显示“test2”。 我相信它应该显示“testing”,如果它正确caching。 我没有设置cookies或任何东西,只是。 我的vcl很简单: vcl 4.0; # Default backend definition. Set this to point to your content server. backend default { .host = "127.0.0.1"; .port […]