Wordpress Backup-MYSQL commands

If you would like to backup large database phyMyAdmin  can not handle large database so best by using straight MySQL commands to  backup your data. Here are the steps;phpMyAdmin can not handle large databases so using straight MySQL code will help.

1. Change your directory to the directory you want to load things to:

user@linux:~> cd files/blog

2. Use mysqldump to dump all database tables. To dump only certain tables from the database, give their names at the place shown by (tablename tablename tablename), and omit the parentheses ( ) in any case. (For help, try: man mysqldump.):

user@linux:~/files/blog> mysqldump –add-drop-table -h mysqlhostserver
-u mysqlusername -p databasename (tablename tablename tablename) | bzip2
-c > blog.bak.sql.bz2

Enter password: (enter your mysql password)
user@linux~/files/blog>

Example:
mysqldump –add-drop-table -h db01.example.net -u dbocodex -p dbwp | bzip2 -c > blog.bak.sql.bz2

Enter password: my-password
user@linux~/files/blog>

The bzip2 -c after the | (pipe) means the backup is compressed on the fly, and the > blog.bak.sql.bz2 sends the bzip output to a file named blog.bak.sql.bz2. It does in one line the same thing that these two commands do:

mysqldump –add-drop-table -h db01.example.net -u dbocodex -p dbwp > blog.bak.sql
bzip2 blog.bak.sql

 

Leave a Comment

Filezilla FTP Program

Filezilla is free, open-source FTP application, it is handy if you’re looking for a firm tool to handle FTP transfers for file uploading and downloading to and from your FTP site, server, or host. Just before you start with collect some of the information from your web hosting providers like;

# Name of your host server or ip of the server
# Your login username/password for your FTP account.
#The directory where you need to place your files like for
example the files in a subdirectory called “www” or “public_html”
or even the default directory that you see when you log
into your FTP site.

Start up FileZilla.
* Click the “File” menu followed by the “Site Manager” item on that
menu. A dialog box will appear.
* Click the “New Site” button on that dialog box. This creates a new
item under “My FTP Sites” called “New FTP site”. Rename “New FTP
site” to the name of your site if you wish.By default, the keyboard
cursor would have been placed in the name portion of “New FTP
site” allowing you to change the name immediately.
* In the section entitled “Site details”, enter the name of your server
name in the “Host” input box.For example,if your web host told you
that your hostname is “server.example.com”,enter “server.example.com”
into the space provided.You can also put the server ip therein.
* Leave the “Port” and the “Servertype” entry boxes alone.Use your
mouse and click on the “Normal” radio button in the “Logontype” section.
This will enable the “User” and “Password” boxes for the next step.
(If incase you need to enter the port number,you can put in as “21?).
* Enter your user id or your login name (or whatever your web host
calls it) into the “User” input box. Likewise, enter your password into
the “Password” input box.
* Click the “Connect” button. FileZilla will take you to log into your
server. If it is successful, you will see a directory listing of your website’s
account in the right window pane. The left window pane is the directory
listing of your own computer.
* Next, locate the file that you wish to upload in the left window pane
(the “Local Site” pane). Both window panes behave like a Windows
Explorer windows, so navigating them should not be unduly hard. Once
you have located the file you wish to upload, say “test.php”,doubleclick
it to upload it to your website. Also you can drag that file from
the left window pane to the right window pane. The file will be uploaded
to the folder that is currently open on the right window pane, so make
sure you have changed to the directory you want before dragging the
file there.
* As FileZilla keep on uploading your file to your site, you should be
able to see the upload progress in the bottommost window pane.
Once the upload is finished, you can simply disconnect it from
your website.

Leave a Comment

Process to create own server stat script in PHP

It is important to check your ports are responding before you create your own server stat script in PHP.  You should aware when one of your particular service are down, such as HTTP, MySQL, POP/SMTP, etc as well you should know the current server loads, and users which will be the main indicator of a runaway script, or process.

So let’s start.

Make sure your php script ALWAYS start with <?php  this let your server understand that it is in fact a php script

<?php

//You can replace the domain with an IP if you wish

$site = “mysite.com”;  //this is the site you wish to check

// Let’s check our common ports 80, 21, and 110
$http = fsockopen($site, 80);
$ftp = fsockopen($site, 21);
$pop3 = fsockopen($site, 110);

if ($http) {
$status .= “<font face=\”Arial\”><font size=\”2\”><b>HTTP</b>: Working</font></font><br>”;
}
else {
$status .= “<font face=\”Arial\”><font size=\”2\”><b>HTTP</b>: Not Working</font></font><br>”;
}

if ($ftp) {
$status .= “<font face=\”Arial\”><font size=\”2\”><b>FTP</b>: Working</font></font><br>”;
}
else {
$status .= “<font face=\”Arial\”><font size=\”2\”><b>FTP</b>: Not Working</font></font><br>”;
}

if ($pop3) {
$status .= “<font face=\”Arial\”><font size=\”2\”><b>POP3/SMTP</b>: Working</font></font><br>”;
}
else {
$status .= “<font face=\”Arial\”><font size=\”2\”><b>POP3/SMTP</b>: Not Working</font></font><br>”;
}
echo(”$status”);

echo(”<hr>”);

// Users and load information
$reguptime = trim(exec(”uptime”));
if ($reguptime) {
if (preg_match(”/, *(\d) (users?), .*: (.*), (.*), (.*)/”, $reguptime, $uptime)) {
$users[0] = $uptime[1];
$users[1] = $uptime[2];
$loadnow = $uptime[3];
$load15 = $uptime[4];
$load30 = $uptime[5];
}
} else {
$users[0] = “Unavailable”;
$users[1] = “–”;
$loadnow = “Unavailable”;
$load15 = “–”;
$load30 = “–”;
}

echo(”<b>Current Users:</b> $users[0]<br>
<b>Current Load:</b> $loadnow<br><b>Load 15 mins ago:</b> $load15<br><b>Load 15 mins ago:</b> $load30<br><hr>”);

// Operating system
$fp = @fopen(”/proc/version”, “r”);
if ($fp) {
$temp = fgets($fp);
fclose($fp);

if (preg_match(”/version (.*?) /”, $temp, $osarray)) {
$kernel = $osarray[1];
preg_match(”/[0-9]{5,} (\((.* *)\)\))/”, $temp, $osarray);
$flavour = $osarray[2];
$operatingsystem = $flavour.” (”.PHP_OS.” “.$kernel.”)”;
if (preg_match(”/SMP/”, $buf)) {
$operatingsystem .= ” (SMP)”;
}
} else {
$result = “(N/A)”;
}
} else {
$result = “(N/A)”;
}

echo(”<b>Operating System:</b><br>$operatingsystem”);
?>

It will display the status of your services, your user and load averages once you upload the above code to your server.

Now you can work with this, and make it look what ever you want, add new ports, etc.

Remember, this is just a very basic stat script.

Few Issues
You should aware that your web hosting provider will need to allow the exec() funtion, in order for this to work properly.

Leave a Comment

Podcasting Through Wordpress

WP seamlessly support media streaming content hence using podcast in wordpress is easy, you will need to just link to an audio file with your post and WordPress will automatically add the essential enclosure tag to your RSS2 feed to make it accessible throughout the web.

Important: Use a absolute URL when linking to the audio file. Otherwise WordPress will not make an enclosure for it.
Wrong: My podcast

Right: My podcast
That’s it — just link to an audio file and WordPress will take care of everything for you.
Check another step; You need to make your RSS2 feed available. Be sure to put a link somewhere on your web page:
http://example.com/wordpress/?feed=rss2
Or, if you’re using Atom:
http://example.com/wordpress/?feed=atom
As of WordPress 1.5, the RSS 2.0/Atom links are located on the bottom of the page by default.
To make life easier for iTunes users, consider also linking to your podcast feed with the itpc:// protocol rather than http, e.g.:
itpc://domain.org/path/?feed=atom
iTunes and other such services allow listeners to subscribe to your RSS/Atom feed and automatically download your content to their portable audio players as it becomes available for your users. However make sure that the linked file is accessible when you publish your post otherwise, WordPress would not be able to gather the information it needs from the linked files. If you change a linked file, republish the post which will enable WP to update its file size information about the file. Also for better coverage, you may require to put .xml at the end of the RSS/Atom url, to let it work flawlessly.

Leave a Comment

Using the File Editor in Wordpress

WordPress include a built-in editor which allows you for editing files directly from within your browser online which is called the File Editor that let you to edit file easily. Check few important instructions how you will go for editing your file effectively without losing anything.

This is the way you can access the built-in File Editor from the Administration > Manage > Files Panel.

* To view a file in the File Editor, click on the file from the list or type in the specific address such as
example.com/wordpress/filename.php
* If the file is “writable” you will see a button at the bottom of the editing window that says Update File. Click
this when you are done with your edits and ready to save the file.
* If the file is not “writable”, you will see a note under the bottom of the editing window saying the file is not
writable. You will need to CHMOD the file to 666 in order to make it writable through an FTP program (preferably FileZilla)
before you can edit it.
* Important instruction;

Before editing, backup your file by saving a copy!
* While making change to the file inside the File Editor window, all you have to Edit with care as to not delete or harm
the code inside the file.
* When ready to save the file, click the Update File button at the bottom. This will save the file and now you’ve done. In next article we will cover the editing process for image.

Leave a Comment