View difference between Paste ID: dgwAnAEK and 3xeMyAF6
SHOW: | | - or go back to the newest paste.
1-
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
1+
#!/bin/bash
2-
permitted by applicable law.
2+
if [ "$1" == "" ] 
3-
Last login: Tue May  8 02:22:55 2012 from d54c19492.access.telenet.be
3+
then
4-
adnez@www:~$ sudo -i apt-get update
4+
	echo "No subdomain given"
5-
[sudo] password for adnez:
5+
else
6-
/usr/bin/apt-get: /usr/bin/apt-get: cannot execute binary file
6+
	echo "Creating subdomain $1"
7-
adnez@www:~$ sudo -s apt-get update
7+
	sudo mkdir -p "/home/adnez/subdomains/$1"
8-
/usr/bin/apt-get: /usr/bin/apt-get: cannot execute binary file
8+
	sudo echo "<html><body>$1</body></html>" > "/home/adnez/subdomains/$1/index.html"
9-
adnez@www:~$ sudo apt-get update
9+
	sudo chown "adnez.adnez" "/home/adnez/subdomains/$1" -Rf
10-
Ign http://ftp.nl.debian.org lenny Release.gpg
10+
11-
Ign http://ftp.nl.debian.org lenny/main Translation-en_US
11+
		sudo echo "<VirtualHost *:80>
12-
Ign http://ftp.nl.debian.org lenny/contrib Translation-en_US
12+
	ServerAdmin webmaster@localhost
13-
Ign http://ftp.nl.debian.org lenny/non-free Translation-en_US
13+
	ServerName $1
14-
Ign http://ftp.nl.debian.org lenny Release
14+
	ServerAlias www.$1
15-
Ign http://ftp.nl.debian.org lenny/main Packages/DiffIndex
15+
16-
Ign http://ftp.nl.debian.org lenny/contrib Packages/DiffIndex
16+
	DocumentRoot /home/adnez/subdomains/$1
17-
Ign http://ftp.nl.debian.org lenny/non-free Packages/DiffIndex
17+
18-
Ign http://ftp.nl.debian.org lenny/main Packages
18+
	<Directory />
19-
Ign http://ftp.nl.debian.org lenny/contrib Packages
19+
		Options FollowSymLinks
20-
Ign http://ftp.nl.debian.org lenny/non-free Packages
20+
		AllowOverride All
21-
Ign http://ftp.nl.debian.org lenny/main Packages
21+
	</Directory>
22-
Ign http://ftp.nl.debian.org lenny/contrib Packages
22+
	<Directory /home/adnez/subdomains/$1>
23-
Ign http://ftp.nl.debian.org lenny/non-free Packages
23+
		Options Indexes FollowSymLinks MultiViews
24-
Err http://ftp.nl.debian.org lenny/main Packages
24+
		AllowOverride All
25-
  404 Not Found [IP: 130.89.149.21 80]
25+
		Order allow,deny
26-
Err http://ftp.nl.debian.org lenny/contrib Packages
26+
		allow from all
27-
  404 Not Found [IP: 130.89.149.21 80]
27+
	</Directory>
28-
Err http://ftp.nl.debian.org lenny/non-free Packages
28+
29-
  404 Not Found [IP: 130.89.149.21 80]
29+
	ErrorLog /var/log/apache2/$1.error.log
30-
W: Failed to fetch http://ftp.nl.debian.org/debian/dists/lenny/main/binary-i386/                                                                                                                               Packages  404 Not Found [IP: 130.89.149.21 80]
30+
31
	# Possible values include: debug, info, notice, warn, error, crit,
32-
W: Failed to fetch http://ftp.nl.debian.org/debian/dists/lenny/contrib/binary-i3                                                                                                                               86/Packages  404 Not Found [IP: 130.89.149.21 80]
32+
	# alert, emerg.
33
	LogLevel warn
34-
W: Failed to fetch http://ftp.nl.debian.org/debian/dists/lenny/non-free/binary-i                                                                                                                               386/Packages  404 Not Found [IP: 130.89.149.21 80]
34+
35
	CustomLog /var/log/apache2/$1.access.log combined
36-
E: Some index files failed to download, they have been ignored, or old ones used                                                                                                                                instead.
36+
37-
adnez@www:~$ sudo apt-get install php5-curl
37+
</VirtualHost>" > "/etc/apache2/sites-available/$1.conf"
38-
Reading package lists... Done
38+
	sudo a2ensite "$1.conf"
39-
Building dependency tree
39+
	sudo /etc/init.d/apache2 reload
40-
Reading state information... Done
40+
fi