|< 1 2 >| | 14 Einträge, 2 Seiten |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
...
<VirtualHost 10.0.0.1>
ServerName www.domain.tld
ServerAlias domain.tld
DocumentRoot /var/www/domain.tld/html
User domain.tld-user
Group ftpuser
RewriteEngine On
RewriteCond %|{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
ScriptAlias /cgi-bin /var/www/domain.tld/cgi-bin
php_admin_value open_basedir /var/www/domain.tld/
php_admin_value upload_tmp_dir /var/www/domain.tld/temp
php_admin_value session_save_path /var/www/domain.tld/temp
php_admin_value safe_mode on
CustomLog /var/www/domain.tld/log/bocks.de-access.log combined
ErrorLog /var/www/domain.tld/log/bocks.de-error.log
ErrorDocument 404 /404.html
</VirtualHost>
<VirtualHost 10.0.0.1>
ServerName www.domain2.tld
ServerAlias domain2.tld
DocumentRoot /var/www/domain2.tld/html
User domain2.tld-user
Group ftpuser
RewriteEngine On
RewriteCond %|{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
ScriptAlias /cgi-bin /var/www/domain2.tld/cgi-bin
php_admin_value open_basedir /var/www/domain2.tld/
php_admin_value upload_tmp_dir /var/www/domain2.tld/temp
php_admin_value session_save_path /var/www/domain2.tld/temp
php_admin_value safe_mode on
CustomLog /var/www/domain2.tld/log/bocks.de-access.log combined
ErrorLog /var/www/domain2.tld/log/bocks.de-error.log
ErrorDocument 404 /404.html
</VirtualHost>
<VirtualHost 10.0.0.1>
ServerName www.domain3.tld
ServerAlias domain3.tld
DocumentRoot /var/www/domain3.tld/html
User domain3.tld-user
Group ftpuser
RewriteEngine On
RewriteCond %|{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
ScriptAlias /cgi-bin /var/www/domain3.tld/cgi-bin
php_admin_value open_basedir /var/www/domain3.tld/
php_admin_value upload_tmp_dir /var/www/domain3.tld/temp
php_admin_value session_save_path /var/www/domain3.tld/temp
php_admin_value safe_mode on
CustomLog /var/www/domain3.tld/log/bocks.de-access.log combined
ErrorLog /var/www/domain3.tld/log/bocks.de-error.log
ErrorDocument 404 /404.html
</VirtualHost>
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
sub del_vhost # ($_[0] = $domain)
{
open(VHOSTS, "<$vhosts_file") || &error("Kann die Datei $vhosts_file nicht lesen!", 1);
my $content = "";
while (<VHOSTS>){
$content.=$_;
}
close(VHOSTS);
my @vhosts = split(/\n\n/, $content);
open(OUT, ">$vhosts_file") || &error("Kann nicht in die Datei $vhosts_file schreiben!");
flock(OUT, LOCK_EX);
foreach my $vhost (@vhosts){
if (!($vhost =~ /ServerName\s*www.$domain/)){
print OUT $vhost."\n\n";
}
}
close(OUT);
&info("VHOST", "Entferne Virtuellen Host($_[0]).");
}
1
2
3
4
5
6
7
open(VHOSTS, "<$vhosts_file") || &error("Kann die Datei $vhosts_file nicht lesen!", 1);
my $content = "";
while (<VHOSTS>){
$content.=$_;
}
close(VHOSTS);
my @vhosts = split(/\n\n/, $content);
1
2
3
4
open(VHOSTS, '<', $vhosts_file) || &error("Kann die Datei $vhosts_file nicht lesen!", 1);
my @vhosts;
{ local $/ = "\n\n"; @vhosts = <VHOSTS>; }
close(VHOSTS);
1
2
3
4
open(VHOSTS, '<', $vhosts_file) || &error("Kann die Datei $vhosts_file nicht lesen!", 1);
my @vhosts;
{ local $/ = ''; @vhosts = <VHOSTS>; }
close(VHOSTS);
1
2
3
4
5
6
7
open (VHOSTS, "<", $vhosts_file)
or &error("Kann die Datei '$vhosts_file' nicht lesen: $!", 1);
my @vhosts = do {
local $/ = "\n\n";
<VHOSTS>;
};
close(VHOSTS);
1
2
3
4
5
6
7
open (VHOSTS, "<", $vhosts_file)
or &error("Kann die Datei '$vhosts_file' nicht lesen: $!", 1);
my @vhosts = do {
local $/ = "\n\n";
<VHOSTS>;
};
close(VHOSTS);
1
2
3
4
5
6
my @vhosts = do {
open my $vhosts, '<', $vhosts_file
or error("Kann die Datei '$vhosts_file' nicht lesen: $!", 1);
local $/ = '';
<$vhosts>;
};
|< 1 2 >| | 14 Einträge, 2 Seiten |