def add_website():

	global environment

	print('\nAdd website.\n')
	input_file = open('./example-files/apache-site', 'r')
	input_file_text = input_file.read()
	input_file.close()

	site_name = input('Website name (without www or http)' + environment.prompt)
	new_filename = '/etc/apache2/sites-available/%s.conf' % (site_name,)
	tmp_filename = '/tmp/%s.conf' % (site_name,)
	# TODO: Check that site_name is legal for both a domain name and a filename.

	while os.path.isfile(new_filename):
		print('Site exists! Please choose another.')
		site_name = input('Website name (without www or http)' + environment.prompt)
		new_filename = '/etc/apache2/sites-available/%s.conf' % (site_name,)
		tmp_filename = '/tmp/%s.conf' % (site_name,)

	new_config = re.sub('SITE', site_name, input_file_text)
	try:
		output_file = open(tmp_filename, 'w')
		output_file.write(new_config)
		output_file.close()
		tmp_move = os.system("sudo mv %s %s" % (tmp_filename, new_filename))
	except PermissionError as e:
		print('\n\nError!')
		print('The current user does not have permission to perform this action.')
		#print('Please run Burton with elevated permissions to resolve this error.\n\n')

	if tmp_move != 0:
		print('\n\nError!')
		print('The current user does not have permission to perform this action.')
		#print('Please run Burton with elevated permissions to resolve this error.\n\n')


	current_user = str(os.getuid())

	result = os.system('sudo mkdir -p /var/www/%s/public_html/' % (site_name,))
	result = os.system('sudo mkdir -p /var/www/%s/logs/' % (site_name,))
	result = os.system('sudo chown -R %s:%s /var/www/%s/' % (current_user, current_user,))
	result = os.system('sudo a2ensite %s.conf' % (site_name,))

	restart_apache()

	return True