Sunday, May 30, 2010

Wordpress

Detailed Instructions
Overview of the Upgrade Process

1. Backup your database. Read Backing Up Your Database for a detailed explanation.
2. Backup ALL your WordPress files in your WordPress directory. Don't forget your .htaccess file.
3. Verify the backups you created are there and usable. This is essential.
4. Deactivate ALL your Plugins.
5. Ensure first four steps are completed. Do not attempt the upgrade unless you have completed the first four steps.
6. Download and extract the WordPress package from http://wordpress.org/download/.
7. Delete the old WordPress files on your site, but DO NOT DELETE
* wp-config.php file;
* wp-content folder; Special Exception: the wp-content/cache and the wp-content/plugins/widgets folders should be deleted.
* wp-images folder;
* wp-includes/languages/ folder--if you are using a language file do not delete that folder;
* .htaccess file--if you have added custom rules to your .htaccess, do not delete it;
* robots.txt file--if your blog lives in the root of your site (ie. the blog is the site) and you have created such a file, do not delete it.
8. Upload the new files from your computer's hard drive to the appropriate WordPress folder on your site.
9. Run the WordPress upgrade program and follow the instructions on the screen.
10. Update Permalinks and .htaccess. Update your Permalink Structure and merge the custom rules, if necessary, into your .htaccess file.
11. Install updated Plugins and Themes. Please review the list of Plugins that work in Version 2.9.2. Check for Theme Compatibility with 2.9.2 and ask your Theme author for any new version.
12. Reactivate Plugins
13. Add security key definitions to the wp-config.php file
14. Review what has changed in WordPress.

That's the overview of the upgrade process. Please continue reading the Detailed Upgrade Instructions.

Remember, if you do encounter problems, re-read the Instructions below to insure you've followed the proper procedures and consult Troubleshooting: Common Installation Problems.

Image magick

Install ImageMagick and Imagick on Cpanel Server
May 12th, 2009 · 9 Comments

Here’s a quick how-to for installing ImageMagick and Imagick on Cpanel server. I will cover only the procedure using the Cpanel built-in scripts, although you can also install it the usual way (rpm or source install). ImageMagick is the application for working with images while the Imagick is a PHP extention to modify/create images using the ImageMagick API.

Installation:

ImageMagick
Check first if it’s installed:
/scripts/checkimagemagick
Proceed with Installation:
/scripts/installimagemagick
Installation will take a couple minutes as it will install other packages needed by ImageMagick. After the installation, you can check your ImageMagick version:
/usr/bin/convert --version
It will give you something like:
Version: ImageMagick 6.4.8 2009-05-11 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC

Imagick
Go to WHM -> Software -> Module Installers -> PHP Pecl (manage). On the box below “Install a PHP Pecl” enter “imagick” and click “Install Now” button – that’s all.

Restart Apache and check your phpinfo page to see the details of Imagick and ImageMagick as well. See linked images for reference: image1, image2.

Uninstall:

If you decide to uninstall it’s as easy as the installation process:
ImageMagick: /scripts/cleanimagemagick
Imagick: WHM -> Software -> Module Installers -> PHP Pecl (manage). Click on Uninstall button for Imagick.


Source installation steps
=========================



If you need the version ImageMagick-6.4.9-2 to be installed on your cPanel dedicated server, we have followed the below steps which worked perfectly.

First, download the tar using the below command:

root# wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz

root# tar -zxvf ImageMagick.tar.gz
root# cd ImageMagick-6.4.9-2
root#./configure
root# make
root# make install

You can check the path for the installed ImageMagick by the command:

root# which convert
/usr/local/bin/convert

root# convert -v | head -n 1 | cut -c 22-26
6.4.9

OR

root# convert -v | grep Version:
Version: ImageMagick 6.4.9-2 2009-02-07 Q16 OpenMP http://www.imagemagick.org

That’s it!
==========================================================================================
Method 2

Installing ImageMagick 6.3.8 on a cPanel Server
Written by wiredgorilla
Wednesday, 23 January 2008
This tutorial will give you a little step by step manual of how to upgrade and properly install ImageMagick on you cPanel server without having to manually compile Apache

Firstly we need to talke notice that the new easyApache version 3 does not incude ImageMagick as an additional install option in PHP, so here are the steps we performed to get that magic wand happening again.

1/ downolad ImageMagic 6.3.8. onto your server by using

wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-6.4.3-6.zip

unzip ImageMagick-6.4.3-6.zip

go into the directory

cd ImageMagick-6.4.3-6

the default should be fine , but you can always check other options here Install-unix.txt

anyways, default install is simple

./configure

make install

Both of the commands can take a little while , but either way this should have installed ImageMagick 6.3.8 now. And now to finish the process

cd PerlMagick/
perl Makefile.PL
make
make install

BUT HOLD ON, this is not it yet!

We need to get it locked into PHP !

The new WHM has a fantastic utility to complete the task.

Log into WHM >> Software >> Module Installers >> PHP Pecl and install imagick to get the whole thing binding into PHP and making your applications gell ! :)

Below you can find a pic in WHM

That should be it, if by any chance you hot a problem with a 64 bit OS and WHM can not find imagick then install it manually, by following the steps below



Firstly install ImageMagick-devel

yum -y install ImageMagick-devel

Assuming ImageMagick-devel is installed, you need to download the Imagick PHP extensions, located here: http://pecl.php.net/package/imagick

Latest version, as of this post, is imagick-2.2.0

wget http://pecl.php.net/get/imagick-2.2.0.tgz

Place this package in your home directory. Then, in a shell console, type
tar -zxvf imagick-2.2.0 .tgz

while in the home directory (don't type the quotes)

Then type the following commands:

cd imagick-2.2.0
phpize
./configure

make
make install

Now go back into WHM and try to activate imagick again
===========================================================================================

Saturday, May 29, 2010

Mysql issue

root@cpmouse [/var/lib/mysql]# ll
total 20556
drwxr-xr-x 4 mysql mysql 4096 May 30 04:29 ./
drwxr-xr-x 29 root root 4096 May 30 04:21 ../
-rw-rw---- 1 mysql root 5378 May 30 04:29 cpmouse.ecdsystem.com.err
-rw-rw---- 1 mysql mysql 5 May 30 04:29 cpmouse.ecdsystem.com.pid
-rw-rw---- 1 mysql mysql 5 May 30 04:28 cpmouse.pid
-rw-rw---- 1 mysql mysql 10485760 May 30 04:29 ibdata1
-rw-rw---- 1 mysql mysql 5242880 May 30 04:29 ib_logfile0
-rw-rw---- 1 mysql mysql 5242880 May 30 04:26 ib_logfile1
drwx--x--x 2 mysql mysql 4096 May 30 04:22 mysql/ - contain mysql user privilege
srwxrwxrwx 1 mysql mysql 0 May 30 04:29 mysql.sock=
drwxr-xr-x 2 mysql mysql 4096 May 30 04:21 test/

/var/lib/mysql - remove
/usr/sbin/mysqd - remove

grant all privileges on virus_UC.* to virus_UC@localhost identified by '04241988';

/scripts/mysqlup --force

/var/cpanel/cpanel.config

Friday, May 28, 2010

BSNL Broadband configuration Linux

BSNL Broadband configuration Linux

I was seeing constant threads at orkut regarding configuration of internet on linux. This guide I hope will help you establish the BSNL broadband connection on your linux box. I assume that you have configured your network interface (if not then I am going to post a similar post regarding howto configure it).

This document is a copy of a document which I saw in late 2004 when I was searching for a howto to configure internet in linux.

This document describes howto setup bsnl broadband service on your gnu/linux server/desktop. It assumes that you are neither linux beginer nor an expert. It assumes that you are aware of basic gnu/linux commands.

I have installed it on redhat 9. I dont find any reason why it would not work on following distributions:

* FC1
* FC2
* FC3
* FC4
* FC5

An unofficial FAQ on Dataone can be found here

Pre-Requisites

* Please ensure that you have connected a working ethernet card which is supported on gnu/linux. Test the ethernet card & ensure that it is working.
* Root access to a gnu/linux box

Before we start, please ensure that you have the following details on hand:

* BSNL Broadband connection -:)
* Username & Password


Using the builtin dialer
A HOWTO with instructions on using the PPPoE builtin dialer of the Huawei SmartAX MT800 ADSL router is available.
The procedure to configure the dialer in UTStarCom UT300R modem is given here

Using RP-PPPOE as dialer
Installation

* As BSNL broadband is using rp-pppoe (Roaring Penguin - Point to Point Over Ethernet), we would be required to download & install this package. This package is normally available on most of the distributions. But, if you are using redhat7.3, please download the following packages:

rpm package command line
rpm package GUI
source code

If you are downloading the tar.gz version, you have to build the rpm first. So, please walk through the following procedure to build the rpm:

Procedure to build RPM from tar.gz.


1. Login as root
2. Download tar.gz version & execute the following commands
# tar -zxvf rp-pppoe-3.5.tar.gz (untar this package)
* This command would untar the package in the current directory.
# cp rp-pppoe-3.5.tar.gz /usr/src/redhat/SOURCES/
# cd rp-pppoe-3.5
* The rpm spec file, rp-pppoe.spec is available in this directory.
# cp rp-pppoe.spec /usr/src/redhat/SPECS/
# cd /usr/src/redhat/SPECS
# rpm -ba rp-pppoe.spec
* The above command would untar the tar.gz package in ../BUILD
directory, compile the package and finally it would create neces
sary rpms in

If everything goes fine, you would see the following or similar message:

Wrote: /usr/src/redhat/SRPMS/rp-pppoe-3.5-1.src.rpm
Wrote: /usr/src/redhat/RPMS/i386/rp-pppoe-3.5-1.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/rp-pppoe-gui-3.5-1.i386.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.97349
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd rp-pppoe-3.5
+ rm -rf /tmp/pppoe-build
+ exit 0

If this is the case, the necessary rpms are successfully created and they are available in appropriate directory.

Source RPMS - /usr/src/redhat/SRPMS/rp-pppoe-3.5-1.src.rpm
Binary RPMS - /usr/src/redhat/RPMS/i386/rp-pppoe-3.5-1.i386.rpm
GUI RPMS - /usr/src/redhat/RPMS/i386/rp-pppoe-gui-3.5-1.i386.rpm

Now, at this stage you are having necessary rpms with you. Either you have downloaded them from the above website. Or you would have built them on your own:
Command Line Version

# rpm -vih rp-pppoe-3.5-1.i386.rpm

It would install the command line version of rp-pppoe package.
GUI Version

# rpm -vih rp-pppoe-gui-3.5-1.i386.rpm

It would install the gui version of rp-pppoe package. If you have successfully installed, then you can proceed to next section.
Configuration

Once you have installed rp-pppoe package, all necessary commands would have been installed.

adsl-setup - to configure the connection parameters
adsl-start - to start the connection
adsl-status - to check status of the connection
adsl-stop - to stop the connection

Now, we are ready to configure the BSNL broadband internet connection.

Here you have to configure the following parameters:

* userid
* network interface (eth0 or ..)
* Demand value (normally you can leave it blank)
* DNS Information (primary & secondary)

* With regard to primary & secondary dns, You can leave it blank, as it would be taken care automatically. If you wish to know the dns details, just complete this wizard and when you run adsl-start, do:

# tail -f /var/log/messages


Mar 15 15:29:48 Gateway pppd[3564]: Remote message: Authentication success,Welcome!
Mar 15 15:29:48 Gateway pppd[3564]: local IP address 59.92.9.154
Mar 15 15:29:48 Gateway pppd[3564]: remote IP address 59.92.8.1
Mar 15 15:29:48 Gateway pppd[3564]: primary DNS address 61.1.96.69
Mar 15 15:29:48 Gateway pppd[3564]: secondary DNS address 61.1.96.71

There it goes! The primary & secondary dns details are found and it would be automatically updated in /etc/resolv.conf.

* Then you should enter the following details:

* Password
* Firewall (set is to 2, MASQUERADE)
* Confirm

* The following is the screen shot of adsl-setup command.

# adsl-setup
Welcome to the Roaring Penguin ADSL client setup. First, I will run
some checks on your system to make sure the PPPoE client is installed
properly...

Looks good! Now, please enter some information:

USER NAME

>>> Enter your PPPoE user name (default test@dataone):

INTERFACE

>>> Enter the Ethernet interface connected to the ADSL modem
For Solaris, this is likely to be something like /dev/hme0.
For Linux, it will be ethn, where 'n' is a number.
(default eth0):

Do you want the link to come up on demand, or stay up continuously?
If you want it to come up on demand, enter the idle time in seconds
after which the link should be dropped. If you want the link to
stay up permanently, enter 'no' (two letters, lower-case.)
NOTE: Demand-activated links do not interact well with dynamic IP
addresses. You may have some problems with demand-activated links.
>>> Enter the demand value (default no):

DNS

Please enter the IP address of your ISP's primary DNS server.
If your ISP claims that 'the server will provide DNS addresses',
enter 'server' (all lower-case) here.
If you just press enter, I will assume you know what you are
doing and not modify your DNS setup.
>>> Enter the DNS information here: 61.1.128.5
Please enter the IP address of your ISP's secondary DNS server.
If you just press enter, I will assume there is only one DNS server.
>>> Enter the secondary DNS server address here: 61.0.0.5

PASSWORD

>>> Please enter your PPPoE password:
>>> Please re-enter your PPPoE password:

FIREWALLING

Please choose the firewall rules to use. Note that these rules are
very basic. You are strongly encouraged to use a more sophisticated
firewall setup; however, these will provide basic security. If you
are running any servers on your machine, you must choose 'NONE' and
set up firewalling yourself. Otherwise, the firewall rules will deny
access to all standard servers like Web, e-mail, ftp, etc. If you
are using SSH, the rules will block outgoing SSH connections which
allocate a privileged source port.

The firewall choices are:
0 - NONE: This script will not set any firewall rules. You are responsible
for ensuring the security of your machine. You are STRONGLY
recommended to use some kind of firewall rules.
1 - STANDALONE: Appropriate for a basic stand-alone web-surfing workstation
2 - MASQUERADE: Appropriate for a machine acting as an Internet gateway
for a LAN
>>> Choose a type of firewall (0-2): 2

** Summary of what you entered **

Ethernet Interface: eth0
User name: test@dataone
Activate-on-demand: No
Primary DNS: 61.1.128.5
Secondary DNS: 61.0.0.5
Firewalling: MASQUERADE

>>> Accept these settings and adjust configuration files (y/n)? y
Adjusting /etc/ppp/pppoe.conf
Adjusting /etc/resolv.conf
(But first backing it up to /etc/resolv.conf-bak)
Adjusting /etc/ppp/pap-secrets and /etc/ppp/chap-secrets
(But first backing it up to /etc/ppp/pap-secrets-bak)
(But first backing it up to /etc/ppp/chap-secrets-bak)



Congratulations, it should be all set up!

Type 'adsl-start' to bring up your ADSL link and 'adsl-stop' to bring
it down. Type 'adsl-status' to see the link status.


Internet Connection

Now, if you see this Congrats! message, then you are all set & done. You can type,
# adsl-start ..Connected! #

Thats it. The bsnl broadband setup has been installed & configured.

At this point, you can go through the man pages of appropriate adsl-* commands for details.

Hope this article helps you out in configuring internet on linux specially for the redhat persons. I will soon post a article regarding configuring network interfaces on linux and other stuff related to it.

Tuesday, May 25, 2010

Folder protection

http://www.golivecentral.com/pages/txttut/htacc.shtml

Site redirect rule setup

http://kb.mediatemple.net/questions/242/How+do+I+redirect+my+site+using+a+.htaccess+file%3F

Increase file size upload limit using php.ini or htaccess

Increasing file upload size by php.ini

File upload size affected by mainly below PHP settings.
file_uploads = On
This setting must be on. It allows running uploads through HTTP.
Ensure this value is on the value can be On/Off or 1/0 or true/false.
upload_max_filesize = 20M
This value limits the size of uploaded single file. Give it value what ever your requirements.
post_max_size = 40M
This value limits the size of all the uploaded content. For example upload_max_filesize is for single file, if we upload 3 files simultaneously each 15mb total 45mb so it exceeds post_max_size.
Remember post_max_size must be larger about 40% of upload_max_filesize.

max_execution_time = 30
Generally image uploading and manipulating with GD or Imagemagic consumes much time. So it may exceeds 30 seconds. You can modify whatever your requirements. When a script execution time exceeded by this limit the server stops the scripts or gives fatal error.

memory_limit = 128M
Generally image uploading and manipulation with GD or Imagemagic consumes much server memory. When it exceeds this memory the server stops executing the script, then we see empty page or no response from server or we get a fatal error.

Completed example, to increase 10Mb
upload_max_filesize = 10M ;
post_max_size = 20M ;
memory_limit = 128M

Copy the above settings into your php.ini and put it in your web root directory.
Increasing file upload size by .htaccess

php_value upload_max_filesize 10M
php_value post_max_size 20M
php_value memory_limit 128M

Copy the above settings into your .htaccess file and put it in your web root directory.
Almost all web host providers give to override the .htacces ,so you can use above method.

Monday, May 24, 2010

Sturcture Of Cpanel

–Directory Structure of Cpanel
=======================

Apache
=======
/usr/local/apache
+ bin- apache binaries are stored here – httpd, apachectl, apxs
+ conf – configuration files – httpd.conf
+ cgi-bin
+ domlogs – domain log files are stored here
+ htdocs
+ include – header files
+ libexec – shared object (.so) files are stored here – libphp4.so,mod_rewrite.so
+ logs – apache logs – access_log, error_log, suexec_log
+ man – apache manual pages
+ proxy -
+ icons -

Init Script :/etc/rc.d/init.d/httpd – apache start script
Cpanel script to restart apache – /scripts/restartsrv_httpd

Exim
=====
Conf : /etc/exim.conf – exim main configuration file
/etc/localdomains – list of domains allowed to relay mail
Log : /var/log/exim_mainlog – incoming/outgoing mails are logged here
/var/log/exim_rejectlog – exim rejected mails are reported here
/var/log/exim_paniclog – exim errors are logged here
Mail queue: /var/spool/exim/input
Cpanel script to restart exim – /scripts/restartsrv_exim
Email forwarders and catchall address file – /etc/valiases/domainname.com
Email filters file – /etc/vfilters/domainname.com
POP user authentication file – /home/username/etc/domainname/passwd
catchall inbox – /home/username/mail/inbox
POP user inbox – /home/username/mail/domainname/popusername/inbox
POP user spambox – /home/username/mail/domainname/popusername/spam
Program : /usr/sbin/exim (suid – -rwsr-xr-x 1 root root )
Init Script: /etc/rc.d/init.d/exim

ProFTPD
========
Program :/usr/sbin/proftpd
Init Script :/etc/rc.d/init.d/proftpd
Conf: /etc/proftpd.conf
Log: /var/log/messages, /var/log/xferlog
FTP accounts file – /etc/proftpd/username – all ftp accounts for the domain are listed here

Pure-FTPD
=========
Program : /usr/sbin/pure-ftpd
Init Script :/etc/rc.d/init.d/pure-ftpd
Conf: /etc/pure-ftpd.conf
Anonymous ftp document root – /etc/pure-ftpd/ip-address

Frontpage Extensions
=================
Program – (Install): /usr/local/frontpage/version5.0/bin/owsadm.exe
Uninstall and then install for re-installations
FP files are found as _vti-bin, _vti-pvt, _vti-cnf, vti-log inside the public_html

Mysql
=======
Program : /usr/bin/mysql
Init Script : /etc/rc.d/init.d/mysql
Conf : /etc/my.cnf, /root/.my.cnf
Data directory – /var/lib/mysql – Where all databases are stored.
Database naming convention – username_dbname (eg: john_sales)
Permissions on databases – drwx 2 mysql mysql
Socket file – /var/lib/mysql/mysql.sock, /tmp/ mysql.sock

SSHD
======
Program :/usr/local/sbin/sshd
Init Script :/etc/rc.d/init.d/sshd
/etc/ssh/sshd_config
Log: /var/log/messages

Perl
====
Program :/usr/bin/perl
Directory :/usr/lib/perl5/5.6.1/

PHP
====

Program :/usr/local/bin/php, /usr/bin/php
ini file: /usr/local/lib/php.ini – apache must be restarted after any change to this file
php can be recomplied using /scripts/easyapache

Named(BIND)
============
Program: /usr/sbin/named
Init Script: /etc/rc.d/init.d/named
/etc/named.conf
db records:/var/named/
/var/log/messages

————————————————————————————————————————————–

Cpanel installation directory structure
=============================
/usr/local/cpanel
+ 3rdparty/ – tools like fantastico, mailman files are located here
+ addons/ – AdvancedGuestBook, phpBB etc
+ base/ – phpmyadmin, squirrelmail, skins, webmail etc
+ bin/ – cpanel binaries
+ cgi-sys/ – cgi files like cgiemail, formmail.cgi, formmail.pl etc
+ logs/ – cpanel access log and error log
+ whostmgr/ – whm related files

WHM related files
===============
/var/cpanel – whm files
+ bandwidth/ – rrd files of domains
+ username.accts – reseller accounts are listed in this files
+ packages – hosting packages are listed here
+ root.accts – root owned domains are listed here
+ suspended – suspended accounts are listed here
+ users/ – cpanel user file – theme, bwlimit, addon, parked, sub-domains all are listed in this files
+ zonetemplates/ – dns zone template files are taken from here

Common CPanel scripts
===================
cpanel/whm Scripts are located in /scripts/
+ addns – add a dns zone
+ addfpmail – Add frontpage mail extensions to all domains without them
+ addfpmail2 -Add frontpage mail extensions to all domains without them
+ addnetmaskips – Add the netmask 255.255.255.0 to all IPs that have no netmask
+ addnobodygrp – Adds the gorup nobody and activates security
+ addpop – add a pop account
+ addservlets – Add JSP support to an account (requires tomcat)
+ addstatus – (Internal use never called by user)
+ adduser – Add a user to the system
+ bandwidth – (OLD)
+ betaexim – Installs the latest version of exim
+ biglogcheck – looks for logs nearing 2 gigabytes in size
+ bsdcryptoinstall – Installs crypto on FreeBSD
+ bsdldconfig – Configures the proper lib directories in FreeBSD
+ bsdpkgpingtest – Tests the connection speed for downloading FreeBSD packages
+ buildbsdexpect – Install expect on FreeBSD
+ builddomainaddr – (OLD)
+ buildeximconf – Rebuilds exim.conf
+ buildpostgrebsd-dev – Installs postgresql on FreeBSD.
+ chcpass – change cpanel passwords
+ easyapache – recompile/upgrade apache and/or php
+ exim4 – reinstall exim and fix permissions
+ fixcommonproblems – fixes most common problems
+ fixfrontpageperm – fixes permission issues with Front Page
+ fixmailman – fixes common mailman issues
+ fixnamed – fixes common named issues
+ fixndc – fixes rndc errors with named
+ fixquotas – fixes quota problems
+ fullhordereset – resets horde database to a fresh one – all previous user data are lost
+ initquotas – initializes quotas
+ installzendopt – installs zend optimizer
+ killacct – terminate an account – make sure you take a backup of the account first
+ mailperm – fixes permission problems with inboxes
+ park – to park a domain
+ pkgacct – used to backup an account
+ restartsrv – restart script for services
+ restorepkg – restores an account from a backup file ( pkgacct file)
+ runlogsnow – update logs of all users
+ runweblogs – update stats for a particular user
+ securetmp – secures /tmp partition with options nosuexec and nosuid
+ suspendacct – suspends an account
+ unsuspendacct – unsuspends a suspended account
+ upcp – updates cpanel to the latest version
+ updatenow – updates the cpanel scripts
+ updateuserdomains – updates userdomain entries

Important cpanel/whm files
====================
/etc/httpd/conf/httpd.conf – apache configuration file
/etc/exim.conf – mail server configuration file
/etc/named.conf – name server (named) configuration file
/etc/proftpd.conf – proftpd server configuration file
/etc/pure-ftpd.conf – pure-ftpd server configuration file
/etc/valiases/domainname – catchall and forwarders are set here
/etc/vfilters/domainname – email filters are set here
/etc/userdomains – all domains are listed here – addons, parked,subdomains along with their usernames
/etc/localdomains – exim related file – all domains should be listed here to be able to send mails
/var/cpanel/users/username – cpanel user file
/var/cpanel/cpanel.config – cpanel configuration file ( Tweak Settings )*
/etc/cpbackup-userskip.conf -
/etc/sysconfig/network – Networking Setup*
/etc/hosts -
/var/spool/exim -
/var/spool/cron -
/etc/resolv.conf – Networking Setup–> Resolver Configuration
/etc/nameserverips – Networking Setup–> Nameserver IPs ( FOr resellers to give their nameservers )
/var/cpanel/resellers – For addpkg, etc permissions for resellers.
/etc/chkserv.d – Main >> Service Configuration >> Service Manager *
/var/run/chkservd – Main >> Server Status >> Service Status *
/var/log/dcpumon – top log process
/root/cpanel3-skel – skel directory. Eg: public_ftp, public_html. (Account Functions–>Skeleton Directory )*
/etc/wwwacct.conf – account creation defaults file in WHM (Basic cPanel/WHM Setup)*
/etc/cpupdate.conf – Update Config *
/etc/cpbackup.conf – Configure Backup*
/etc/clamav.conf – clamav (antivirus configuration file )
/etc/my.cnf – mysql configuration file
/usr/local/Zend/etc/php.ini OR /usr/local/lib/php.ini – php configuration file
/etc/ips – ip addresses on the server (except the shared ip) (IP Functions–>Show IP Address Usage )*
/etc/ipaddrpool – ip addresses which are free
/etc/ips.dnsmaster – name server ips
/var/cpanel/Counters – To get the counter of each users.
/var/cpanel/bandwidth – To get bandwith usage of domain

Friday, May 21, 2010

Malware and apache directive exp link

http://httpd.apache.org/docs/1.3/mod/core.html#maxclients

http://www.rfxn.com/tag/malware/

Find Forwarder set account fro cpanel

#!/usr/local/bin/perl
#WHMADDON:aolforwardfinder:AOL Forwarder Finder
##----------------------------------------------------
## Version 1.0
##
## Usage:
##
## 1) Copy to "/usr/local/cpanel/whostmgr/docroot/cgi/" directory.
## 2) Rename to "addon_aolforwarderfinder.cgi".
## 3) Chown to root:root.
## 4) Chmod to 755.
## 5) Log into WHM as user with root privs and click the link
## called "AOL Forwarder Finder" under the Add-ons section.
##----------------------------------------------------



BEGIN {

push(@INC,'/usr/local/cpanel','/usr/local/cpanel/Cpanel');

push(@INC,"/usr/local/cpanel/whostmgr/docroot/cgi");

}



use whmlib;



#--------------------------------

my $delimiter = "::";

#--------------------------------



print "Content-type: text/html\r\n\r\n";

defheader("AOL Forwarder Finder");



#-------------------------------------

if (!$ACL{all}) {

print "

Sorry, but this function may only be run by the server
administrator.

";

exit();

}



#-------------------------------------

# Start main work.



&printscriptinfo;



my @aolforwarders;

my @print;



chdir("/etc/valiases");

@aolforwarders = `grep -i \@aol. *`;



if (! @aolforwarders) {

print "

There were no \@aol forwarders found. Lucky!

";

exit();

}



foreach my $line (@aolforwarders) {

my $owner;

my $realdomain;

my $reseller;



my @aols;

my @aoladdresses;



my ($domain, $forwarder, $addresses) = split(/:/, $line);

$owner = `/scripts/whoowns $domain`;

$realdomain = &domainname($owner);

$reseller = &findreseller($owner);



@aoladdresses = split(/,/, $addresses);

my @aols;

foreach (@aoladdresses) {

$_ = &trim($_);

if ($_ =~ /aol.com/i) {

push(@aols, $_);

}

}



if ($forwarder eq "*") {

$forwarder = "default address";

}

foreach(@aols) {

push(@print, $reseller . $delimiter .
$realdomain . $delimiter . $domain . $delimiter . $forwarder . $delimiter .
$_ . "\n
");

}

}



# Print results.

@print = sort { $a cmp $b } @print;

foreach(@print) {

print($_);

}





## Subroutines

sub trim {

my $string = shift(@_);

$string =~ s/\s//g;

return $string;

}



sub domainname {

my $user;

my $domain;



$user = $_[0];



open(CPU,"/var/cpanel/users/" . $user);

while() {

if (/^DNS=(\S+)/) {

$domain = $1;

}

}



close(CPU);



return $domain;

}



sub findreseller {

my $user;

my $reseller;



$user = $_[0];

open(CPU,"/var/cpanel/users/" . $user);

while() {

if (/^OWNER=(\S+)/) {

$reseller = $1;

}

}

close(CPU);



#if ($reseller ne "root") {

return &domainname($reseller);

#}

#else {

# return "NOT RESOLD";

#}

}



sub printscriptinfo {

print "

This script shows a list of all email forwarders
on the server that are set up to forward email to AOL.

[reseller's
domain]
= The reseller who owns the [cpanel domain].
[cpanel
domain]
= The main cpanel domain where the forwarder is located./>[forwarder domain] = The actual domain for the forwarder. (ie: It
might be an add-on or parked domain.)
[forwarder address] = The
actual email address that is doing the forwarding.
[aol address]
= The destination/target email address.

";

print "

[reseller's domain] " . $delimiter . " [cpanel
domain] " . $delimiter . " [forwarder domain] " . $delimiter . " [forwarder
address] " . $delimiter . " [aol address]

";

}

Thursday, May 20, 2010

Knowledged base

http://kb.deru.net/?View=entry&EntryID=94 - Exim

iptables -I INPUT -p tcp --dport 25 -j ACCEPT

http://forums.cpanel.net/f5/hunt-spammers-find-who-sent-spam-nobody-34195.html
http://www.layeredtech.com/forums/showthread.php?t=75

http://66.90.111.132:7700/
http://www.webhostgear.com/396.html
http://www.webhostingtalk.com/showthread.php?t=227645

Tuesday, May 18, 2010

Mysql commands

You will start by logging into your server via ssh and logging into your MySQL entering the following:

mysql –uadmin –p`cat /etc/psa/.psa.shadow`


Grant Privilege

GRANT SELECT ON database.* TO username@'localhost' IDENTIFIED BY 'password';

To enable more options you would separate them with a comma. So to enable SELECT, INSERT, and DELETE your syntax would look like this;

GRANT SELECT, INSERT, DELETE ON database.* TO username@'localhost' IDENTIFIED BY 'password';

Once you have given the desired privileges for your user, you will need to run this command within the MySQL command prompt;

FLUSH PRIVILEGES;

To see a list of the privileges that have been granted to a specific user;

select * from mysql.user where User='user' \G

Saturday, May 15, 2010

Band

http://forum.soluslabs.com/showthread.php?1102-Bandwidth-is-not-updating-for-a-new-vps-in-my-admincp-

http://www.nocser.net/clients/knowledgebase/342/Install-solusvm.html

crontab -e
*/2 * * * * /usr/bin/php -f /usr/local/solusvm/system/vzbw.php >/dev/null 2>&1
save

chmod 0744 /etc/cron.d/solusvm ( 0744 makes sure the executable bit is set to be able to actually run these jobs ;-) )

should show -rwxr--r--

Friday, May 14, 2010

LVM creation method + solusVM

http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/sysadmin-guide/s1-lvm-diskdruid-manual.html

solusVM setup

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/sda2
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-164.15.1.el5xen)
root (hd0,0)
kernel /xen.gz-2.6.18-164.15.1.el5 dom0_mem=2048M
module /vmlinuz-2.6.18-164.15.1.el5xen ro root=LABEL=/
module /initrd-2.6.18-164.15.1.el5xen.img
title CentOS (2.6.18-164.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-164.el5 ro root=LABEL=/
initrd /initrd-2.6.18-164.el5.img


Slave server partition

Filesystem Size Used Avail Use% Mounted on
/dev/sda2 123G 2.4G 115G 3% /
/dev/sda1 99M 19M 75M 21% /boot
tmpfs 1.0G 0 1.0G 0% /dev/shm
none 1.0G 104K 1.0G 1% /var/lib/xenstored

[root@slaveserver template]# fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 16586 133122622+ 83 Linux
/dev/sda3 16587 18626 16386300 82 Linux swap / Solaris
/dev/sda4 18627 60801 338770687+ 5 Extended
/dev/sda5 18627 60801 338770656 8e Linux LVM

Disk /dev/sdb: 640.1 GB, 640135028736 bytes
255 heads, 63 sectors/track, 77825 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

Volume group not found error:
/usr/local/solusvm/data/allow.dat - Master server ip in master server


[root@slaveserver template]# vgdisplay
--- Volume group ---
VG Name vg1
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 23
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 323.06 GB
PE Size 32.00 MB
Total PE 10338
Alloc PE / Size 3232 / 101.00 GB
Free PE / Size 7106 / 222.06 GB
VG UUID 1ns1U1-nl1E-OgSG-KDco-r62t-59Hs-rNedzz

[root@slaveserver template]# lvdisplay
--- Logical volume ---
LV Name /dev/vg1/vm101_img
VG Name vg1
LV UUID HzdrFA-CGzV-lFjR-lYRd-40p4-0oBR-1TYh2m
LV Write Access read/write
LV Status available
# open 0
LV Size 100.00 GB
Current LE 3200
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0

--- Logical volume ---
LV Name /dev/vg1/vm101_swap
VG Name vg1
LV UUID DaxzeY-Jsl2-FQjl-PA7k-CSfm-A97L-m8fXfZ
LV Write Access read/write
LV Status available
# open 0
LV Size 1.00 GB
Current LE 32
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1

netstat -tn|grep :80|awk '{print $5}'|cut -d: -f4|sort|uniq -c|sort -rn|head
netstat -tn|grep :80|awk '{print $5}'|cut -d: -f1|sort|uniq -c|sort -rn|head

http://forums.cpanel.net/f5/login-webmail-internal-server-error-user-over-quota-141325.html
Template downloaded path /home/solusvm/xen/template in master server

Template url: http://files.soluslabs.com/solusvm/templates/xen/

Thursday, May 13, 2010

SolusVM slave server partition method

http://forum.soluslabs.com/showthread.php?1117-Can-not-create-new-xen-vps

FFmpeg convertion

MP4Box:
/usr/local/bin/MP4Box -inter 0.2 -add /var/www/vhosts/whatspoppin.net/httpdocs/new_test/video_95.flv /var/www/vhosts/whatspoppin.net/httpdocs/new_test/video_95_conv.flv

Mencoder:
/usr/local/bin/mencoder /var/www/vhosts/whatspoppin.net/httpdocs/new_test/video_165.avi -o /var/www/vhosts/pulseter.com/httpdocs/new_test/new_flv.flv -of lavf -oac mp3lame -lameopts abr:br=56 -ovc lavc -lavcopts

Please use the following command instead of the above command set.

/usr/local/bin/mencoder /var/www/vhosts/whatspoppin.net/httpdocs/new_test/video_165.avi -o /var/www/vhosts/whatspoppin.net/httpdocs/new_test/convert_new.flv -of lavf -oac mp3lame -lameopts abr:br=56 -ovc lavc -lavcopts vcodec=flv:vbitrate=500:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 -srate 22050

FFMPEG:
/usr/local/bin/ffmpeg -i '/var/www/vhosts/whatspoppin.net/httpdocs/new_test/converted_flv.flv' -acodec 'libmp3lame' -ab 128k -vcodec 'libx264' -vpre hq -crf 22 -threads 0 -f mp4 /var/www/vhosts/whatspoppin.net/httpdocs/new_test/libx264_test_new.mp4

Prevent Directory listing

Options -Indexes

SolusVm memory fix

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol01
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-164.15.1.el5xen)
root (hd0,0)
kernel /xen.gz-2.6.18-164.15.1.el5 dom0_mem=512M
module /vmlinuz-2.6.18-164.15.1.el5xen ro root=/dev/VolGroup00/LogVol01
module /initrd-2.6.18-164.15.1.el5xen.img
title CentOS (2.6.18-164.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-164.el5 ro root=/dev/VolGroup00/LogVol01
initrd /initrd-2.6.18-164.el5.img