You are here: Home
Apache: Error(98) PDF Print E-mail
Tech Notes - General
Written by Rick   
Tuesday, 25 May 2010 10:23

I ran across a situation where Apache wouldn't start. It generated the following error;

"(98)address already in use: make_sock: could not bind to address [::]:80 (98)address already in use: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down unable to open logs"

I located a thread at wallpaperama.com that fixed the problem. Use the following from CLI;

First;

for i in `ps auwx | grep -i nobody | awk {'print $2'}`; do kill -9 $i; done

Second;

for i in `lsof -i :80 | grep http | awk {' print $2'}`; do kill -9 $i; done

If Apache still doesn't start;

for i in `ipcs -s | grep nobody | awk '{print $2}'`; do ipcrm -s $i; done

Correcting my particular problem did not require running the last line.

 
Ubuntu Lucid Upgrade: Dell T3500 Disaster PDF Print E-mail
Tech Notes - Linux
Written by Rick   
Tuesday, 18 May 2010 17:47

My system at work had been acting funky for months. Every now and again, the monitor would go non-linear and I'd get no response from the mouse or keyboard. It would normally still be accessible remotely. So, I'd just reboot it that way and move on. I was pretty sure it was a memory or video card issue.  But, I read where Ubuntu had some problems with the NVidia cards. I figured I'd wait 'til Ubuntu released 10.04 and do a fresh install.

Read more...
 
Linux CLI: Copy MySQL Database PDF Print E-mail
Tech Notes - Linux
Written by Rick   
Tuesday, 06 April 2010 11:57

There is no command in MySQL to copy a database. One method to copy a database is as follows;

  1. Create a new empty database.
  2. Export the source database using mysqldump.
  3. Import the database to the new empty database created in step 1 above.

(See Linux CLI: MySQL Database Backup & Restore article for mysqldump usage).

Alternatively, phpMyAdmin can be used for small databases. More often-than-not, databases exceed size limits imposed by phpMyAdmin forcing CLI use or another method.

 
PostgreSQL: Copy Database PDF Print E-mail
Tech Notes - General
Written by Rick   
Wednesday, 03 March 2010 00:00

It's not uncommon to run across a need to duplicate a database for testing purposes. PostgreSQL provides for the ability to duplicate the structure and data content with a single command;

 

CREATE DATABASE newdb WITH TEMPLATE originaldb;

 

With any luck it's obvious one needs to replace "newdb" with the new database name and "originaldb" with the name of the source database.

I've executed this command in phpPgAdmin (v4.2-beta-1) with success on a 657MB database. The process took approximately 10 minutes. I have no doubt the command can be executed from the pgsql prompt as well.

PostgreSQL DB Server version 8.1.11.

 
PHP/PostgreSQL: Create Recordset & Display PDF Print E-mail
Development - PHP
Written by Rick   
Monday, 25 January 2010 12:00

Creating a recordset and displaying data from a PostgreSQL table using PHP;

Making the connection:

$DB_HOST="hostname";
$DB_NAME="databasename";
$DB_USER="username";
$DB_PASSWORD="password";


$psql="Select DISTINCT fieldname FROM table";
$const = "host=".$DB_HOST." dbname=".$DB_NAME." user=".$DB_USER." password=".$DB_PASSWORD."";
$pcon=pg_connect($const);
if (!$pcon) {
echo "<script type=\"text/javascript\">alert(\"Unable to connect to PostgreSQL Server!\")</script><script type=\"text/javascript\">history.back()</script>";
}else{
$getRS = pg_exec($pcon,$psql);
}

pg_close($pcon);


Create the recordset and display:

$getRS = psqlSelectRS($psql);
$rows=pg_num_rows($getRS);

for ($i=0; $i<$rows; $i++) {
$row_getRS=pg_fetch_row($getRS, $i);
echo "Row Value: ".$row_getRS[0]."<br />;
}

pg_free_result($getRS);

 
<< Start < Prev 1 2 3 Next > End >>

Page 1 of 3