Drug preguntas

How to run Cpanel backup process during server load.

Cpanel No Comments »

This is not advised as it will place tremendous load upon your server

With that said:

1. open /scripts/cpbackup in your favorite text editor.
2. find ’sub cpusystem’ (without the quotes)
3. Change the nested if/elsif/else block to resemble:

else {
        #if ( -e "$CPCONF{'root'}/bin/cpuwatch" ) {
        #   exec( "$CPCONF{'root'}/bin/cpuwatch", "$cpunum.0", @_ );
        #}
        #elsif ( -e "$CPCONF{'root'}/bin/logrunner" ) {
        #    exec( "$CPCONF{'root'}/bin/logrunner", "$cpunum.0", @_ );
        #}
        #else {
            exec(@_);
        #}
        exit 1;
    }

4. Save the file and exit the editor
5. execute /scripts/cpbackup –force

The code changes disable the use of the process load monitors (cpuwatch and logrunner).

Search Engine Friendly URL check.

Linux No Comments »

Searching Friendly URL checker

How to redirect a webpage with search enging friendly URL

cPanel: PhpMyAdmin socket error

Cpanel No Comments »

MySQL Socket Error in phpMyAdmin

While accessing phpMyAdmin, you may get the following error.

—————————————————————————————–
#2002 - The server is not responding (or the local MySQL server’s socket is not correctly configured)
—————————————————————————————–

This is due to the missing socket file in the location /tmp.

The socket path which is specified in the phpMyAdmin configuration file is /tmp/mysql.sock.

$ vi /usr/local/cpanel/base/3rdparty/phpMyAdmin/config.inc.php
cfg['Server']['socket'] = ‘/tmp/mysql.sock’;

If mysql.sock is missing in /tmp, then create a link to the mysql.sock file in /var/lib/mysql.

$ ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

There is also another fix for this issue.

1. Open the phpMyadmin config file “config.inc.php”.
————————————————————-
vi /usr/local/cpanel/base/3rdparty/phpMyAdmin/config.inc.php
————————————————————-

2.Locate the line:
—————————————————
$cfg['Servers'][$i]['host'] = ‘localhost’;
—————————————————

3.Replace ‘localhost’ with ‘127.0.0.1′ and save.
—————————————————
$cfg['Servers'][$i]['host'] = ‘127.0.0.1′;
—————————————————

This will also fix the issue.

Changing time zone in .htaccess

.htaccess No Comments »

You may need to show the time in your website, but the server time zone may not match with your time zone. In this case, you can set your time zone by editing .htaccess file.

Open your .htaccess file and add the rule “SetEnv TZ location”

‘location’ is the specific timezone you want to set.

You can select your time zone from the list.
http://www.php.net/manual/en/timezones.php

Shared server update.

Apache No Comments »

An Apache module for embedding the Python enterpreter within the Apache server, like mod_php which is the most common way of deploying PHP on a web server. Mod_python is more powerful in the way that it gives more access to Apache internals so you can do more advanced stuff. But this is a problem in
a shared environment because it’s possible to do things to Apache that will affect other websites using the same Apache instance.

Apache modules run as the user name “Nobody” which means, if a file was writable, any client on the server using mod_python would be able to overwrite other clients files which is a security risk on a shared
environment.

550 “REJECTED - Bad HELO - Host impersonating

Exim No Comments »

I have found this error in exim mail server. To resolve this issue,

1)Login to your server

2)vi /etc/exim.conf

find the term helo under “drop” and delete the rule which is causing trouble. If the error is like,

550 "REJECTED - Bad HELO - Host
impersonating [serverhostname]

Delete the hostname rule for drop.

How to scan using Clamav??

Cpanel No Comments »

Use this command

#clamscan filename

#clamscan *

How to change time zone for different users in a server??

PHP No Comments »

If My server is in US and i’m from India

Solution is quite simple:
In PHP after mysql_connect and mysql_select_db functions just execute:
SET time_zone = ‘kN:00′
where
k = {+, -}
N = [1-24]
so for example SET time_zone = ‘+5:30′  [need to change this value according to your country]

after that NOW() will return proper time.

Cpanel Introduction

Cpanel No Comments »

Cpanel Introduction
——————–

Cpanel Important directories.

/usr/local/cpanel
/var/cpanel
/scripts

/usr/local/cpanel
—————
cpsrvd
cpsrvd-ssl
cpkeyclt

/usr/local/cpanel/bin
——————-

*Houses only scripts and binaries which provide installation
and configuration of many cPanel managed services

Notable Contents:
eximstats
checkperlmodules

/usr/local/cpanel/logs
——————–

CPSRVD ——-access_log, error_log
CPANELLOGD—stats_log
CPKEYCLT——license_lo

/usr/local/cpanel/base
——————–

frontend——-x, x2,xmail,monsoon
webmail——-x, monsoon
neomail
horde
3rdparty——-squirrelmail, phpPgAdmin, phpMyAdmin

/usr/local/cpanel/etc
——————-

init ———–start | stop cpsrvd AND start | stop AND start | stop cppop
exim———-cf, perl
ftptemplates —proftpd
httptemplates –apache1–default, ssldefault
zonetemplates–simple, standard, standardvirtualftp

/usr/local/cpanel/3rdparty
———————–
bin——php, stunnel, analog, awstats, webalizer
etc——php.ini, ixed, ioncube

/var/cpanel
———-
Houses proprietary configuration data for cPanel, including:
? Primary cPanel configuration
? User configurations
? Reseller configurations
? Accounting, conversion, and update logs
? Bandwidth data
? Customized service templates

/var/cpanel
———-

cpanel.conf
resellers
accounting.log
features–packages–logs
updatelogs–bandwidth–zone templates
users—mainips

/var/cpanel/cpanel.config
———————–
? The primary cPanel configuration file
? Each variable within influences the way cPanel behaves
? Variables are line delimited, with variables separated by an equal sign
? If file does not exist, cpanel falls back to defaults

/var/cpanel/resellers
——————

Lists each reseller with a comma-delimited list of WHM
resources that reseller has access to.

/var/cpanel/accounting.log
————————
Contains a list of accounting functions performed through
WHM, including account removal and creation.

/var/cpanel/bandwidth
——————–
? Files contain a list of the bandwidth history for each account.
Each named after their respective user.
? History files are stored in human-readable format, while actual
bandwidth data are stored in round robin databases.

/var/cpanel/features
——————

? File name is inherited from the feature list name
? Contains a line delimited list of feature variables and a zero or
one value
? Variables control what cPanel resources are available to users

/var/cpanel/packages
——————-

? Contains a list of packages, named after the packages they represent
? If package belongs to reseller, file name is prefixed with reseller name
? Each of these values determines the values created in cPanel user file

/var/cpanel/users
—————-

? Contains a list of cPanel user configuration files, named after the user
they pertain to.
? Variables define account resources, themes, domains, etc.

Other notable /var/cpanel directories
——————————–

? LOGS
– This directory contains logs from account copies/transfers.
Training Seminar 2006
? UPDATELOGS
– Contains the output of each cPanel update executed on the server.
? MAINIPS
– Named after the respective reseller users they represent, each
contains only the IP address which should be used as that
resellersmain shared ip
? ZONETEMPLATES
– Contains customized DNS zone templates created inWHM

/scripts
——-

This directory houses a large number of scripts which serve
as building blocks for many cPanel/WHM features.
The scripts can be used to:
? Update cPanel, and many of the services of which it
manages
? Customize account creation routines
? Perform backups of cPanel accounts
? Install and update cPanel managed services

cPanel Services
————-

Services
? CPSRVD
? CHKSERVD
? CPANELLOGD
? CPBACKUP
? EXIMSTATS

cpsrvd
——

? cpsrvd is the ‘master’ process for cPanel.
? Handles and dispatches all requests made through the cPanel,
WHM, and Webmail interfaces.
? Logs to access_log and error_log

cpsrvd and stunnel relationship
—————————

CPSRVD–2082–>cpanel<–2083<–stunnel
CPSRVD–2086–>WHM<–2087<–stunnel
CPSRVD–2095–>Webmail<–2096<–stunnel

SSL Certificates
————-

? Default certificate and key are stored in /
usr/local/cpanel/etc/cpanel.pem
? User installed cert and cabundle are stored in:
– /usr/local/cpanel/etc/mycpanel.pem
– /usr/local/cpanel/etc/mycpanel.cabundle

cPanel Startup
————

? The following services are controlled by the cPanel
init script
– cpsrvd, both plain and secure
– cPanel POP Services
– cPanel Log Services
– Eximstats
– Chat Services
– Mailman
– Interchange

? Verify if ports are in use
– netstat -lnp | egrep ‘20(8|9)’

Troubleshooting Startup Issues(SSL)
——————————-

? If SSL services are not available
– execute /usr/local/cpanel/startstunnel
– check /usr/local/cpanel/3rdparty/bin/stunnel.log
? If cpsrvd is not available
– execute it directly `/usr/local/cpanel/cpsrvd`
– check /usr/local/cpanel/logs/error_log

Licensing
——–

? License requests are handled by /usr/local/cpanel/cpkeyclt
? Requests are transmitted to auth.cpanel.net over port 2089
? License requests are logged to license_log
? License key is stored at /usr/local/cpanel/cpanel.lisc

A valid license request:
root@server [~]# /
usr/local/cpanel/cpkeyclt
Updating Internal cPanel
Information…..Done
root@server [~]#

Troubleshooting License Issues
—————————

CHECKLIST:
? Verify if license is active for main server IP at http://verify.cpanel.net
? Check if server can establish connection to auth.cpanel.net over port 2089
? If the previous steps fail, check license_log for notable errors.
? If license is active, but refused with no notable errors, lodge support request.

root@server [~]# telnet auth.cpanel.net 2089
Trying 198.66.78.9…
Connected to auth.cpanel.net (198.66.78.9).
Escape character is ‘^]’.
200 cPanel License Service Version 12.0
root@server [~]#

cPanel Requests
————–

cPanel Requests
? Logins are authenticated against the system passwd and shadow files.
? Documents root is /usr/local/cpanel/base
? Theme is defined by RS variable in user’s cPanel configuration file.
? Resources are limited by the feature list of assigned to the given user.

WHM Requests
————-

WHM Requests
? Root password will authenticate any reseller user
? Document root is /usr/local/cpanel/whostmgr/docroot/
? Reseller resources are limited by Access Control List
– Defined in WHM > Resellers > Reseller Center > Edit
Privileges/Nameservers
– Privileges are stored in /var/cpanel/resellers

cPanel Services
————–

Services
? CPSRVD
? CHKSERVD
? CPANELLOGD
? CPBACKUP
? EXIMSTATS

Service Monitoring
—————-
? Located at /usr/local/cpanel/libexec/chkservd
? chkservd is a scalable connection and process based service monitoring
tool
? Provides monitoring of CPU, Memory, and Disk usage
? chkservd scans services once every eight minutes
– Logs to /var/log/chkservd.log
? Alerts are dispatched to server contact defined in Basic cPanel/WHM
Setup

chkservd Configuration
——————–

? Monitored services are determined by values stored in /
etc/chkserv.d/chkservd.conf.
– Syntax: servicename:0 for no monitoring, servicename:1 for
monitoring
? Actions, expected responses, and failure events are defined in
service configuration files stored in /etc/chkserv.d/{servicename}
? Status files are stored in /var/run/chkservd/{servicename}
– Plus (+) sign for active, Minus (-) sign for failed

cpanellogd
———-

? cpanellogd is responsible for parsing and updating bandwidth logs, and dispatching
statistics generators on each account, per their individual configurations.
? Configured through Statistics Software Configuration and Tweak Settings in WHM
? Statistics are compiled and stored for each account in /home/{username}/tmp, with
each respective statistics application being assigned it’s own individual subdirectory.

/home/{username}/tmp —-webalizer, analog, awstats, urchin

? Optional server-wide statistics configurations are stored in /
etc/stats.conf, while user-specific configurations may reside in /home/
{username}/tmp.
? Notable Variables in /etc/stats.conf:
– BLACKHOURS: Comma separated list of numeric values, which
specify hours that logs may not be parsed.
– VALIDUSERS:Users which are allowed to supply their own
combination of statistics generators. By default users are
restricted to the generators defined by the administrator.

Calling cpanellogd
—————-

? cpanellogd is started with the cPanel service, but can be executed
directly with:
– No Argument: Daemonize, and wait for a suitable time to scan
logs
– One Argument (username): Execute an immediate statistics run
for the specified user, and exit once completed.
? Two scripts are available to provide these functions as well:
– /scripts/runlogsnow - Execute a full log run immediately
– /scripts/runweblogs {username} - Execute a log run for a single
user

Bandwidth Statistics
—————–

? Bandwidth statistics are accumulated from a combination of the
following cPanel managed services:
– HTTP
– EXIM
– IMAP / POP
– FTP
? Bandwidth data is logged to /usr/local/apache/domlogs/*bytes_log
? Parsed bandwidth data is stored in /var/cpanel/bandwidth

COMMON ISSUES
? Bandwidth parsing is taking an exceedingly long time to complete
– First check the size of the logs being parsed. Excessively large
log files can and typically will take a long time to complete.
– Additionally, if RRDtool is not installed, bandwidth parsing
performance will drop signifigantly.
? RRDtool can be installed by executing `/scripts/rrdtoolinstall`

Log Processing
————-

? Statistics are parsed for each child domain of the given account.
? Will be influenced by variables in /var/cpanel/cpanel.config
– Skip statistics generator
? skip{generator_name}
– Logs will be retained or deleted based on
? keeplogs – keep logs at the end of the month.
? dumplogs – dump logs after parsing

Common cpanellogd Issues
————————

? Statistics are stalling, or are taking unreasonable amounts of
time.
– Usually indiates that the server load average is consistently
exceeding the defined load limit.
? Limit is defined as ‘extracpus’ in /var/cpanel/cpanel.config
– Restrictive BLACKHOUR definitions in WHM > Statistics Software
Configuration.
– All other issues should be present in /
usr/local/cpanel/logs/stats_log

cPanel Backups
————-

GENERAL INFORMATION
? Backup configuration is performed in WHM > Backup > Configure
Backup
? cPanel backups are performed by /scripts/cpbackup, which is
configured by default to execute at 1:00 AM in the root crontab.
? Backup archives are created using the /scripts/pkgacct utility, and
may be restored using /scripts/restorepkg respectfully.
? Uses CPU resource limits based upon extracpus definition in
cpanel.config

Backup Configuration
——————-

BACKUP INTERVALS
? Backup script can be configured to operate in daily, weekly, and monthly intervals.
? Each interval is given it’s own respective directory within the backup root.
? Backup intervals are executed when the current time minus the last modification time
of the interval directory is less than or equal to zero.

BACKUP METHODS
—————-
Three backup methods are available:
? Standard: This method entails archiving the accounts, and storing
them at the specified path/mount point. This is the default method
used by the backup script.
? Incremental: This method uses rsync to incrementally backup user
data. This option will only operate locally, storing the data at the
specified path/mount point.
? Remote: This method transmits account archives to a specified ftp
server. Remote backups are typically more time consuming, and
more error prone when transmitting large accounts.

Common Backup Issues
——————–

? Backup intervals are not executed when expected.
– Modification times are incorrect or not functional
– System time is incorrect.
– Backups have not been defined to run on that day.
? Backups stall, or take an exceedingly long time to complete.
– Verify that the transmission rate to remote server is suitable
– Verify that server load average has not exceeded defined
resource limit.

? Can’t call method “login” on an undefined value
This indicates the host or passive setting is not properly
defined for remote backups.
? Unable to login to remote FTP server.
This indicates that either the username and password
were not specified, or are incorrect in the backup configuration.
? Can’t call method “prepare” on an undefined value
The password stored for the root mysql user in /root/.my.cnf is
incorrect. Reset or correct this password, and re-execute the backup
script.

eximstats
———

? The eximstats daemon is responsible for harvesting bandwidth
information from exim transactions.
? Continually monitors the exim_mainlog, and stores information in the
eximstats database, including host and sender information, message
size, and transaction times.
? Is started with the cPanel service, but can be called directly at /
usr/local/cpanel/bin/eximstats

? Heavily mysql dependent
– data is stored in the ‘eximstats’ database.
? ‘eximstats’ mysql user password is stored in /var/cpanel/eximstatspass.
– password is generated by /usr/local/cpanel/bin/eximstatspass
? Database can be installed by running /
usr/local/cpanel/bin/updateeximstats

cPanel Maintenance
—————–
? Update configuration
? Update scripts
? Applying updates

? By default, cPanel applies nightly updates at 2:13AM in the root crontab.
? /scripts/upcp dispatches these updates, using the following key
components:
– /scripts/updatenow - synchronize /scripts directory
– /scripts/sysup - updates cPanel managed rpms
– /scripts/rpmup - all other system updates
? Updates are logged to timestamped files in /var/cpanel/updatelogs
? Update configuration is stored in /etc/cpupdate.conf.

/etc/cpupdate.conf
—————–

? The following variables are available in cpupdate.conf:
– CPANEL = [ manual- ] stable | release | current | edge
This variable controls which update branch is used for
cPanel updates, and controls whether the updates are applied
manually or automatically (Default value: release)
– SYSUP = never (all other values are assumed true)
– RPMUP = never (all other values are assumed true)

CPANEL=current
RPMUP=daily
SYSUP=daily

? cPanel updates can be called outside of the regularly scheduled cron
time simply by executing /scripts/upcp.
? If cPanel components are missing or corrupted that were not replaced
with the regular cPanel update, they can be replaced by executing /
scripts/upcp –force

Components of upcp
——————

? /scripts/cpanelsync
? /scripts/updatenow
? /scripts/sysup
? /scripts/rpmup

/scripts/cpanelsync
—————–
? /scripts/cpanelsync is called upon by /scripts/updatenow and /
scripts/upcp
? Provides md5sum based synchronization with update servers
? md5sum table is stored in /destination_directory/.cpanelsync
? Accepts three arguments host, remote path, local path :
/scripts/cpanelsync ‘httpupdate.cpanel.net’
‘/cpanelsync/RELEASE/scripts’ ‘/scripts’

/scripts/updatenow
—————–

Calls cpanelsync to update contents of scripts
directory, which then stores it’s md5sum table
at /scripts/.cpanelsync
? Should only be run from upcp, but can be
executed from command line when ‘–fromupcp’
is passed.
? Is the first update script called upon from /scripts/upcp

UPCP–>updatenow–>FTPUP–>EXIMUP–>MYSQLUP–>BANDMINUP–>COURIERUP–>RPMUP

RPMUP
——–

? Calls the underlying package manager to apply system package
updates
? The package manager which is used is determined by the presence
of:
– /var/cpanel/useup2date (Redhat)
– /var/cpanel/useyum (CentOS,Fedora)
– /var/cpanel/useapt (Debian)
– /var/cpanel/useswup (Trustix)
– /var/cpanel/userug (SuSE)

cPanel Updates
—————-

? After updatenow, sysup, and rpmup complete, cpanelsync is used to
complete the cPanel updates based on md5sum table stored at /
usr/local/cpanel/.cpanelsync
? If any special configurations are required on server after updates,
they can be applied in /scripts/postupcp, which is executed if such a
file exists and is executable.
? Once updates complete, all cPanel services are restarted for changes
to take effect

cPanel Scripts
————–

? Account Management
? Package Management
? Service Update and Configuration
– MySQL
– Exim
– Named
– Apache
? cPanel and System

Account Management Scripts
——————————

? /scripts/wwwacct (account creation)
Accounts can be created via the command line using the following
syntax: /scripts/wwwacct exampledomain.com username password 0
x n
? /scripts/killacct (account termination)
Takes a single argument of the user to terminate.
? /scripts/suspendacct (account suspension)
Will suspend an account from accessing all cPanel managed
services.
? /scripts/unsuspendacct
Will reinstate any account suspended via suspendacct

? /scripts/addpop (Create pop account)
Handles creation of virtual mail accounts. Accepts either no
arguments, or two arguments consisting of the e-mail address and
password.
? /scripts/updateuserdomains
Updates the user:owner and user:domain tables stored in:
– /etc/userdomains
– /etc/trueuserdomains
– /etc/trueuserowners
– These tables are used to enumerate and keep track of accounts
and their owners.

Package Management
———————-

? /scripts/ensurerpm
Takes argument list of rpms, which are then passed to the
underlying package manager
? /scripts/ensurepkg
The equivalent of ensurerpm for FreeBSD. Updates specified
packages from ports.
? /scripts/realperlinstaller
Takes argument list of perl modules to install via CPAN
? Each of the aforementioned scripts can accept an argument of ‘–force’
to force package installations.

? /scripts/mysqlup
Can be called to apply MySQL updates independent of upcp
? /scripts/cleanupmysqlprivs
Will clean up the default MySQL privilege tables, by installing
a more restrictive privilege schema.
? /scripts/mysqlconnectioncheck
Will verify that mysql is accessible with password stored in /root/.my.cnf,
and force a reset with a random 16 character string if inaccessible.
? /scripts/restartsrv_mysql

? /scripts/eximup
Can be called to apply exim updates independent of upcp
? /scripts/buildeximconf
Will rebuild exim.conf, and merge local, distribution, and cPanel
configurations
? /scripts/restartsrv_exim

? /scripts/rebuildnamedconf
Rebuild named.conf based on existing zone files
? /scripts/restartsrv_bind

? /scripts/easyapache
Download, extract, and execute apache build script
? /scripts/rebuildhttpdconf
Rebuilds httpd.conf based on DNS entries found in each
cPanel user configuration
? /scripts/restartsrv_httpd

cPanel Scripts
————–

Useful Scripts – cPanel and System
? /scripts/restartsrv_{servicename}
The majority of cPanel managed service can be scripts named
appropriately.
? /scripts/makecpphp
Will rebuild the PHP interpreter used internally by cpsrvd
? /usr/local/cpanel/bin/checkperlmodules
Will scan for and install any Perl modules required by cPanel.
? /scripts/fullhordereset
Updates horde and resets the horde mysql user password
? /scripts/fixquotas
Will attempt to rebuild quota database per information stored in /
etc/quota.conf

How to install ClamAV in cpanel server??

Cpanel No Comments »

Go > WHM > Cpanel Install Plugin > Enable Clamav Connector

Cpanel showing SSL error??

Cpanel No Comments »

Login to WHM and under “Server Configuration” click on “Manage Service SSL Certificates” and choose the appropriate service that needs the SSL Certificate to be renewed and click on “Reset Certificate”.

Mysql Collation Setup

MySql No Comments »

Here are the steps to change MySQL collation from phpMyAdmin in cPanel:

[1] Login to your cPanel and click on “phpMyAdmin” icon.
[2] Click on your database name and the go to “Operations” tab.
[3] At the bottom of the page you will see the collation option. You can now select a collation from the drop down menu and click on the Go button.

Please note that the new collation will be set for new tables only. Old table will use the previous collation under which they were created. If you want to use new collation for already created tables, you will need to change collation for all tables.

Dreamweaver Database connection setup??

Cpanel No Comments »

To set up a MySQL connection from DreamWeaver to your  Web Hosting package:

1. Open Dreamweaver

2. Click on File then select New

3. Click on Dynamic Page in the left-hand frame then click on PHP (or any other type of dynamic page) in the right-hand frame

4. Click on Create (a new blank page will appear)

5. Click on Tools in the navigation menu then select Application

6. Click on the Database tab

7. If a Web site has already been created, skip options #1 and #2

8. Click on the Testing Server link in option #3

9. Verify or update the following settings:

n Server Model equal to PHP MySQL

n Access equal to FTP (this information is pertaining to how Dreamweaver will upload its pages)

n FTP Host equal to your domain name

n Host Directory equal to the directory where you would like your pages to be uploaded

n Login / Password equal to your Web Hosting FTP username / password

n URL prefix must be the complete URL (i.e. http://yourdomain.com/database/)

10. Click on the OK button

11. In the Database tab in the application window click on the + at the top of the window then select MySQL Connection

12. Verify or update the following settings:

n The connection name should be descriptive so that you will remember (e.g. My Web Site)

n MySQL Server Name equal to the IP address of your Network Solutions MySQL server.

n User Name / Password equal to your MySQL database username / password.

n Database equal to the name of your MySQL database.

13. Click on the Test button

14. If the test is successful click “OK” if the test in unsuccessful review the information provided in step #9 and 12

How to Configure Dreamweaver??

Cpanel No Comments »

Dreamweaver connects with a basic FTP program. In this guide, we will show you how to connect to the server and define some of the additional fields mentioned in the connection process and how they are used.

For the example I will be using Dreamweaver Ultradev 4; however, all versions of the program basically connect with the same interface so it doesn?t matter what version you are running.

In site menu you will want to choose new site, this will bring up the Site Definitions wizard:

Local Info Tab:

In this tab you will submit the information for your local machine so that it is able to calibrate links accurately when you post your website to our servers.

Site Name Field: In this field you will want to put a name for your website.

Local Root Folder: In this field you will put the path on your workstation to where you would like to store your website and any files related to it. This can be any folder on your computer but you will have to know how to get to it. Enter full path e.g. E:\webs\mynewwebsite\ or click on the folder icon to the right to navigate to your website’s directory.

HTTP Address: In this field you will need to put in your domain name - http://www.yourdomain.com, this enables Dreamweaver to calibrate any links that you have in your pages so that they work correctly both when you test the page on your workstation and on the web server.

Cache: The enable cache box allows your workstation to save any settings you use enabling the computer to work more quickly. Usually best left as enabled.

Remote Info Tab:

In this tab you will fill out the information for connecting to the web server. First you will want to change the access dropdown box from the default none to FTP.

FTP Host: In this field you will want to use the IP address that you were sent in the welcome email that came when your account was set up. You may also use the form ftp.yourdomain.com (substituting yourdomain.com for your own domain name).

Host Directory: you will need to put /public_html in this field, as this is where your content should be saved for viewing on the net.

Login: In this field you will use the user name that you were supplied in the welcome letter that you receive as confirmation that your site has been set up.

Password: In this field you will use the password that you were supplied in the welcome let that you receive as confirmation that your site has been set up

Use Passive FTP: Our servers do support Passive FTP Transfer. Although either setting should work, you may want to leave this setting unchecked.

Use Firewall: If you are using a firewall you will want this checked and will want to configure the firewall settings in the preferences for Dreamweaver. Try connecting with this setting unchecked if in doubt.

Check In/Out Area: These settings are for large groups working on the same project from remote locations as a sort of logging to tell who is working on what sections. Most users will not need this area and settings and can uncheck everything.

Mysql Stored Procedure.

MySql No Comments »

Make sure mysqli is supported.

If you are not able to successfully run stored procedure, please read this.

If you create a stored procedure from remote mysql it opens a record in information_schema database routines table with definer username@ip.You can not access this s.p. with php. if you create a s.p. from php my admin it opens a record in information_schema database routines table with definer username@localhost. If you create a s.p. from php, I mean a file from server it opens a record in information_schema database routines table with definer.a s.p. created from phpmyadmin can only be called from phpmyadmin.but a s.p. created from server (a file in public_html folder) can be called from web site

Bug in Mailman

Cpanel No Comments »

In cPanel >> Mailing Lists >> Modify

Getting the follwing error
*******************************************************************************************************
Bug in Mailman version 2.1.9.cp2

We’re sorry, we hit a bug!

Please inform the webmaster for this site of this problem. Printing of traceback and other system information has been explicitly inhibited, but the webmaster can find this information in the Mailman error logs.

***********************************************************************************************************
Errors seen in error log of mailman

vi /usr/local/cpanel/3rdparty/mailman/logs/error

**********************************************************************************************************
self._parsebody(root, fp, firstbodyline)
File “/usr/local/cpanel/3rdparty/mailman/pythonlib/email/Parser.py”, line 265, in _parsebody
msg = self.parse(fp)
File “/usr/local/cpanel/3rdparty/mailman/pythonlib/email/Parser.py”, line 64, in parse
self._parsebody(root, fp, firstbodyline)
File “/usr/local/cpanel/3rdparty/mailman/pythonlib/email/Parser.py”, line 206, in _parsebody
raise Errors.BoundaryError(
BoundaryError: No terminating boundary and no trailing empty line

*********************************************************************************************************

Resolution :

/scripts/fixmailman
/usr/local/cpanel/3rdparty/bin/check_db
/usr/local/cpanel/3rdparty/bin/check_perms
/scripts/reinstallmailman
chmod 02775 -R /usr/local/cpanel/3rdparty/mailman/

Also once the problem solved by changing the list language :)
Problem resolution if the above fix won’t work

The latest  Mailman have some bugs. It need Python version of 2.4.6 at least. But in your centos4/RHEL4 servers the python version is  2.4.3. So for fixing the mail man issue you need to upgrade the python without  breaking  Yum and other python modules.

It is little difficult for upgrading Python in cpanel servers. Because if you  upgrade python directly , the yum package manager will not  work. So  you need to reinstall all old rpms again.

Please proceed with the following for upgrading Python

1) Download and install python 2.4.6

# cd /usr/local/src/
# wget  http://www.python.org/ftp/python/2.4.6/Python-2.4.6.tgz
# tar -xvzf Python-2.4.6.tgz
# cd Python-2.4.6/
# ./configure –prefix=/usr/local/python.2.4.6/
# make
# make install

2) Configure cpanel for latest Python as follows

# grep python /var/cpanel/cpanel.config
#python=/usr/local/bin/python2.4
python=/usr/local/python.2.4.6/bin/python2.4
3) Now reinstall Mailman
# /scripts/reinstallmailman

This will fix your issue

Block Emails from a Particular domain??

Cpanel No Comments »

To block all emails sent from a specific domain:
-go to WHM/Service Configuration/Exim Configuration Editor and switch to Advanced mode
-at begin acl form put:

if $header_from: contains “@domain_name.com”
then
fail text “What message do you want.”
seen finish
endif”

Plesk Installation

Plesk No Comments »

#wget http://download1.parallels.com/Plesk/Plesk8.3/FedoraC7/swsoft_insler_v3.3.0_build080116.12_os_FedoraCore_7_i386

#chmod +x swsoft_installer_v3.3.0_build080116.12_os_FedoraCore_7_i386

#./swsoft_installer_v3.3.0_build080116.12_os_FedoraCore_7_i386

MySql Tips

MySql No Comments »

1)To check Max Connections
mysql> show variables like ‘%connections’;
+———————-+——-+
| Variable_name | Value |
+———————-+——-+
| max_connections | 100 |
| max_user_connections | 0 |
+———————-+——-+
2 rows in set (0.63 sec)

Also,
mysql> select user, max_connections, max_updates,max_questions from mysql.user;
+—————–+————-+—————+
| max_connections | max_updates | max_questions |
+—————–+————-+—————+
| 0 | 0 | 0 |
| 0 | 0 | 0 |
| 0 | 0 | 0 |
| 0 | 0 |

This may show something useful.

You could also setup an alert for yourself to warn you, and then find out what is really going on. Use the script below.. change the commands as required..

#!/bin/bash

ALERT_DEST=email.addr@email.add
NUM_PROCESSES=`/usr/local/mysql/bin/mysql -e “show processlist;”|wc -l`

MAX_BEFORE_ALERT=25

if [ ${NUM_PROCESSES} -gt ${MAX_BEFORE_ALERT} ]
then
echo |/usr/bin/mail -s “WARNING: MYSQL CONNECTIONS=${NUM_PROCESSES}” ${ALERT_DEST}
fi

Baby [yes itz baby] tips to prevent minor DDOS and SYNC.

Linux No Comments »

You have to verify if the box is really compromised.

Check etc-passwd and verify the uid of the user news

#grep -i news /etc/passwd

:: Result: news:x:0:0:news:/etc/news:/bin/bash

Shows that the user news is having gid and uid 0 thus have all root privileges and has also got full shell access.

Check the /tmp directory for any suspicious files

#ls -al /etc/tmp

Check the process tree and find if there are any suspicious process

#ps aux –forest

Check for any established connections

#netstat -plan

You will get the description of FIN_WAIT2 & TIME_WAIT in the man page of netstat. Type ‘man netstat’ in the shell. You can minimize those FIN_WAIT2 & TIME_WAIT states by doing the below things :-

echo 1 > /proc/sys/net/ipv4/tcp_syncookies

Put following in /etc/sysctl.conf
# Enable TCP SYN cookie protection
net.ipv4.tcp_syncookies = 1

# Decrease the time default value for tcp_fin_timeout connection
net.ipv4.tcp_fin_timeout = 30

# Turn off the tcp_window_scaling
net.ipv4.tcp_window_scaling = 0

# Turn off the tcp_sack
net.ipv4.tcp_sack = 0

Then execute the command :-
# /sbin/sysctl -p

Using IPtables
==============

You can also execute the following commands to minimize the syn attack in the future :-
iptables -A INPUT -p tcp –tcp-flags SYN,FIN SYN,FIN -j DROP
iptables -A INPUT -p tcp –tcp-flags SYN,RST SYN,RST -j DROP
iptables -A INPUT -p tcp –tcp-flags FIN,RST FIN,RST -j DROP
iptables -A INPUT -p tcp –tcp-flags ACK,FIN FIN -j DROP
iptables -A INPUT -p tcp ! –syn -m state –state NEW -j DROP
iptables -A INPUT -p tcp –tcp-flags SYN,FIN SYN,FIN -j DROP
iptables -A INPUT -p tcp –tcp-flags SYN,RST SYN,RST -j DROP
iptables -A INPUT -p tcp –tcp-flags ALL FIN,URG,PSH -j DROP
iptables -A INPUT -p tcp –tcp-flags ALL FIN -j DROP
iptables -A INPUT -p tcp –tcp-flags ALL NONE -j DROP
iptables -A INPUT -p tcp –tcp-flags ALL ALL -j DROP

service iptables save
service iptables restart

# Limit the number of incoming tcp connections
# Interface 0 incoming syn-flood protection

iptables -N syn_flood
iptables -A INPUT -p tcp –syn -j syn_flood
iptables -A syn_flood -m limit –limit 1/s –limit-burst 3 -j RETURN
iptables -A syn_flood -j DROP

#Limiting the incoming icmp ping request:

iptables -A INPUT -p icmp -m limit –limit  1/s –limit-burst 1 -j ACCEPT
iptables -A INPUT -p icmp -m limit –limit 1/s –limit-burst 1 -j LOG –log-prefix PING-DROP:
iptables -A INPUT -p icmp -j DROP
iptables -A OUTPUT -p icmp -j ACCEPT

Let us assume that you need to limit incoming connection to ssh server (port 22) no more than 10 connections in a 10 minute:

iptables -I INPUT -p tcp -s 0/0 -d $SERVER_IP –sport 513:65535 –dport 22 -m state –state NEW,ESTABLISHED -m recent –set -j ACCEPT
iptables -I INPUT -p tcp –dport 22 -m state –state NEW -m recent –update –seconds 600 –hitcount 11 -j DROP
iptables -A OUTPUT -p tcp -s $SERVER_IP -d 0/0 –sport 22 –dport 513:65535 -m state –state ESTABLISHED -j ACCEPT

=================================

the following command should aid you in isolating which
site was responsible for this injection:

find /usr/local/apache/domlogs/ -exec egrep -H ‘(wget|curl|lynx|wget)%20′ {} \;

========================================================

A quick and usefull command for checking if a server is under ddos is:

####  netstat -anp |grep ‘tcp\|udp’ | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n

####  netstat -anp | grep SYN | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n

####  netstat -anp | grep FIN | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n

That will list the IPs taking the most amount of connections to a server.

=========================================================

to kill perl processess;-

ps auxww | grep perl | awk ‘{print $2}’ | xargs kill -9