How to install Webhosting Guide

Apache PHP Mysql Bind DNS Yum

Archive for the 'AdminTutorials' Category

lingerd - Setup and Installation

lingerd - Setup and Installation

WHAT IS LINGERD?

Under high load, a dynamic page server running Apache with mod_php spends a lot of its time doing an operation called “lingering close”, which amounts to waiting a second or two on a connection just to make sure it gets closed properly.

Lingerd, then, is a daemon (service) designed to take over this job. Unlike Apache, which uses one process per connection, lingerd can do thousands of lingers in parallel, from a single process. The end result is that Apache needs much fewer running processes to handle the same load, which greatly increases its scalability, and diminishes the load on the server.

For technical reasons, lingerd is only effective on servers where keep-alives are disabled. To get the most out of your servers, for a high traffic site, you need to have the dynamic webpages served from one Apache server, and the images and other static data from another. The dynamic page server can then use lingerd.
HOW STABLE IS IT?

Lingerd has been in production use for a few months, and has lingered nearly 2,000,000 connections with no errors, under Linux.

More testing is still needed under other platforms (eg BSD, Solaris). Lingerd is not portable to Windows.
WHERE DO I FIND IT?

The homepage for lingerd is at http://www.iagora.com/about/software/lingerd/

The daemon itself can be found at ftp://iagora.com/pub/software/lingerd/lingerd-0.94.tar.gz
HOW DO I USE IT?

Installing lingerd is fairly simple, but it does require recompiling Apache from source.

Here are some quick installation instructions for Apache with mod_php and lingerd (see http://www.phpbuilder.com/manual/install-unix.php for more details), under Unix or Linux:

1. tar zxvf apache_1.3.x.tar.gz
2. tar zxvf php-3.0.x.tar
3. tar zxvf lingerd-0.94.tar
4. cd lingerd-0.94
5. vi config.h
(set the right directories for SOCKPATH and PID_FILE; these directories
must be writeable by the userid that Apache runs as)
6. vi apache-1.3/ap_lingerd.h
(set SOCKPATH here too)
7. make ; make install
(also set the system up to start lingerd automatically, e.g by
adding the line “/usr/local/sbin/lingerd” to your
/etc/rc.d/rc.local file)
8. cp apache-1.3/ap_lingerd.* ../apache_1.3.x/src/main/
9. cd ../apache_1.3.x
10. patch -p0 -d src/ < ../lingerd-0.94/apache-1.3/aplinger.diff
11. ./configure --prefix=/www
12. cd ../php-3.0.x
13. ./configure --with-mysql --with-apache=../apache_1.3.x --enable-track-vars
14. make ; make install
15. cd ../apache_1.3.x
16. ./configure --prefix=/www --activate-module=src/modules/php3/libphp3.a
17. make ; make install

To see if lingerd is running, and how many connections it has been handling, watch out for its messages in /var/log/messages.

Lingerd is not tightly tied to the dynamic programming language, so it can be used with PHP3, PHP4, and also with other scripting engines like mod_perl, mod_snake or mod_dtcl.

You can find more information about lingerd in its homepage at http://www.iagora.com/about/software/lingerd/ , and in the documentation files included in the distribution.

No comments

Installing Pico on FreeBSD

Installing Pico on FreeBSD

Pico is a simple, display-oriented text editor based on the Pine message system composer. As with Pine, commands are displayed at the bottom of the screen, and context-sensitive help is provided. As characters are typed they are immediately inserted into the text.
Editing commands are entered using control-key combinations. As a work-around for communications programs that swallow certain control characters, you can emulate a control key by pressing ESCAPE twice, followed by the desired control character, e.g. “ESC ESC c” would be equivalent to entering a ctrl-c. The editor has five basic features: paragraph justification, searching, block cut/paste, a spelling checker, and a file browser.

Installing Pico

Login to SSH as root.

Sometimes, direct root login is disabled. If it is disabled do the following:

# su -
# password: [Enter your WHM root pass]
# [Hostname]: [Ready to work ]

To Download ports:
# /stand/sysinstall
- Go to Configure (post install)
- Go to Distributions
- Select ‘ports’
- Select ‘ok’
From there select FTP transfer (ftp.freebsd.org is ok) and it should download the ports into /usr/ports. When it’s done, just exist sysinstall and run the commands I stated earlier.

It’ll take a while to download.

after its finished downloading, do this:

# cd /usr/ports/editors/pico
# make install

This will install Pico for you, then you are finished!

Pico Commands

Options
+n
Causes pico to be started with the cursor located n lines into the file. (Note: no space between “+” sign and number)
-a
Display all files including those beginning with a period (.).
-b
Enable the option to Replace text matches found using the “Where is” command.
-d
Rebind the “delete” key so the character the cursor is on is rubbed out rather than the character to its left.
-e
Enable file name completion.
-f
Use function keys for commands. This option supported only in conjunction with UW Enhanced NCSA telnet.
-h
List valid command line options.
-j
Enable “Goto” command in the file browser. This enables the command to permit explicitly telling pilot which directory to visit.
-g
Enable “Show Cursor” mode in file browser. Cause cursor to be positioned before the current selection rather than placed at the lower left of the display.
-k
Causes “Cut Text” command to remove characters from the cursor position to the end of the line rather than remove the entire line.
-m
Enable mouse functionality. This only works when pico is run from within an X Window System “xterm” window.
-nn
The -nn option enables new mail notification. The n argument is optional, and specifies how often, in seconds, your mailbox is checked for new mail. For example, -n60 causes pico to check for new mail once every minute. The default interval is 180 seconds, while the minimum allowed is 30. (Note: no space between “n” and the number)
-o dir
Sets operating directory. Only files within this directory are accessible. Likewise, the file browser is limited to the specified directory subtree.
-rn
Sets column used to limit the “Justify” command’s right margin
-s speller
Specify an alternate program spell to use when spell checking.
-t
Enable “tool” mode. Intended for when pico is used as the editor within other tools (e.g., Elm, Pnews). Pico will not prompt for save on exit, and will not rename the buffer during the “Write Out” command.
-v
View the file only, disallowing any editing.
-version
Print Pico version and exit.
-w
Disable word wrap (thus allow editing of long lines).
-x
Disable keymenu at the bottom of the screen.
-z
Enable ^Z suspension of pico.
-q
Termcap or terminfo definition for input escape sequences are used in preference to sequences defined by default. This option is only available if pico was compiled with the TERMCAP_WINS define turned on.

Written by: Ibrahim Ezzy (ibrahim.Ezzy@Searchxs.com) and allera.

No comments

Customizing PHP Safe Mode

Customizing PHP Safe Mode

We’ll guide you through using PHP safe_mode and how-to enable it and to customize it for certain sites on your server. When using PHP as an Apache module, you can also change the configuration settings using directives in Apache configuration files (e.g. httpd.conf) and .htaccess files. PHP safe_mode is very important to in terms of server security because it restricts and disables the dangerous functions in PHP from the scripts like PHP Shell that can otherwise cause damages to your server and client sites.

Using PHP Safe_Mode

First of all we’ll take care of the files that you will edit, and make sure to have copy or backup .

Activate Safe Mode Globally

It is very simple to active safe mode on the entire server. All you need to do is just edit the php.ini file. If you can’t find where php.ini is or have multiple copies on your server the best thing to do is run phpinfo() to find it. Open up Notepad or your favorite HTML editor and paste in the following from this file.

http://www.webhostgear.com/phpinfo.phps

Save it as phpinfo.php and upload it to a website that you want to test on your server. Type in the URL and you’ll get a PHP configuration page telling you exactly where php.ini is located and all kinds of other useful information about the sites and servers configuration settings.

A few lines down you’ll see this:
Configuration File (php.ini) Path: /usr/local/Zend/etc/php.ini
Now that we know the location of php.ini we can proceed to edit it.

1) Open up php.ini in your shell with your favorite editing program.
pico /path to php/php.ini (replace with the path to your php.ini file)

2) Find the following line: safe_mode
Ctrl + W and type in: safe_mode

3) Turning safe mode on or off.
safe_mode = Off

You may active it by or turn it off by changing it to either On OR Off.
safe_mode = On

Good! Now save the file by ctrl + x  then y

4) Restart the Apache web server by
/etc/init.d/httpd restart

Now safe_mode is active on all your server accounts.

Activate Safe Mode Using Per Site Basis

Now if you have scripts that require safe mode off like Modernbill or any script doesn’t work well with safe_mode on what you will do? Disable safe_mode on the entire server just for these scripts? This isn’t very practical when you can disable php safe mode per user account/site basis.

Let’s do it!
1) SSH to your server and login as root.

2) Then find the httpd.conf, normally it’s in /etc/httpd/conf/  or  /usr/local/apache/conf/
If it’s not in either of those places try search for it: locate httpd.conf

3) Then find the site you wish to edit.
Ctrl+W and type in the domain name

You should see something like this


ServerAlias www.domain.net domain.net
ServerAdmin webmaster@domain.net
DocumentRoot /home/domain/public_html
BytesLog domlogs/domain.net-bytes_log
ServerName www.domain.net
User domain
Group domain
CustomLog domlogs/domain.net combined
ScriptAlias /cgi-bin/ /home/domain/public_html/cgi-bin/

4) Now add this line:

php_admin_flag safe_mode Off

We have also found that the following works as well if the above does not but DO NOT USE BOTH, pick one!

php_admin_value safe_mode 0

to be like this :


ServerAlias www.domain.net domain.net
ServerAdmin webmaster@domain.net
DocumentRoot /home/domain/public_html
php_admin_flag safe_mode Off
BytesLog domlogs/domain.net-bytes_log
ServerName www.domain.net
User domain
Group domain
CustomLog domlogs/domain.net combined
ScriptAlias /cgi-bin/ /home/domain/public_html/cgi-bin/

5) Good :) Now save the changes.
Ctrl + X then Y

6) Restart the Apache web server by
/etc/init.d/httpd restart

Final Words

PHP Safe mode should be on by default on all your servers for added security. However there are some scripts that are not compatible with it on so you have to make an exception to some client sites. Make sure you know why they’re requesting to have it turned off because it is much more secure for everyone to have it on.

If you run into trouble after editing httpd.conf you can run the apachectl configtest
in shell. This will test the Apache configuration for errors and report them back to you if you can’t start it, very handy indeed!
More PHP customizing commands here: http://php.us.themoes.org/manual/en/configuration.changes.php

Article from: http://webhostgear.com/166.html

No comments

Linux Distributions

Linux Distributions
Who among us hasn’t heard of Linux yet? You know, that freely distributable ‘flavor’ of the Unix class of operating systems? Not a lot, probably. But do you all know that Linux comes in many distributions or ‘distros’ as the natives call it? Or, that, there are over a hundred of these ‘distros’ available online or otherwise?

That’s what I thought.

Well, if you’re a novice, like me, or not-so-new to the field but would like a memory jog, herein then is a quick tour of six of the most commonly used (at least, in my own humble opinion) in web hosting servers that are available under GNU-GPL, listed in alphabetical order.

Debian GNU/Linux is a free OS that uses the Linux kernel although most of its basic tools come from the GNU project. There are three releases in active maintenance as of this writing are: Version 3.0r2, codename: woody, (stable); codename: sarge (testing) and codename: sid (unstable).

Mandrake Linux was created in 1998 by MandrakeSoft, and takes a graphical approach to both installation and system administration. Mandrakelinux™ 10.0 is the latest release.

Red Hat Linux is probably the most popular, although not necessarily the best, of the lot. It was created in 1994 by Marc Ewing, developed by Red Hat Software (now Red Hat Inc.), and has evolved into two main product lines. The Red Hat Enterprise Linux was created in 2002 to become (according to their site anyway) the corporate Linux standard, and its latest release is version 3.0. The Fedora Project, introduced in 2003, for developers and enthusiasts using Linux in non-critical computing environments.

SuSE Linux is the distribution produced by SuSE GmbH. The main selling point emphasized by the company for its latest release, the SuSE Linux 9.0, is the inclusion of of innovative technologies to facilitate system migration for Linux newcomers. This, aside from all Internet, office, images, audio, video and network applications you could possibly want (or so their site says).

Slackware Linux was originally developed by Patrick Volkerding and first released in April 1993. It is a complete 32-bit multitasking UNIX-like system based currently around the 2.4 Linux kernel series and the GNU C Library version 2.3.2 (libc6). Its latest release is Slackware 9.1.

TurboLinux is the leading Linux distribution in the Asia-Pacific. Its unique clustering solution allows the construction of highly available and scalable networks based on low-cost commodity components. Its latest releases are the Turbolinux 10 Desktop, Turbolinux 8 Server and Turbolinux Enterprise Server 8.

CentOS is one of the free versions of the popular Red Hat Enterprise Linux, arguably just as functional, and the major benifit of being completely free.

White Box Linux is also another free clone of Red Hat Enterprise Linux

Parts from http://www.hostingvoice.com/

No comments

UNIX Flavors (Distributions)

UNIX Flavors (Distributions)

Which operating system is best for web hosting?

It seemed a simple enough topic, or so this web hosting novice thought. So I went through countless of sites in search of the answer and came up with a list of Web Hosting Operating Systems to choose from. Whereupon I concluded that there really wasn’t a system that would prove ‘best’ for all. It was, for the most part, simply a matter of needs, and of course, of preference, both from the web host’s and the web master’s points of view.

That takes care of that! Right? Well, not quite. I realized, in the course of my research, that from this list, another ‘list’ begged to be made. A list, that seemed necessary if one were to make an informed choice when it comes to operating systems.

This list, of course, is that of the many Unix ‘flavors’ available in the market. Unless you’re an expert, or simply a fanatic, chances are the concept of Unix having ‘flavors’ came as a surprise. Who knew flavors could apply to things other than ice cream, or food for that matter?

So what exactly is a Unix flavor?

About.com defines it as an implementation of Unix, with each flavor, designed to work with different types of hardware, and having its own unique commands or features. The UGU site provides one of the more comprehensive lists of Unix flavors, but for those who don’t feel like going though all those links, below is an overview of the more popular ones.

Flavors that are available commercially (read: sold) include:

Solaris – Sun Microsystems’ implementation, of which there are different kinds available: these are Solaris OS for SPARC platforms, Solaris OS for x86 platforms, and Trusted Solaris for both SPARC & x86 platforms; the latest version is Solaris 10 OS

AIX – short for Advanced Interactive eXecutive; IBM’s implementation, the latest release of which, is the AIX 5L version 5.2.

SCO UnixWare and OpenServer – are implementations derived from the original AT&T Unix® source code acquired by the Santa Cruz Operation Inc. from Novell, and later on bought by Caldera Systems; the latest versions are UnixWare 7.1.3 and OpenServer 5.0.7

BSD/OS – the Berkeley Software Distribution (BSD) Unix implementation from Wind River; its latest version is the BSD/OS 5.1 Internet Server Edition

IRIX – the proprietary version of Unix from Silicon Graphics Inc.; the latest release of which is IRIX 6.5

HP-UX – short for Hewlett-Packard UniX; the latest version is the HP-UX 11i

Tru64 UNIX – the Unix operating environment for HP AlphaServer systems; Tru64 UNIX v5.1B-1 is the latest version

Mac OS – Mac operating system from Apple Computer Inc. having a Unix core; the latest version is the Mac OS X Panther

Flavors that are available for free, include:

FreeBSD – derived from BSD, it is an advanced OS for x86 compatible AMD64, Alpha, IA-64, PC-98 and UltraSPARC® architectures; the latest versions are FreeBSD 5.2.1 (New Technology Release) and the FreeBSD 4.9 (Production Release)

NetBSD – Unix-like OS derived from BSD and developed by The NetBSD Project; it is shipped under a BSD license and the latest release is NetBSD 1.6.2

OpenBSD – multi-platform 4.4BSD-based Unix-like OS from The OpenBSD project; its latest release is OpenBSD 3.4

Linux — a Unix-type OS originally created by Linus Torvalds, the source code of which is available freely and open for development under GNU General Public License; there are numerous Linux distributions available

A more detailed discussion of these flavors will be provided in future postings, so do come back soon.

NOTES:

Free in this case means that the software is free (to use), but does not necessarily mean that users won’t shell out money to get their own copy(ies). Suppliers may charge a nominal fee for materials used to copy/distribute these (i.e. CDs) and for shipping (if applicable).

BSD license simply put means that users are allowed to develop products based on NetBSD without the changes having to be made public

Although Linux has traditionally been freely available, the ongoing case by SCO against IBM and the rest of the Linux community might change this. A more detailed posting will be made on this topic in the coming days.

 

From http://www.hostingvoice.com/

No comments

« Previous PageNext Page »