BLOG HOME -  UK WEB HOSTING -  PHP MYSQL HOSTING -  RESELLER HOSTING -  eUKhost FORUMS -  VPS HOSTING

Archive for September, 2006

ubuntu

Ubuntu is a complete Linux-based operating system, freely available with both community and professional support.

Ubuntu is suitable for both desktop and server use. The current Ubuntu release supports PC (Intel x86), 64-bit PC (AMD64), UltraSPARC T1 (Sun Fire T1000 and T2000) and PowerPC (Apple iBook and Powerbook, G4 and G5) architectures. Ubuntu includes more than 16,000 pieces of software, but the core desktop installation fits on a single CD. Ubuntu covers every standard desktop application from word processing and spreadsheet applications to web server software and programming tools.

Site: http://www.ubuntu.com

Support: http://www.ubuntu.com/support

Cummunity: http://www.ubuntu.com/community

Comments (2) Bookmark on del.icio.us

Automate Backups in Virtuozzo for Windows

The virtual environments (VE’s) within Virtuozzo can be integrated with the Windows Scheduler to have automated backups performed.

By creating a simple batch file and integrating it with our Command Line Interface (CLI), the process can run at regular intervals on the server. Both full and incremental backups can be performed through the Windows Scheduler. The command used to backup a VE is called vzbackup. Examples of how to perform each type of backup is listed below.

While running this command, vzbackup does the following:

  • It connects via SSH to the Source Node where the identified VE you wish to back up resides;
  • It compresses the private area of the selected VE and its registry settings to a .zip formatted file;
  • It connects via SSH to the Backup Node
  • It transfers the compressed file to a special backup folder on the Backup Node

For example, to back up a single VPS (101) hosted on a Hardware Node, the command below would back it up on that server.
————-
vzbackup 101
————-

To have the scripted backup create a backup on Host Node (10.10.40.100) and send it to the Backup Node (10.10.40.200), the following command would be used:
————-
vzbackup 101 -A 10.10.40.200 –U Administrator –P passwd200
————-

Where

-U is the Administrator login to the backup node. This option can be omitted – in this case vzagent0 password should be used with the –P option.
-P is the password of the Administrator ID to the specified server
-A is the IP address of the Backup Node to receive the backup

Note: In case you have the Service VPS in the NAT mode you have to use the Node IP with –A option. In case you have Service VPS without the NAT mode, you will use the Service VPS IP with –A option.

In the example below, this backup script allows all the VE’s to be backed up at once:
————-
@echo off
for /F “skip=3 usebackq tokens=*” %%i in (`cmd /c “vzlist -ao veid”`) do (cmd /c “vzbackup “%%i && echo VPS ID %%i has been backed up!)
————-

Comments Bookmark on del.icio.us

OpenVZ

OpenVZ allows to have multiple Virtual Environment (up to as many as several hundreds) on a single Hardware Node.

Who needs OpenVZ?

The short answer is - every system administrator needs it. Some examples of practical applications:

  • Hosting - all ranges on the same platform, from low-level shared to medium-power virtual server to powerful dedicated servers - seamless scaling up in the same safe virtual private server.
  • Server consolidation - put together your existing servers and use more powerful and reliable hardware.
  • Increase availability - keep an up-to-date copy of your virtual private server on another server, and start it in seconds in case of failure
  • Education - each student gets its own virtual server with root access
  • Testing - safe experimentation on the machine that runs another services
  • Clean sandbox - install each service in its own freshly created Virtual Private Server, and you will never have to resolve dependency problems
  • Improve network services security - run each server in its own Virtual Private Server. If the application has a security hole, only this particular virtual private server will be compromised, never the whole system.

Highlights of OpenVZ technology

In short, OpenVZ is the only highly scalable virtulization technology with near-zero overhead, strong isolation and rapid customer provisioning that’s ready for production use right now. Deployment of OpenVZ improves efficiency, flexibility and quality of service in the enterprise environment.
How scalable is OpenVZ?

OpenVZ technology scales up pretty well - we’ve tested it on machines up to 8CPU and up to 64GB of RAM. Besides, single virtual private server could be scaled up from taking a little fraction of available resources up to all resources available dynamically - you do not even have to restart the virtual private server.
How OpenVZ improves efficiency of services?

For existing hardware, OpenVZ allows to utilize its processing power better by improving average load from 3-5% to at least 30-50%, while still providing ability to handle peak loads. To decrease complexity, OpenVZ provides standardized and centralised server management, logically decoupled from actual hardware. And when its time to buy new servers, you can now use few more powerful servers instead of many little ones - with added benefits of better reliability, better peak performance and typically longer lifespan.

How OpenVZ improves flexibility of services?

By providing unified scalable platform with such unique features as rapid application and updates provisioning. Each Virtual Private Server is hardware independent and can be moved to another OpenVZ-based system in seconds over the network. This allows for ease of hardware maintenance (move out all VPS and do whatever you need with the box) and improved availability (keep a synchronized copy of your virtual private server elsewhere and start it up when primary service failed). If your old box is not able to cope with peak load anymore, just move your VPS to a new one.

Performance expectations

Peak performance is achieved when only one VPS has active tasks. In this case, it could use 100% of available resources - all CPUs, all physical memory, all disk and network bandwidth. OpenVZ is not limiting you to a single-CPU virtual machine.

Comments Bookmark on del.icio.us

Untar a Unix / Linux file

How to untar a Unix / Linux file ?
Unzipping files is an important part of downloading Linux files from the Internet. In Linux a majority of the files that are downloaded are in tgz format (a gnu zipped tar file), although there are other common extensions, as shown here:
[filename].tgz
[filename].tar
[filename].tar.gz
[filename].tar.z
[filename].z

Extraction

First you upload the .tgz, .tar .tar.gz or .tar.z file to the directory on your web server designated for public Internet use. Typically this directory is named ‘www’, ‘htdocs’ or ‘web’. The file should be uploaded in BINARY format using any FTP program.

Once the installation file has been uploaded, connect to your web server using a terminal emulation program. One of the most popular of these programs is Telnet. Enter your username and password when prompted, then change to the directory on your web server designated for Internet use. If this directory is named ‘www’, you should type the following command at the prompt:

cd /usr/dom/www or cd /home/sites/me/web

Always start from the root directory (/).

With files that have the .tgz, tar.gz, or tar.z extension use this command:

tar -zxvf [filename with all extensions]

example: tar -zxvf yourfile.tar.gz

This will extract the file for you in the directory you are currently in. Using the above command will save you from having to redirect the output for gzip or anything else (because the z option automatically decompresses the file for you), otherwise without the z argument, you would have to do a command like this:

uncompress [filename with all extensions]

tar -xvf [filename with only tar extension]

Other ways to decompress files are to use:

gunzip [filename with .gz extension] - f.e. gunzip yourfile.gz

zcat [filename with .gz extension] - f.e. zcat yourfile.gz

uncompress [filename with .z extension] - f.e. uncompress yourfile.z

Not all Unix systems extract archive files with all the necessary permissions intact, therefore you should set the proper permissions on the program as required.

Using Telnet type the following at the prompt:

chmod -R 777 “directoryname”
cd “directoryname”
chmod 755 cgi-bin
cd cgi-bin
chmod 755 *.cgi
chmod 755 *.pl

You can also use most FTP clients to change the file attributes. 777 (RWX-RWX-RWX) and 755 (RWX-RX-RX) are the most widely used attributes for files relating to running most CGI scripts on a server.

Reply With Quote

Comments Bookmark on del.icio.us

Simple DNS cluster

This is usually a work around for DNS clustering on two Plesk servers.
But should work without problems on any Linux server, just some paths will need to be modified.

1. Install the following script in /var/named/run-root/etc on the primary server:
——————————————————————————————————————————–
#!/bin/sh

MASTER=CHANGEME
NAMED_ROOT=/var/named/run-root/etc
HTTPDOCS=/var/www/vhosts/default/htdocs/

egrep “^zone” $NAMED_ROOT/named.conf |egrep -iv “arpa|\”\.” | awk -F\” ‘{print $2}’ > $NAMED_ROOT/domains

echo > $HTTPDOCS/secondaries.include
for i in `cat $NAMED_ROOT/domains`; do
echo “zone \”$i\” {” >> $HTTPDOCS/secondaries.include
echo ” type slave;” >> $HTTPDOCS/secondaries.include
echo ” file \”slave/$i\”;” >> $HTTPDOCS/secondaries.include
echo ” masters { $MASTER; };” >> $HTTPDOCS/secondaries.include
echo ” allow-transfer { none; };” >> $HTTPDOCS/secondaries.include
echo “};” >> $HTTPDOCS/secondaries.include
echo >> $HTTPDOCS/secondaries.include
done

chmod 644 $HTTPDOCS/secondaries.include
———————————————————————————————————————————–
Name the script gen-secondaries.sh, chmod to 755
Once installed, edit line “MASTER=CHANGEME” in the script, where CHANGEME put the IP address of the primary server.

2.Edit the named.conf on primary nameserver and add the following line:
acl common-allow-transfer {
NS2 IP address;
};

NOTE: If “acl common-allow-transfer” exists already then simply put in the IP of the secondary name server in there.

3.(Only on Plesk Servers)Add a global allow rule into the PSA database

mysql -u admin -p`cat /etc/psa/.psa.shadow` psa

insert misc values (’DNS_Allow_Transfer01′,’IPofsecondarynameserver’) ;

Note: Replace ‘IPofsecondarynameserver’ with the IP of the secondary nameserver and make sure to do this on BOTH the nameservers.

4. Put in the following crons on the primary server:

0 12 * * * /var/named/run-root/etc/gen-secondaries.sh > /dev/null 2>&1
5 12 * * * /etc/init.d/named restart > /dev/null 2>&1

5. Install the following script in /var/named/run-root/etc on the secondary nameserver :
———————————————————————————————————————————–
#!/bin/sh

MASTER=CHANGEME
FILE=secondaries.include

rm $FILE.tmp
wget http://$MASTER/$FILE -O $FILE.tmp

# works on RH9
#SIZE=`stat -c%s $FILE.tmp`

# works on everything
SIZE=`stat $FILE.tmp |grep Size |awk ‘{print $2}’`

if [ $SIZE = 0 ]; then
echo “ERROR! The secondary file is 0 length!”
exit 1
else
mv $FILE.tmp $FILE
chmod 644 $FILE
fi
———————————————————————————————————————————-
Name the script to xfer-config.sh and chmod to 755
Again edit the CHANGEME to the ip address of the PRIMARY Name server.

6. Edit named.conf on the secondary nameserver and add the following:
acl common-allow-transfer {
NS2 IP address;
};

NOTE: If “acl common-allow-transfer” exists already then simply put in the IP of the secondary name server in there.

and

include “/etc/secondaries.include”;

at the bottom of named.conf

7. Create a symlink for secondaries.include in /etc
cd /etc
ln -s /var/named/run-root/etc/secondaries.include secondaries.include

8.Install the following cron on the secondary nameserver:

10 12 * * * /var/named/run-root/etc/xfer-config.sh > /dev/null 2>&1
20 12 * * * /etc/init.d/named restart > /dev/null 2>&1

9.(Only on Plesk Servers) In Plesk control panel, login as ‘admin’ username and choose Server from
the menu on the left -> DNS -> Add NS records for secondary nameserver on both nameservers.

How to check if it works:
1. Create a test account on the primary nameserver.
2.Run the scripts in the following order:
a.gen-secondaries.sh (on primary)
b./etc/init.d/named reload (on primary)
c.xfer-config.sh (on secondary)
d./etc/init.d/named reload (on secondary)
You should see the zone file for the domain on the secondary domain created at /var/named/run-root/var/.

Comments Bookmark on del.icio.us

DNS configuration

What is DNS?

The Domain Name System (DNS) is a distributed Internet directory service. DNS is used to translate domain names into IP addresses, and to control Internet e-mail delivery. The DNS directory service consists of DNS data, DNS servers, and Internet protocols for fetching data from the servers. The billions of resource records in the DNS directory are split into millions of files called zones. Zones are kept on authoritative servers distributed all over the Internet, which answer queries according to the DNS network protocols. In contrast, caching servers simply query the authoritative servers and cache any replies. Most servers are authoritative for some zones and perform a caching function for all other DNS information. Most DNS servers are authoritative for just a few zones, but larger servers are authoritative for thousands of zones.

Since most dedicated server or shared server are Unix machines, the most used program is BIND (Berkeley Internet Name Domain). BIND 9.2.1 is the latest release of BIND. DNS software is made up of two components the name server and a resolver. The name server responds to browser requests by supplying name-to-address conversions. When it doesn’t know the address, the resolver will ask another name server for the information.

How does DNS work?

At the top of the DNS database tree are root name servers, which contain pointers to master name servers for each of the top-level domains (.com, .net, etc.). For example, to find out the numeric IP address of www.eukhost.com, a DNS server would ask the root name server for the address of the master name server for the .net domain. The master name servers for each of the top-level domains contain a record and name-server address of each domain name. So the DNS server asks the .net server for the name of the server that handles the simplythebest.net domain. The individual name server for each domain name contains detailed address information for the hosts in that domain. So the DNS server asks the eukhost.com server for the name of the server that handles the simplythebest.net domain. Finally this name server supplies the DNS server with the IP address of the machine called www.eukhost.com.

When you type in a URL, your browser sends a request to the closest name server. If that server has ever received a request for the same host name (within a time period set by the administrator to prevent passing old information), it will locate the information in its cache and reply. If the name server is unfamiliar with the domain name, the resolver will ask a server further up the tree. If that doesn’t help that server will ask yet another, until it finds a server that knows. A server that knows the address without asking another is an authoritative server. Once the address is located, it is sent back to your browser and you get to see the related web site.

Setting up a DNS server

There are two ways to configure DNS. You can use your ISP’s DNS server or you set up your own DNS server. In the first case you don’t have to register the name server (your ISP already did) with a domain registrar, in the latter case you will have to appoint a NS1 and NS2 name server, f.e. ns1.eukhost.com, and ns2.eukhost.com (a primary and a secondary name server).

In both cases, you will have to provide your domain registrar with at least two name server addresses to link to your domain. You will also have to add these DNS addresses to your TCP/IP stack on your server. If your ISP provides the DNS server you need to forward him any domain names which will reside on your server. Your ISP will then add the necessary MX records and A records to the DNS server.

MX records
If you want to receive e-mail from the Internet, you will need to have a Mail Exchange (MX) record for your domain in your ISPs or your own DNS database. An MX record has 3 parts: your domain name, the name of the machine that will accept mail for the domain, and a preference value. The preference value lets you build in a priority level, f.e. etech.net mail.etech.net 0. You can set multiple MX records, and the mail server will attempt the one with the lowest preference value first, and if it fails try the next, and so forth.

A records
A records associate IP addresses with computer names. For example, an A record links the name ‘yourdomain.com’ to the IP address of your Web server.

CNAME records
DNS allows machines to have a true (canonical name), as well as an unlimited number of aliases. The CNAME record takes care of aliases. CNAME records can be useful when you want a subdomain to point to a computer outside of your domain.
Reply With Quote

Comments Bookmark on del.icio.us

« Previous entries · Next entries »