Apr 19, 2007
Plesk control pannel limitations
Well it has not been my case, I got a server hosting with plesk control panel. First, plesk works with qmail, which is a little hard to configure. If you try to install other applications besides the ones that work with plesk, it might get corrupted as it happened to me.
I installed postfix with dovecot, but I had to remove courier-imap, after removing courier-imap, plesk stoped working.
So if you plan getting a server with a control panel I recommend you to search the web for limitations, and some other features your control panel might have.
Maybe swsoft improves plesk in the short future. It would be good to have a control panel that would allow you to configure (postfix, sendmail, qmail, etc) in such a way that with a few clicks you can multiple virtual domains running on a machine configure with plesk.
Nov 27, 2006
Perl and sql connections
Imagine this scenario: you company is running a sql server which is only accesible from your LAN, you cannot use NAT, so you need to acces from you webserver you sql server and show some information.... Then this is the solution to your scenario, there are a few steps you would need to make before star coding:
1.- if you don't have freetds, then download and install freetds you can get it from http://www.freetds.org/
2.- then you would need to go to cpan (search.cpan.org) and downlaod and install perl sybase module, this url might help http://www.linuxjournal.com/article/5732
3.- Then you are ready to query any sql sever as long as you have all ports opened on you LAN to your sql server.
Question are welcomed.. so don't hesitate in contacting me..
1.- if you don't have freetds, then download and install freetds you can get it from http://www.freetds.org/
2.- then you would need to go to cpan (search.cpan.org) and downlaod and install perl sybase module, this url might help http://www.linuxjournal.com/article/5732
3.- Then you are ready to query any sql sever as long as you have all ports opened on you LAN to your sql server.
Question are welcomed.. so don't hesitate in contacting me..
Perl and Mysql
You might wonder how to make perl work something similar to php or even asp when querying DB, well here is a code that might help you.
Php as well as asp they allow you to call fields from a record set in the way $rs['field_name'] and perl some times seem to be verydifucult... then this might change your point of views. take a look a t this:
#!/usr/bin/perl
use CGI;
use DBI;
$dbname = "";
$host = "";
my $db = 'DBI:mysql:$dbname:$host';
my $username = 'user';
my $pass = 'password';
my $dbh = DBI->connect($db, $username, $pass);
my $sql = "SELECT * FROM categoria";
$sth = $dbh->prepare($sql);
$sth->execute() or die "Error";
my($count) = $sth->rows();
print "Records: $count\n";
my %row;
$sth->bind_columns( \( @row{ @{$sth->{NAME_lc} } } ));
while ($sth->fetch) {
foreach $key (keys (%row)){
print "\$$key - $row{$key} ** ";
}
print "\n";
}
$sth->finish;
$dbh->disconnect();
exit;
This will code will let you call record set field streight from the query.. supose you have a field name id then you can cal $row{'id'} within the foreach loop.
Hope this is usefull, comments are welcomed..
Php as well as asp they allow you to call fields from a record set in the way $rs['field_name'] and perl some times seem to be verydifucult... then this might change your point of views. take a look a t this:
#!/usr/bin/perl
use CGI;
use DBI;
$dbname = "";
$host = "";
my $db = 'DBI:mysql:$dbname:$host';
my $username = 'user';
my $pass = 'password';
my $dbh = DBI->connect($db, $username, $pass);
my $sql = "SELECT * FROM categoria";
$sth = $dbh->prepare($sql);
$sth->execute() or die "Error";
my($count) = $sth->rows();
print "Records: $count\n";
my %row;
$sth->bind_columns( \( @row{ @{$sth->{NAME_lc} } } ));
while ($sth->fetch) {
foreach $key (keys (%row)){
print "\$$key - $row{$key} ** ";
}
print "\n";
}
$sth->finish;
$dbh->disconnect();
exit;
This will code will let you call record set field streight from the query.. supose you have a field name id then you can cal $row{'id'} within the foreach loop.
Hope this is usefull, comments are welcomed..
Subscribe to:
Posts (Atom)
