Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
perl script in httpd and error
Old 05-28-2010, 04:34 AM perl script in httpd and error
Junior Talker

Posts: 3
Trades: 0
Hi All,


I use this script for match vhost but I get any errors:

Starting httpd: Syntax error on line 196 of /var/www/vhosts/myhost/conf/httpd.include:
\t(in cleanup) Search pattern not terminated at /var/www/vhosts/myhost/conf/httpd.include line 220.\n

this is the script:

PHP Code:
<perl>
#!/usr/bin/perl -w
local ($ip,$host,$admin,$vroot,$aliases);
local ($directive,$args);
open (FILE,"/var/www/vhosts/myhost/conf/vhost-perl.conf");
while (<
FILE>) {
       
next if /^\s*(#|$) / ;
       
if (/^d+/) {
      (
$ip,$host,$admin,$vroot,$aliases)=split /"\s*,\s*"/, $_;
          
$VirtualHost{ip}= {
                  
ServerName =>$host,
                  
ServerAdmin => $admin,
                  
DocumentRoot => "/var/www/vhosts/myhost/subdomains/beta/httpdocs",
                  
ErrorLog => "logs/".$host."_error.log",
                  
TransferLog =>"logs/".$host."_access.log"
               
};
               
$VirtualHost {$ip} {ServerAlias} =$aliases if $aliases;
               
$VirtualHost {$ip} {Port} =$if ($ip=~/:(\d+)$/);
       } 
elsif ($ip) {
               (
$directive,$args)=split / /, $_,2;
               
$VirtualHost {$ip} {$directive}=$args;
       }
}
close (file);
_END_
</perl
phpmaster is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-29-2010, 03:12 AM Re: perl script in httpd and error
Bompa's Avatar
Extreme Talker

Posts: 225
Location: The Philippine Islands
Trades: 0
We would need to see line 220 in the file /var/www/vhosts/myhost/conf/httpd.include

Bompa
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Bompa is offline
Reply With Quote
View Public Profile Visit Bompa's homepage!
 
Old 05-30-2010, 02:21 PM Re: perl script in httpd and error
Junior Talker

Posts: 3
Trades: 0
I solved, the error is: __END__ and not _END_ but now if I restart httpd and I try to run the vhost that I added in /var/www/vhosts/myhost/conf/vhost-perl.conf I don't see nothing results, so the vhost is not configured in httpd.include
phpmaster is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to perl script in httpd and error
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.66722 seconds with 12 queries