How to yum install clamav (clamscan) for linux

Posted by: kevin  :  Category: Linux & Shell, Servers & Hosting, Tips & Tricks

This is probably the easiest way to install Clamav’s clamscan virus scanner for linux. Assuming you have yum and wget installed, this should be a breeze. Basically we’re just going to add the clamav repo, yum install, and done.

  1. First login to your shell or remote ssh for the linux server, then type:
    cd /etc/yum.repos.d
  2. Now that you are in the yum repos directory, lets download the ClamAV repo:
    wget http://www.linux-mail.info/files/dag-clamav.repo
  3. Lets install that bad ass linux virus scanner, ClamAV (clamscan)
    yum install clamav clamav-devel clamd
  4. Hit y for yes and anything else required to continue installing.
  5. To run clamav, simply use the command clamscan. To see a list of options for clamscan, type clamscan -h.
  6. To update clamav, use the updater, which is freshclam.

Here’s an example clamscan execution command:

clamscan –infected –log=scanresults.txt –recursive –move=/home/backups/ –no-mail ./*

–infected or -i makes it so that clamscan only logs infected files
–log=scanresults.txt or -l scanresults.txt is where you’d like to place scan results (scanresults.txt can be anything)
–recursive or -r scans every directory past the starting point
–move=/home/backups/ is where clamscan will move infected files after they are found
–no-mail tells clamscan to not search mail related files for viruses (usually its phishing and such)
./* is where we would like to search. for instance if you start out in / and use ./* here, then it will scan the whole server.
You can of course replace ./* with any other path that you would like to specifically scan.

For more information, type clamscan -h in shell.

How to do a PHP redirect page

Posted by: kevin  :  Category: Servers & Hosting, Tips & Tricks

It’s relatively easy to make a page that automatically redirects the visitor to a different page. Very useful for pages that have moved or changed URL’s. Also can be used as the index.php in a directory that you want to protect (and forward the user to a useful page rather then just have a blank page), as well as many other applications.

  1. Make sure that the file you are trying to use as redirect page ends in the .php extension, such as index.php — will not work if its any other extension, or if your server does not support PHP programming.
  2. Place the following code inside of a .php file:
  3. <?php
    header( ‘Location: http://www.yoursite.com/page.html’ ) ;
    ?>
  4. Make sure to change the www.yoursite.com/page.html aspect, as thats the page that visitors would be redirected to.

For example:

http://vishun.net/song2 -> http://vishun.net/music/artist-song.mp3

/song2/index.php:

<?php
header( ‘Location: http://vishun.net/music/artist-song.mp3′ ) ;
?>

How to batch rename files without an extension (Linux / Shell script)

Posted by: kevin  :  Category: Linux & Shell, Tips & Tricks

Recently we were in need of renaming a large amount of files that did not have a file extension. After some research we found some information on an easy way to do it via a shell script.

Create a simple text file by using vi or nano - name it anything, such as rename_files.sh and then to run the shell script, simply type into shell:   ./rename_files.sh

In the example, make sure to alter the FILEPATH variable and replace .txt with your intended extension. Its recommended that you have the shell script in a directory other then the directory with the files that need renaming, as when the renaming occurs it will rename the shell script itself as well (if its in the same directory) which isnt the worst thing, but is not intended.


for i in * ; do
echo mv \"$i\" \"$i.txt\" | sh
done

OR

Make sure that you chmod the shell script before running it. Suggested: chmod +rx rename_files.sh

Big thanks to Andrew Morio for his contribution of the shell script.


#!/bin/bash
FILEPATH="/path/to/folder/"

for FILE in ${FILEPATH}*
do
mv “${FILE}” “${FILE}.txt”
done
exit 0

Wordpress page is blank - but I can access wp-admin

Posted by: kevin  :  Category: Tips & Tricks

In working with Wordpress 2x often you may experience a scenario where all of a sudden, your web site powered by Wordpress becomes a plain white blank page. And if you view the source, low and behold, theres absolutely not html or code what so ever.

First off, relax, everything isnt gone - something has just barfed with the theme. We’ve had this issue multiple times and the solution always seems to be the same. We’re not 100% sure that this solution will fix all scenarios that end up rendering a blank Wordpress page, but we are pretty sure that if out of the blue pages are rendered blank - that there is an easy fix.

Wordpress pages are blank white pages? What gives?

We’re not sure what causes this, but how to fix it is pretty straight forward and a short story. First login to the admin side of the site at /wp-admin and then procede to the Presentation menu link (notice this may apply to Wordpress version 2x only). All you need to do is change the theme to something else real quick by choosing any theme other then the intended theme, then after its changed, simply change the theme back to the intended theme. This sort of resets the implementation of the theme, and atleast for us, this has fixed the mysterious blank wordpress page issues several times in the past.

We’ll do some further research and see if there may be other causes and solutions, but for now, thats all we’ve got for you on this subject. Hope it helps.

How to create a cPanel theme

Posted by: kevin  :  Category: Tips & Tricks

Recently we were looking at re-doing the cPanel theme to match our new site that has yet to be released. Turns out its not the easiest thing, especially not the easiest thing to find information for. So we will go ahead and share some brief information about what we’ve learned so far. This page will be updated as we learn more or feel like there is more to share.

Similar questions related to this post:
How to download a cPanel / WHM theme, skin, or branding?
How to modify a cPanel / WHM theme, skin, or branding?
How to add a cPanel / WHM theme, skin, or branding?

First and foremost, what actually spawned the idea to post some of this information, was the lack of an imformative resource (even directly from cPanel). For instance, the best place to start with creating your own theme or customizing your current theme (the more manual approach as opposed to the built in Branding Editor) is to download the “theme ball” and edit the files directly then re-upload the “theme ball”. However, this is where we had our first issue.

To download a cPanel theme, you can go into the WHM and goto Themes > Universal Theme Manager > Manage Themes — notice there are 4 options — you can manage the theme of cPanel, Login, Webmail, and WHM. For this example we’re going to try and modify the cPanel theme, so click Manage Themes under the cPanel logo.

Now you’ll notice an interface to Manage the cPanel Themes. Let’s go ahead and download one of the pre-existing themes that come installed with cPanel. For this tutorial we are going to use the x3 theme, so go ahead and click the green arrow to the right of x3 for Download.

Go ahead and download “x3.cpbranding” to your local computer. Now this is the somewhat tricky part that was actually a hard little nugget of information to find. At first look, you might think to open this file in a text editor, at which point you’ll notice all kinds of random characters and text. This is not right.

What we need to do now is rename this “theme ball” that we have downloaded, as it is actually a compressed file format such as zip or rar. In the resource we found, it suggested renaming it to x3.zip and this caused it to not open in normal/default unzipping programs, and instead it was recommended to download and use WinRar to open this compressed file. What we did instead, that allowed this file to work in our default unzipper, is renamed the file to x3.rar

So, go ahead and rename “x3.cpbranding” to “x3.rar”
You should now be able to extract the files from the archive. You may need to still download a third-party unzipper program such as WinRar for PC or StuffIt for Mac.

This is all the details we have at this time. Stay tuned as we will post more information about our experience as it becomes available. Thanks.

New Hosting Services to be offered soon…

Posted by: kevin  :  Category: Products & Services, Servers & Hosting

We are excited to announce that we will be offering a new line of hosting services, with a laundry list of services, products, and packages. Agreements and contracts are still being settled, signed, and sealed, but as soon as we have more information on our new line of services we’ll let you know.

VISHUN Support System has launched!

Posted by: kevin  :  Category: Products & Services

We’ve launched a new support system to help us manage new requests, issues, and general questions. This system will help us keep track of pending or unresolved issues, will increase efficiency, and will essentially help us get to your request sooner. You can reach us at any time via phone at (323) 319-3162 or via email at contact@vishun.com - however, due to the high volume of requests at this time, it is preferable that most requests be made via opening a new support ticket. We may create a support ticket for you if other methods of contact are used, simply so that we can track issues and make sure that they get completed as soon as possible.

VISHUN Support System:
http://support.vishun.com

Notice and information about server outtage (05/31/08)

Posted by: kevin  :  Category: Servers & Hosting

Read more…