Saturday, February 19, 2011

Important paths on Plesk + centos.


1) Document root for domain.

/var/www/vhosts/domainname/httpdocs

2) path to php.ini

/etc/php.ini 
OR
/usr/local/lib/php.ini

3) maillog path:

/usr/local/psa/var/log/maillog

4) Domain Error log path

/var/www/vhosts/domainname/statistics/logs/error_log

5) 4) Domain access log path

/var/www/vhosts/domainname/statistics/logs/access_log

6) Domain backup path

/var/lib/psa/dumps/domainname

7) Path of the domain email account

/var/qmail/mailnames/domain

8) Check EMails in mail queue :

/var/qmail/bin/qmail-qstat

9) Path to mysql database:

/var/lib/mysql/databasename

10) Plesk named file path

/var/named/run-root/var/domainname

11) The other logs can be found in the below mentioned folder

/var/log/......

12) Document root for domain with ssl.

/var/www/vhosts/domainname/httpsdocs

13) The Redirect conditions can be put in this file.

/var/www/vhosts/domainname/conf/vhost.conf

14) Httpd file for the domain

/var/www/vhosts/domainname/conf/httpd.include

15) cgi-bin path

/var/www/vhosts/domainname/cgi-bin

16) Sub-Domain path

/var/www/vhosts/domainname/subdomains

17) Domain backups

/var/www/vhosts/domainname/library/backups

18) Domain logs

/var/www/vhosts/domainname/library/logs

How to install Wordpress?


Wordpress installation steps:

Kindly follow the given below steps to install wordpress.

1.Create the Database for the wordpress from your control panel. ex.
DB_wordDB
2.Create user name and password for the "DB_wordDB"
3.Download the wordpress from "wordpress.org"
4.Unzip the file
5.Edit the file name "wp-config-sample", Change that file name to "wp-config"
6.Enter the details of database created above in the configuration file.

Ex.
define('DB_NAME', 'DB_wordDB'); // The name of the database
define('DB_USER', 'Admin'); // Your MySQL username
define('DB_PASSWORD', 'password'); // ...and password
define('DB_HOST', 'localhost'); // 99% chance you won't need to change
this value

7.Access the URL "domain.com/wp-admin/install.php"

8.When you click the First Step link, another new window will open.

8.1. Enter the name you have selected for your blog.
8.2. Enter your email address and double check it before continuing.
8.3. Place a check in the box for I would like my blog to appear in search
engines like Google and Technorati. (This is important!)
8.4. Click "Continue to Second Step".

9.Once you have followed the instructions on each new window, your blog
will be created automatically for you. Make sure to save the user name and
password provided.

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

Structure Of Cpanel


Structure Of Cpanel

cPanel is a hosting automation company driven by technology and dedicated
to providing the most feature rich, easy to use, practical applications.
We are committed to the hosting community and our continued role as a
market leader.

cPanel and WebHost Manager (WHM) combine to form a fully featured web
hosting control panel system. cPanel and WHM allow you to provide an
interface for both your customers and your staff.

The cPanel and WebHost Manager package includes: * cPanel – Domain Owner
Control Panel
* WebHost Manager – Server Administration and Reseller Panel
* Webmail Panel – Webmail Access Panel

How to sync data between 2 servers automatically ?


Have you ever wanted to know how to easily synchronize the data between
multiple servers automatically?

In this article I’ll explain how to setup 2 Linux servers to automatically
synchronize data between a specific directory on each server. To do this
we will use rsync, ssh key authentication, and a cron job.

Let’s call the 2 servers ‘SOURCESERVER’ and ‘DESTSERVER’ for
SOURCESERVER = Source server (the server we’re connecting from to upload
the data)
DESTSERVER = Destination server (the server we’re connecting to receive
the data)


Part 1 - Setting up SSH key authentication

First, we need to make sure the DESTSERVER has the ability to use key
authentication enabled. Find your sshd configuration file (usually
‘/etc/ssh/sshd_config’) and enable the following options if they are not
already set.

RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys

If you edit the file be sure to restart sshd afterwards.

# /etc/init.d/sshd restart

Next, on the SOURCESERVER we will create the public / private key pair to
be used for authentication with the following command.

# ssh-keygen -t rsa

*Note: Do not enter a passphrase for this, just hit enter when prompted.

This should create 2 files, a public key file and a private key file.
The public key file (usually [homedir]/.ssh/id_rsa.pub) we will upload to
the DESTSERVER.
The private key file (usually [homedir]/.ssh/id_rsa) we will keep on the
SOURCESERVER.
*Be sure to keep this private key safe. With it anyone will be able to
connect to the DESTSERVER that contains the public key.

Now we will plant the public key we created on to the DESTSERVER.
Choose the user account which you will use to connect to on DESTSERVER,
we’ll call this user ‘destuser’ for now.
In that account’s home directory, create a ‘.ssh’ subdirectory, and in
that directory create a new text file called ‘authorized_keys’. If it
already exists, great, use the existing file.
Open the ‘authorized_keys’ file and paste in the contents of the public
key you created in the previous step (id_rsa.pub). It should look
something like the following

ssh-rsa  sourceuser@SOURCESERVER

Save the file and change the permissions to 600 for the file and 700 for
the ‘.ssh’ directory.

Now to test that the keys are working.
From the SOURCESERVER try logging in as normal using ssh to the DESTSERVER.

# ssh destuser@DESTSERVER

If all is working you should not be prompted for a password but instead
connected directly to a shell on the DESTSERVER.


Part 2 - Creating the rsync script

Now for the rsync script.
I use a simple script such as the following

——————————————-

#!/bin/bash

SOURCEPATH=’/source/directory’
DESTPATH=’/destination’
DESTHOST=’123.123.123.123′
DESTUSER=’destuser’
LOGFILE=’rsync.log’

echo $’\n\n’ >> $LOGFILE

rsync -avz -u --progress --delete $SOURCEPATH
$DESTUSER@$DESTHOST:$DESTPATH 2>&1 >> $LOGFILE
echo “Completed at: `/bin/date`” >> $LOGFILE

——————————————-

Copy this file into the home directory of the sourceuser on the SOURCESERVER
and modify the first 4 variables in the file.
SOURCEPATH (Source path to be synced)
DESTPATH (Destination path to be synced)
DESTHOST (Destination IP address or host name)
DESTUSER (User on the destination server)
Save it as something like ‘rsync.sh’
Set the permissions on the file to 700.
# chmod 700 rsync.sh

Now you should be able to run the script, have it connect to the
DESTSERVER, and transfer the files all without your interaction.
The script will send all output to the ‘rsync.log’ file specified in the
script.


Part 3 - Setting up the cron job

Assuming everything has worked so far all that’s left is to setup a cron
job to run the script automatically at a predefined interval.

As the same sourceuser use the ‘crontab’ command to create a new cron job.

# crontab -e

This will open an editor where you can schedule the job.
Enter the following to have the script run once every hour

——————————————-
# Run my rsync script once every hour
0 * * * * /path/to/rsync.sh
——————————————-

Your 2 servers should now be syncing the chosen directory once every hour.
Hope this helped, let me know if you have any questions.
Have you ever wanted to know how to easily synchronize the data between
multiple servers automatically?
In this article I’ll explain how to setup 2 Linux servers to automatically
synchronize data between a specific directory on each server. To do this
we will use rsync, ssh key authentication, and a cron job.

FreeBSD - File paths


CRON
====
/var/cron/tabs/<Username>
#/etc/rc.d/cron start

QMAIL
=====
/usr/local/etc/rc.d/qmaild.sh restart

/etc/mail/relay-domains ---contains a list of hosts which are allowed to
relay mail through your mail server.

or

/var/qmail/control/virtualdomains ---add entery of the domain

Apache
=======
/usr/local/etc/rc.d/apache.sh restart
/hsphere/shared/apache/conf/httpd.conf

PHP
===
/usr/local/Zend/etc/php.ini
/hsphere/shared/apache/conf/php.ini

Zone file
==========
/etc/namedb/master/<domain.com>

VPOPMAIL of Domain in Hsphere:
==============================
/hsphere/local/var/vpopmail/domains =====> contains password and necessary
info about the accounts in that domain