Server Administration

Useful Exim Commands from Shell

Thursday, September 27th, 2007

exim -bpc
counts all email in the mail queue

exim -bp
mailq — The mailq is relevant as it gives your the email IDs.

exim -M emailID
force delivery of one message

exim -qf
Force another queue run

exim -qff
Force another queue run and attempt to flush frozen messages

exim -Mvl messageID
View Log for message

exim -Mvb messageID
View Body for message

exim -Mvh messageID
View Header for message

exim -Mrm messageID
ReMove message (no errors sent)

exim -Mg messageID
Give up and fail message, message bounces to sender

Share this site! Click on the a link below: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Slashdot
  • De.lirio.us
  • Technorati
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists
  • blogmarks
  • YahooMyWeb
  • BlogMemes
  • Book.mark.hu
  • Bumpzee
  • Fleck
  • Furl
  • IndianPad
  • Netscape
  • Reddit
  • Spurl
  • blogtercimlap
  • Gwar
  • connotea
  • DotNetKicks
  • Fark
  • SphereIt

Repairing a database

Thursday, September 27th, 2007

To repair a database using the default myisam storage engine use either of the two commands,

mysqlcheck -r databasename

or

myisamchk -f /var/lib/mysql/databasename/*.MYI

Share this site! Click on the a link below: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Slashdot
  • De.lirio.us
  • Technorati
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists
  • blogmarks
  • YahooMyWeb
  • BlogMemes
  • Book.mark.hu
  • Bumpzee
  • Fleck
  • Furl
  • IndianPad
  • Netscape
  • Reddit
  • Spurl
  • blogtercimlap
  • Gwar
  • connotea
  • DotNetKicks
  • Fark
  • SphereIt

HowTo: Import/Export mysql database from shell

Thursday, September 27th, 2007

To export a database run

mysqldump datbasename > databasename.sql

This will export the database to databasename.sql

To import a database from an sql dump file run

mysql databasename < dumpsqlfilename.sql

This will import the sql file into the database. Once imported you should check to make sure it was correctly imported to do this run

mysql databasename
show tables;

If the you do not see any tables listed then the sql file likely has a USE statement at the top. Edit the sql file with a text editor and comment out the line “USE databasename”. Once commented out attempt to import the data and check the tablesl.

Share this site! Click on the a link below: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Slashdot
  • De.lirio.us
  • Technorati
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists
  • blogmarks
  • YahooMyWeb
  • BlogMemes
  • Book.mark.hu
  • Bumpzee
  • Fleck
  • Furl
  • IndianPad
  • Netscape
  • Reddit
  • Spurl
  • blogtercimlap
  • Gwar
  • connotea
  • DotNetKicks
  • Fark
  • SphereIt

Upgrading MySQL 4 to MySQL 5

Thursday, September 27th, 2007

Login to WHM as root and go to tweak settings. Under the Myql Section click version 5.0. Login to the server through shell and run

/scripts/mysqlup

Once this is completed, make sure mysql 5 has started, run

mysql

If it fails to connect run

/etc/init.d/mysql start

If it fails to start edit the /etc/my.cnf and commend out the line Basedir=/var/lib/mysql and then start mysql

Once you have mysql 5 fully started you must recompiled php to work with the new mysql errors. You can either do this from source or from easyapache whichever you are more comfortable with. If you choose easyapache make sure you select option #7 from the easy apache menu and you do not need to make any changes.

Share this site! Click on the a link below: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Slashdot
  • De.lirio.us
  • Technorati
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists
  • blogmarks
  • YahooMyWeb
  • BlogMemes
  • Book.mark.hu
  • Bumpzee
  • Fleck
  • Furl
  • IndianPad
  • Netscape
  • Reddit
  • Spurl
  • blogtercimlap
  • Gwar
  • connotea
  • DotNetKicks
  • Fark
  • SphereIt

PHP Suexec ForceType

Thursday, September 27th, 2007

If you are trying to use the ForceType directive in your .htaccess files with PHPsuexec, it will fail. To work around this, simply use SetHandler instead of ForceType.
example:

<Files r>
SetHandler application/x-httpd-php
</Files>

or

SetHandler application/x-httpd-php

The first one listed will cause files named “r” to be executed as PHP scripts, same as if it is named r.php basically. The 2nd example will parse every file through php.

Share this site! Click on the a link below: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Slashdot
  • De.lirio.us
  • Technorati
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists
  • blogmarks
  • YahooMyWeb
  • BlogMemes
  • Book.mark.hu
  • Bumpzee
  • Fleck
  • Furl
  • IndianPad
  • Netscape
  • Reddit
  • Spurl
  • blogtercimlap
  • Gwar
  • connotea
  • DotNetKicks
  • Fark
  • SphereIt