apache virtual hosting


Environment: ubuntu-10.04.3-server, apache2

my domain config:

A Record: aws->ip
C NAME  : www->aws
have a site on apache2

by default, you can access the site through www, aws, ip. Since www is the domain I want to use, I want to disable the aws and ip way, or redirect them to www.

so I use NameVirtualHost and RedirectMatch to do that:

make www site a NameVirtualHost, add another NameVirtualHost and make it as primary server, redirect all request on this virtual host to www.

	# Redirect all requests other than known host to
	RedirectMatch 301 (.*)$$1

development plan


Spring MVC file upload
tomcat deploy tools
nginx + apache + tomcat to provide php + jsp on same server
put them to amazon ec2

java regular expression sample


Check if a string is number

public boolean isNumeric(String str) {
	Pattern pattern = Pattern.compile("[0-9]*");
	Matcher isNum = pattern.matcher(str);
	return isNum.matches();
« Previous Next »