Apache in front of Tomcat and JBoss

Recently I have to deploy two Java web applications on a single server (one IP address). Where static content was to be served by Apache Http web server instead of Java application servers. When we have multiple applications deployed on an instance of Tomcat or JBoss we have their URLs something like

http://server:port/appA,
http://server:port/appB
etc.

Continue reading

Apache配置主域名映射到(www)子域名

It’s easy.但是很多网站的管理员还是没有这么做。
我只能说这些管理员真是不专业~当然我也不专业因为我不是管理员。
开始吧:
在你的httpd-vhosts.conf里面对应域名配置文件里面加入以代码:

 Options Includes FollowSymLinks
 AllowOverride None
 Order allow,deny
 Allow from all
 DirectoryIndex index.jsp
 RewriteEngine on
 RewriteCond %{http_host} ^yourdomain.com [nc]
 RewriteRule ^(.*)$http://www.yourdomain.com/$1[r=301,nc]

注意:你的apache必须支持Rewrite
Continue reading