View difference between Paste ID: 6fTvkn7Q and dgwAnAEK
SHOW: | | - or go back to the newest paste.
1-
#!/bin/bash
1+
www:/etc/apache2/sites-enabled# vi wisenyourie.haxer.be.conf
2-
if [ "$1" == "" ] 
2+
<VirtualHost *:80>
3-
then
3+
        ServerAdmin webmaster@localhost
4-
	echo "No subdomain given"
4+
        ServerName wisenyourie.haxer.be
5-
else
5+
        ServerAlias www.wisenyourie.haxer.be
6-
	echo "Creating subdomain $1"
6+
7-
	sudo mkdir -p "/home/adnez/subdomains/$1"
7+
        DocumentRoot /home/adnez/subdomains/wisenyourie.haxer.be
8-
	sudo echo "<html><body>$1</body></html>" > "/home/adnez/subdomains/$1/index.html"
8+
9-
	sudo chown "adnez.adnez" "/home/adnez/subdomains/$1" -Rf
9+
        <Directory />
10
                Options FollowSymLinks
11-
		sudo echo "<VirtualHost *:80>
11+
                AllowOverride All
12-
	ServerAdmin webmaster@localhost
12+
        </Directory>
13-
	ServerName $1
13+
        <Directory /home/adnez/subdomains/wisenyourie.haxer.be>
14-
	ServerAlias www.$1
14+
                Options Indexes FollowSymLinks MultiViews
15
                AllowOverride All
16-
	DocumentRoot /home/adnez/subdomains/$1
16+
                Order allow,deny
17
                allow from all
18-
	<Directory />
18+
        </Directory>
19-
		Options FollowSymLinks
19+
20-
		AllowOverride All
20+
        ErrorLog /var/log/apache2/wisenyourie.haxer.be.error.log
21-
	</Directory>
21+
22-
	<Directory /home/adnez/subdomains/$1>
22+
        # Possible values include: debug, info, notice, warn, error, crit,
23-
		Options Indexes FollowSymLinks MultiViews
23+
        # alert, emerg.
24-
		AllowOverride All
24+
        LogLevel warn
25-
		Order allow,deny
25+
26-
		allow from all
26+
        CustomLog /var/log/apache2/wisenyourie.haxer.be.access.log combined
27-
	</Directory>
27+
28
</VirtualHost>