bianbian

apache virtual hosting

2011.08.11

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.

<VirtualHost>
	*:80
	# Redirect all requests other than known host to blog.bianbian.me
	RedirectMatch 301 (.*)$ http://blog.bianbian.me$1
</VirtualHost>

development plan

2011.08.10

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

2011.07.01

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 »