Articles of apache 2.2

将特定的主机名redirect到另一个主机名

我正试图从一个旧的主机名redirect到新的。 到目前为止我已经得到了 RewriteEngine On RewriteCond %{HTTP_HOST} ^foo$ [NC,OR] RewriteCond %{HTTP_HOST} ^foo.company.com$ [NC] RewriteRule ^(.*) http://bar.company.com/$1 [R=301] 但是当我去foo.company.com/dir/page.html我不会redirect。 我究竟做错了什么?

如何设置Apacheredirect到ServerName端口?

我刚刚做了一个新的Ubuntu安装apache2和haproxy。 Haproxy监听80端口,3080端口,后者从外面隐藏。 我的问题是,当使用文件夹名称没有结尾的斜杠,例如example.com/some/folder apache自动redirect到相同的地址用斜杠,但也不正确的端口, example.com:3080/some/folder/ : example.com/some/folder some / folder / ! Apache文档向我build议,我的问题在于CanonicalName / Portconfiguration,但是这些的任何组合似乎都不起作用。 我可能会误解? 我的虚拟主机: <VirtualHost *:3080> ServerName http://example.com:80 UseCanonicalName On UseCanonicalPhysicalPort On DirectoryIndex index.php index.html DocumentRoot /var/www/main <Directory /var/www/main> Options -Indexes Options -FollowSymLinks AllowOverride All <Files ~'^\.'> Order allow,deny Deny from all Satisfy all </Files> </Directory> </VirtualHost>

apxs不能在centos上安装mod_cloudflare

[Linux – CentOS – Apache 2.2 – mod_cloudflare – apxs2] 我已经改变了我的名字服务器指向CloudFlare。 问题是所有的IP地址都是以CloudFlare的forms出现的。 这是不好的,因为我必须监视和阻止一些特定的stream量。 mod_cloudflare应该解决这个,但我一直无法得到这个安装。 文档中的命令使用apxs2。 我不知道如何安装这个,或者如果它只是意味着'阿帕奇2.4'。 我正在运行2.2.3,我可以使用'apxs'。 当我运行: apxs -aic mod_cloudflare.c 我得到错误 apxs:Error: Command failed with rc=65536 这是否意味着我需要apxs2或其他东西? 我如何让mod_cloudflare在我的服务器上工作? 我感谢任何帮助,文件是模糊和有限的。

重载在MySQL上

我有专门的服务器,像16 GB RAM等非常好的configuration,但我面临着沉重的负载从MySQL我正在运行音乐wesbite只有一个数据库正在运行和5-10页只运行。当我点击whm显示processlist它只显示2-3个进程 然而,whm负载总是小于一个,但是当我点击whm加载它显示了20%的cpu使用情况的MySQL和一段时间后开始说不能连接到MySQL。 MySQL服务器已经消失 1691 (Trace) (Kill) mysql 0 19.2 2.7 /usr/sbin/mysqld –basedir=/ –datadir=/var/lib/mysql –user=mysql –log- error=/var/lib/mysql/server.xyz.com.err –pid-file=/var/lib/mysql/server.xyz.com.pid 我已经testing了静态页面,他们正在快速stream逝,但所有正在使用MySQL的dynamic页面将变得非常缓慢,需要几年时间才能打开。 my.conf文件是 [mysqld] key_buffer = 1536M max_allowed_packet = 1M max_connections = 250 max_user_connections = 15 wait_timeout=40 connect_timeout=10 table_cache = 512 sort_buffer_size = 2M read_buffer_size = 2M read_rnd_buffer_size = 8M myisam_sort_buffer_size = 64M thread_cache_size = 8 query_cache_size […]

运行在用户名下的可疑进程

我收到很多电子邮件报告,我想这个问题自动更正。 这些进程是由我的服务器运行,是更新,会话删除和其他合法的会话处理报告为误报的结果。 以下是一个示例报告: Time: Sat Oct 20 00:00:03 2012 -0400 PID: 20077 Account: named Uptime: 326117 seconds Executable: /usr/sbin/nsd\00507d27e9\0053\00\00\00\00\00 (deleted) The file system shows this process is running an executable file that has been deleted. This typically happens when the original file has been replaced by a new file when the application is updated. To […]

交换空间最大化 – JVM死亡

我有一个运行3个WordPress实例的服务器,MySql,Apache和64m初始和最大堆上的play framework 2.0。 如果我增加运行的JVM的最大堆,甚至16米,我看到128米的交换空间稳定地填满,直到JVM死亡。 我注意到,只有当我在Java虚拟机网站上插入JVM才会死亡。 我认为这是因为JVM在收集时没有要求内存。 我注意到,当我重新启动Apache时,我回收了大约一半的交换和内存。 那么有什么办法可以configurationApache以消耗更less的内存? 还有什么可能导致交换空间得到如此巨大的冲击只有16m添加到JVM的最大堆大小? 服务器运行: Ubuntu 12.04 内存: 408米 交换: 128米 Apache mods: alias.conf alias.load auth_basic.load authn_file.load authz_default.load authz_groupfile.load authz_host.load authz_user.load autoindex.conf autoindex.load cgi.load deflate.conf deflate.load dir.conf dir.load env.load mime.conf mime.load negotiation.conf negotiation.load php5.conf php5.load proxy_ajp.load proxy_balancer.conf proxy_balancer.load proxy.conf proxy_connect.load proxy_ftp.conf proxy_ftp.load proxy_http.load proxy.load reqtimeout.conf reqtimeout.load rewrite.load setenvif.conf setenvif.load status.conf […]

Apache:优美的杀死失败,发送SIGKILL。 多less是太多了?

在Apache / 2.2.15,有一个或两个“[警告] mod_fcgid:进程XXXXX优美杀死失败,每天发送SIGKILL是正常的吗? 毕竟这是一个警告,而不是一个错误。 谢谢

是否可以添加通配符serveralias虚拟主机,而无需手动修改httpd.conf?

是否有可能在apache服务器中添加通配符serveralias(例如: *.somesite.com )而无需手动修改httpd.conf? 我使用的DNS不同于我的托pipe服务器,我已经添加了星号Alogging到我的DNS指向像( test.somesite.com , test2.somesite.com )到我的托pipe服务器IP的所有请求,但我还是看不到在我的cPanel中将apache httpd.conf文件添加到星号服务器上。 请问有解决办法吗?

如何修复NameVirtualHost *:80在Apache2上没有VirtualHosts第一次安装?

我在这里创build了第一个服务器,在这里设置了Apache2上的域。 当我尝试运行/etc/init.d/apache2 restart此错误: [Mon Oct 29 11:47:17 2012] [warn] NameVirtualHost *:80 has no VirtualHosts [Mon Oct 29 11:47:17 2012] [warn] NameVirtualHost *:80 has no VirtualHosts 这是我的/etc/apache2/conf.d/virtual.conf # # We're running multiple virtual hosts. # NameVirtualHost *:80 这是我的/etc/apache2/sites-available/www.x.com # # Example.com (/etc/apache2/sites-available/www.x.com) # <VirtualHost *:80> ServerAdmin [email protected] ServerName www.x.com ServerAlias x.com # Indexes + Directory Root. […]

在Ubuntu 12.04.1 LTS上编译apache 2.2.23,出现openssl错误

我已经(或正在)从OpenSuse 12.1迁移到Ubuntu 12.04.1 LTS – 我没有问题在我们的OpenSUSE盒子上从源代码编译Apache。但是,我遇到了Ubuntu 12.04.1 LTS的问题。 我已经安装了openssl,libssl-dev,当我尝试编译Apache时,我收到以下内容: 检查SSL / TLS工具包基础… / usr 检查SSL / TLS工具包版本… OpenSSL 1.0.1 2012年3月14日 检查SSL / TLS工具包包括… / usr / include 检查SSL / TLS工具箱库…configuration:错误:未findOpenSSL库 我试图使用–with-ssl = / usr / include / openssl,但是这也不起作用。 我是否也需要从源代码编译SSL(我不需要在我们的SUSE框上执行此操作)。 谢谢。 注意:由于各种商业原因,我需要编译Apache,使用apt-get apache2不是我的select。 编辑:我有libssl.so.1.0.0在/ lib / x86_64-linux-gnu和configuration选项–libdir = / lib / x86_64-linux-gnu