Tuesday, March 2, 2010

SOA parameters for a DNS server

To set the SOA parameters for a DNS server, perform the following steps:

1. Set the following parameters

1. Set the following parameters

Parameter Name

Description

Notes

E-mail

the mailbox of the person responsible for this DNS server.

TTL

"time-to-live": the time, in seconds, this DNS server caches (keeps) a piece of information received from your server before it asks your server again.

  • If you set the value too low, your server will get loaded down with too many repeat requests.
  • If you set it too high, the information you change will not get distributed in a reasonable amount of time.
  • By default, 86400 seconds (1 day) is set.

The solution is as follows:

  • If particular information is not expected to change in the near future, one can have a high TTL (anywhere between a day (86400 seconds) and a week (604800 seconds)
  • If information is known to change soon, it can be transmitted with a low TTL (an hour to a day).

It is standard practice to reduce the TTL transmitted with information that is scheduled to change in order to make that change visible rapidly throughout the Internet; once the change has happened, the TTL is increased again.

Refresh

the time interval, in seconds, before which the zones need to be updated.

  • By default, 10800 (3 hours) is set.
  • A good value here would be 3600 (1 hour).

Retry

the time interval, in seconds, after which the next attemp of refresh should be taken, after a refresh failure.

  • By default, 3600 (1 hour) is set.
  • A good value here would be 600 (10 minutes).

Expire

the upper limit, in seconds, on the time interval that can elapse before the zones are no longer authoritative

  • By default, 604800 (7 days) is set.
  • A nice value here would be 3600000 (42 days).

Minimum TTL

the minimum number of seconds to be used for TTL value in RRs.

By default, 86400 (1 day) is set, which is a good value.

Virtuozzo Configuration Files

Matrix of Virtuozzo Configuration Files

There are a number of files responsible for the Virtuozzo system configuration. Most of the files are located in the /etc directory on the Hardware Node. However, some configuration files are stored in the /etc directory inside the Service Container, on the Backup Node, inside a Container, or on a dedicated server. In case a configuration file is located in a place other than the Hardware Node, we point clearly the exact position (the Service Container, etc.) where it can be found.

A list of configuration files is presented in the table below:

/etc/vz/vz.conf

The Virtuozzo global configuration file. This file keeps system-wide settings, affecting Container and Virtuozzo template default location, global network settings and so on.

/etc/vz/conf/<CT_ID>.conf

The private configuration file owned by a Container numbered <CT_ID>. The file keeps Container specific settings – its resource management parameters, location of private area, IP address and so on.

/etc/vz/conf/ve-<name>.conf.sample

Sample files, containing a number of default Container configurations, which may be used as a reference for Container creation. The following samples are shipped with Virtuozzo: basic, cpanel, confixx, slm.plesk, slm.256MB, slm.512MB, slm.1024MB, slm.2048MB. You may also create your new samples customized for your own needs.

/etc/vz/conf/dists/<distribution_name>.conf

The configuration files used to determine what scripts are to be run on performing some operations in the Container context (e.g. on adding a new IP address to the Container). These scripts are different from Virtuozzo action scripts and depend on the Linux version the given Container is running.

/etc/sysconfig/vzsve

The configuration file used for the Service Container creation by vzsveinstall.

/etc/sysconfig/vzagent/<file>

Parallels Agent configuration files.

/etc/vz/conf/networks_classes

The definition of network classes, used by traffic shaping and bandwidth management in Virtuozzo.

/etc/sysconfig/vzup2date/vzup2date.conf

This file specifies the default connection parameters for the vzup2date utility.

/<path>/<name>.conf

This configuration file specifies the default connection parameters for the vzup2date-mirror utility. It should be located on the computer where you are planning to run vzup2date-mirror.

/etc/cron.d/vereboot

The configuration file for the cron daemon. Using this file, Virtuozzo emulates the "reboot" command working inside a Container.

/etc/vzvpn/vzvpn.conf

The configuration file used to define the parameters for establishing a private secure channel to the Parallels support team server.

/etc/vzreport.conf

The configuration file used to define the parameters for sending your problem report to the Parallels support team.

/etc/sysctl.conf

Kernel parameters. Virtuozzo adjusts a number of kernel sysctl parameters, and modifies the default /etc/sysctl.conf file.

/etc/vzredirect.d/*.conf

These files define the offline management modes for controlling Containers by Container administrators.

/etc/vzlmond.conf

This configuration file defines the parameters used by the vzlmond daemon to collect information on the main Hardware Node resources consumption.

/etc/vzstat.conf

The file lists the warning and/or error levels for a number of resource control parameters. If a parameter hits the warning or error value, the vzstat utility will display this parameter in yellow or red.

/etc/vzstatrep.conf

This configuration file is located on the Monitor Node and used by the vzstatrep utility when generating statistic reports and graphics on the Hardware Node resource consumption and sending these reports to the Node administrator.

/etc/vzbackup.conf

The global configuration file residing on the Backup Node and determining the global Container backup settings.

/etc/vz/pkgproxy/rhn.conf

The Red Hat Network (RHN) Proxy Server configuration file used by the vzrhnproxy utility when setting up the RHN Proxy Server. This file can be located on any computer where the vzrhnproxy package is installed.

/etc/vzpkgpoxy/vzpkgproxy.conf

This configuration file is used by the vzpkgproxy utility when creating special caching proxy servers for OS and application EZ templates. The file can be located on any computer where the vzpkgproxy package is installed.

/etc/vztt/vztt.conf

This configuration file is used by the vzpkg utility when managing OS and application EZ templates.

Install XCache

XCache is a fast, stable PHP opcode cacher that has been tested and is now running on production servers under high load. It is tested (on linux) and supported on all of the latest PHP. It optimizes performance by removing the compilation time of PHP scripts by caching the compiled state of PHP scripts into the shm (RAM) and uses the compiled version straight from the RAM. This will increase the rate of page generation time by up to 5 times as it also optimizes many other aspects of php scripts and reduce server load.

To install follow the steps

1. Download and extract the source for XCache .

# cd /usr/local/src/
# wget http://xcache.lighttpd.net/pub/Releases/1.2.2/xcache-1.2.2.tar.gz
# tar -xzvf xcache-1.2.2.tar.gz

2. Build, configure and install the XCache module.
# cd xcache-1.2.2
# phpize
# ./configure --enable-xcache
# make && make install

You can see a message like this . Note the extension directory.

=============
Build complete.
Don’t forget to run ‘make test’.

Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20060613/
==============

3. Now configure the php.ini file ( To find .ini file, use the command `php -i | grep php.ini` )

# cat xcache.ini >> /usr/local/lib/php.ini

Replace the following line in php.ini with correct path ,which describes the Installed shared extensions that we noted above.

zend_extension = /usr/local/lib/php/extensions/non-debug-non-zts-xxx/xcache.so

It will become like this,

zend_extension = /usr/local/lib/php/extensions/no-debug-non-zts-20060613/xcache.so

4. Restart apache and confirm the Xcache installation.
# /etc/init.d/httpd restart

# php -v

it will show you as
-----------
php -v
PHP 5.2.8 (cli) (built: Feb 16 2009 05:42:38)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
with XCache v1.2.2, Copyright (c) 2005-2007, by mOo
--------

Monday, March 1, 2010

htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

How to solve “.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable”

My error log shows:-
[sat Jan 13 01:15:32 2009] [crit] [client 218.208.xxx.xxx] (13)Permission denied: /home/mydomain/public_html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

And the site is showing “403 Forbidden Error”.
At first, I suspect it’s .htaccess problem, but actually it’s caused by Frontpage Extension.

To solve “.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable” follow the steps below:-

* Login into your CPanel account
* Click on “Frontpage Extensions” icon
* Click on “Reinstall extensions” button beside your problem domain.
*If you do not use any frontpage extensions, it’s good to uninstall this extension
* Done. The “.htaccess pcfg_openfile: unable to check htaccess file” problem has been fixed.

Reverse DNS: how to check it?

Check RDNS using NSLOOKUP command ,HOST (on linux server ) command or centralops.net.

NSLOOKUP
--------------
1)You can check RDNS is setup or not from command prompt using nslookup command
Server which has RDNS set-

C:\>nslookup 10.11.12.13

Server: vnsc-pri.sys.gtei.net
Address: 4.2.2.1
Name: host.myhostname.com
Address: 10.11.12.13

Here if "Name" is your "hostname" then RDNS is setup for this server.


If RDNS is not setup you will see the "datacenter name " in front of "Name" as below.
C:\>nslookup 11.12.13.14
Server: vnsc-pri.sys.gtei.net
Address: 14.13.12.11
Name: bc.d3.7bae.static.theplaneet.com
Address: 11.12.13.14

Here "Name" is not your hostname, thus rdns is not set up for this server.


Using HOST command (on linux server)
-----------------------------------------------
1)on server
root@shell [~]# host 10.11.12.13
output-
13.12.11.10.in-addr.arpa domain name pointer host.myhostname.com.
=> If output line is ended with hostname, then rdns is setup for this.

2)on linux server -
root@shell [~]# host 1.2.3.4
output-
4.3.2.1.in-addr.arpa domain name pointer bc.d3.7bae.static.theplanet.com.
=> output line is not ended with hostname, thus rdns is not set for this .


Use centralops.net
---------------------------------------
browse http://centralops.net
1) open browser http://centralops.net/co/ >> Domain Dossier
put ip in it and see dns report
canonical name should be your hostname
and in dns report

13.12.11.10.in-addr.arpa IN PTR host.myhostname.com

ptr line should contain hostname.


3) open browser http://centralops.net/co/ >> Domain Dossier
put ip in it and see dns report
canonical name should be your hostname
and in dns report

"4.3.2.1.in-addr.arpa IN PTR ba.d3.7bae.static.theplanet.com"

ptr line does not contain hostname, thus no rdns set for this.

Installing cPanel/WHM

cpanel can offer 15-day test licenses for no cost.


Installing cPanel/WHM

To begin your installation, use the following commands:

1. cd /home — Opens the directory /home.
2. wget -N http://layer1.cpanel.net/latest — Fetches the latest installation file from the cPanel servers.
3. sh latest — Opens and runs the installation files.



4.(If you have purchased license for cpanel)
/usr/local/cpanel/cpkeyclt — Activates your license after installation.

5. Login to WHM and proceed with the intial WHM Setup.


Obtaining a cPanel/WHM License:

If you do not have a license for cPanel/WHM, you will need to obtain one for your IP address. You can obtain a license at http://www.cpanel.net/store.

create VPS container

Create VPS container on hardware node using virtuozzo control panel.

1. Log in to https://ip:4643/vz/cp
2. Click on >> Containers >>New Container
3. Number of Containers to create* 1
4. Hardware Node Selection - Click on radio button against - Select Hardware Node Manually
5. Click on NEXT
6. General Configuration >>

Name* = Domain name (domain.com)
Description = root
Select Container Sample = Select 256, 512, 1024 MB ram as per vps order
OS Template/Version* = will be selected automatically once you have selected the ram in the above step.

Administrative Password = Type Password ..Retype the password

Click on NEXT

Global Network

Hostname = hots.domain.com
DNS Server IP Address 4.2.2.1 .. Click on the PLUS ICON (+) and enter 4.2.2.2 in the second DNS Server IP Address box

Routed Network

IP Address >> Keep it on auto .. Click on PLUS ICON (+) two times as we need to give 3 ips.


Click on NEXT

CPU Parameters

diskspace Soft Limit 20,40,60 GB Hard Limit 21, 41, 61
diskinodes Soft Limit 200000, 300000, 400000 Hard Limit 220000, 320000, 420000 ( as per requirements)
quotaugidlimit - Enable by clicking on the check box against it. Set value 250, 350, 500 (as per VPS configuration)
quotatime - 60 seconds
ioprio - 4

Memory Parameters

slmmemorylimit - Soft Limit 256,512,1024 MB (as per requirement) Hard Limit 256,512,1024 MB

Click oN NEXT

Available Applications(81) - Click on the check box against [devel] . Add it to Scheduled for Installation by clicking on >>


After selecting devel, click on check box against Scheduled for Installation(1)

Click on NEXT

Please review the new Container configuration. ( MAKE SURE TO CHECK EVERYTHING)

FINALLY CLICK ON CREATE

Once the vps is created log into shell. Now you have to install yum and control panel on the server.