Total Pageviews

Monday, January 25, 2010

Hspere files

-- To find the php version

/hsphere/shared/php4/bin/php-cli -v
PHP 4.4.9 (cli) (built: Aug 20 2008 15:07:03)

-- Paths to php.ini
/hsphere/local/config/httpd/php4/php.ini for PHP4
/hsphere/local/config/httpd/php4/php.ini for PHP5

Http:
~~~

-- Document root for each domain:
/hsphere/local/home//

-- Main conf file:
/hsphere/local/config/httpd/httpd.conf

-- Conf file for all sites:
/hsphere/local/config/httpd/sites

Each virtualhost entries will be under different files xxxx.conf.
xxxx is a random numbers.

-- Main Log files: /hsphere/local/var/httpd/logs/

For each domain
~~~~~~~~~~
-- TransferLog /hsphere/local/home//logs//domain.com

-- CustomLog /hsphere/local/home//logs//referrer_log

-- ErrorLog /hsphere/local/home//logs//error_log


MYSQL:
~~~~~

-- /var/lib/mysql

-- /var/log/mysql/error.log

Mail:
~~~

-- mail box path
/hsphere/local/var/vpopmail/domains//

-- log file
/var/log/maillog

-- Qmail related file
/hsphere/local/var/qmail

Named
~~~~~

-- Conf file
/etc/named.conf

-- Zone files
/hsphere/local/var/named

This folder contains many sub-folders. Find the zone file using grep command
Eg: /hsphere/local/var/named/zones17/12/domain.com

-- Proftp Conf
/hsphere/local/config/ftpd/proftpd.conf

-- proftp referrer logs
/hsphere/local/var/proftpd/xferlog

-- Proftod logs are in this directory
/var/log/proftpd/

-- Webalizer config file
/hsphere/local/config/webalizer/webalizer.cfg

Frame forwarding

To create a file of specific size

bash-3.1$ dd if=/dev/zero of=test.png bs=1024 count=128

Reset Wordpress admin password from Database

Enter into mysql

--------------------

mysql> use dbuser;
Database changed
mysql> show databases;
+-----------------------+
| Database |
+-----------------------+
| information_schema |
| cpuser_wordpress |
+-----------------------+
3 rows in set (6.52 sec)

mysql> use cpuser_wordpress
Database changed
mysql> show tables;
+---------------------------------+
| Tables_in_cpuser_wordpress |
+---------------------------------+
| wp_comments |
| wp_links |
| wp_options |
| wp_postmeta |
| wp_posts |
| wp_term_relationships |
| wp_term_taxonomy |
| wp_terms |
| wp_usermeta |
| wp_users |
+---------------------------------+
10 rows in set (0.00 sec)

mysql> select * from wp_users\G;
*************************** 1. row ***************************
ID: 1
user_login: admin
user_pass: $P$B2BPfEOCFZzwbL.NRoGpxzbo/Hz8Gz1
user_nicename: admin
user_email: admin@domain.com
user_url:
user_registered: 1/1/10
user_activation_key:
user_status: 0
display_name: admin
1 row in set (0.03 sec)

mysql> update wp_users set user_pass=md('newpass') where user_login='admin';

--------------------

Sunday, January 24, 2010

To show data and time of history

export HISTTIMEFORMAT="%D %T"

Install SPF for a domain

/usr/local/cpanel/bin/spf_installer Cpanelusername

Reset database user password

Enter into mysql

----------

SET PASSWORD FOR 'brian_btball'@'localhost' = OLD_PASSWORD('604074');

FLUSH PRIVILEGES;

----------

Repair Database

To repair database from shell

---------

cd /var/lib/mysql/datbase name

myisamchk --recover *.MYI

---------

Site infected

Run this script there in root ....ull seee infected files :)
Dont forget to change the username

------------


#!/bin/bash

pattern='r0nin|m0rtix|upl0ad|r57shell|c99shell|shellbot|phpshell|void\.ru|phpremoteview|directmail|bash_history|\.ru/|brute *force|multiviews|cwings|bitchx|eggdrop|guardservices|psybnc|dalnet|undernet|vulnscan|spymeta|raslan58|deface|defacing|defacer|MSRml'

searchpath=/home/lhemail/
find $searchpath \( -regex '.*\.php$' -o -regex '.*\.cgi$' -o -regex '.*\.inc$' -o -regex '.*\.pl' \) -print0 | xargs -0 egrep -il "$pattern" /dev/null | sort >> report.$$

cat report.$$

------------
Cpanel --- Ensim
==================
/etc/proftpd.conf---/home/virtual/ < your domain >/etc/prpftpd.conf

/etc/passwd --- /home/virtual/ < your domain >/etc/passwd

/etc/valiases/domain --- /home/virtual/ < your domain >/etc/aliases

/usr/local/apache/conf/httpd.conf --- /etc/httpd/domain.comconf/virtual/< site number >

/etc/exim.conf --- /home/virtual/ < your domain>/etc/sendmail.cf

/var/named/domain .db --- /var/named/db.domain

/usr/local/apache/logs/error_logs --- /home/virtual//var/log/httpd/error_log

/usr/local/apache/logs/access_logs --- /home/virtual/< domain >/var/log/httpd/access_logs

-------------------

Location of home directory in cpanel and ensim
In cpanel the home directory is located at /home/user name
In ensim its /home/virtual/domain name

-------------------

Temporary URL used in cpanel servers ,when the domain name is not active.
http://server ip address/~user name

-------------------

Temporary URL used in ensim servers ,when the domain name is not active
http://srv02.behosted.com/~admin< number >/

-------------------


Accessing shared ssl in cpanel
https://server ip/~user name

-------------------
Accessing sharhttps://www.dfwairparts.com/admin/categories.php?osCAdminID=74db583034663bf2f61754044bbcea4ded ssl in ensim
https://server ip/~admin < number>

-------------------

Anonymous ftp login path in cpanel
/home/user name/public_ftp/

-------------------

Anonymous ftp login path in ensim
/home/virtual/< domain name >/var/ftp

-------------------

In cpanel ftp users are created under the path
/home/user name/public_html

-------------------

In ensim the ftp users are created under the path
/home/virtual/< domain name > /home

-------------------

In cpanel all the mail accounts are located at
/home/user name/mail
In ensim all the mail accounts are located at
/home/virtual/< domain name >/var/mail

-------------------

In cpanel webmail is accessed using the link
http:// domain name or ip :2095

-------------------

In ensim you access mail using
http://domain name/squirrelmail

-------------------

In cpanel servers we have to use user name as username@domain.com while connecting using ftp.

In ensim also we have to use username@domain.com while connecting using ftp.


In cpanel servers we use user name as just user name while connecting to the server using shell access

ie ssh -l user name domain.com

In ensim we use the user name as username#domain.com

eg: ssh -l username#domain.com domain

-------------------


In cpanel the mail queue is located at the path
/var/Spool/exim/input

-------------------

In ensim there is mailqueue for each domain.
The path is /home/virtual/< domain > /var/spool/mqueue

-------------------

Public_html and cgi-bin folder in cpanel servers are located at
/home/user name/public_html
/home/user name/public_html/cgi-bin

-------------------

In ensim the document root are at
/home/virtual/< domain name > /var/www/html
/home/virtual/< domain name >/var/www/cgi-bin

-------------------

In cpanel we use vfilters to block a mail from a particular mail account .The path is /etc/vfilters/domain name

In ensim we use access file to block a mail from a particular mail account. The path is /home/virtual/site[x]/fst/etc/mail/access

format is

spam@spammer.com REJECT

-------------------

Cpanel can be restarted using the command
/etc/rc.d/init.d/cpanel3
Ensim can also be restarted using the commands
/etc/rc.d/init.d/webppliance

Tuesday, January 19, 2010

Maximum emails for a domain

To change the default maximum emails per hour of a server.
------------
[root@server ~]#vi /var/cpanel/maxemailsperhour
------------

To set maximum emails per hour for a particular domain.
-------------
[root@server ~]# vi /var/cpanel/maxemails
# If you update this file you must run /scripts/build_maxemails_config
emails.com=500
domain.net=1000

[root@server ~]#/scripts/build_maxemails_config

After this command, a file automatically get created under the directory [var/cpanel/maxemailsperdomain/]with the email value you've set for those particular domains.
Just to check, type the following which should return the value that you entered in the previous file.
-------------