Tuesday, March 24, 2009

Apache server response codes

Apache server response codes

Introduction

Whenever a user sends a request to a server, a process called a ‘handshake’ begins where the server and your computer communicate and the server makes sure it can accommodate what your user has requested of it. This means being able to make the connection between the two computers and then completing the transfer of data.

Headers are short fragments of text which are generated by servers to hold information pertaining to each transfer as it occurs. There are four kinds of headers:

General

This holds information about the client (user), the server itself and the protocol being used (like http or ftp).
Entity This holds information about the data that is being transferred.

Request

This holds information about the allowable formats and parameters for the transfer.

Response

This is sent out by the server at the end of a transfer, and includes detailed information, in code form, on the outcome of the transfer.

Response Codes

As a web surfer you've probably become familiar with the dreaded 404 error message and the 500 internal server error.

If you get a 404 make sure your link is correct. Case does matter.A 500 Error is the result of a misconfigured CGI script or a misconfigured .htaccess file,. These are the most well-known server response codes, but there are many more. These numerical codes are grouped — the low numbers are generally ‘good’, and operate silently, while anything over 400 is definitely bad news and will be reported to the user in the form of an error message.

Error Code

Explanation

100-199

Silent Response Codes that signify that a request has been received and is currently being processed.

100

The request has been completed and the rest of the process can continue.

101

The user's request to switch protocols (like from FTP to HTTP) was accepted.

200-299

Silent codes that confirm that requests have completed successfully.

200

Ok — the file which the client requested is available for transfer. This is the response code you want to see all of your users receiving.

201

When new pages are created by posted form data or by a CGI process, this is confirmation that it worked.

202

The client's request was accepted, though not yet processed.

203

The information contained in the entity header is not from the original site, but from a third party server.

204

If you click a link which has no target URL, this response is elicited by the server. It's silent and doesn't warn the user about anything.

205

This allows the server to reset any content returned by a CGI.

206

Partial content — the requested file wasn't downloaded entirely. This is returned when the user presses the stop button before a page is loaded, for example.

300-399

A redirection is occurring from the original request.

300

The requested address refers to more than one file. Depending on how the server is configured, you get an error or a choice of which page you want.

301

Moved Permanently — if the server is set up properly it will automatically redirect the reader to the new location of the file.

302

Found — page has been moved temporarily, and the new URL is available. You should be sent there by the server.

303

This is a "see other" SRC. Data is somewhere else and the GET method is used to retrieve it.

304

Not Modified — if the request header includes an 'if modified since' parameter, this code will be returned if the file has not changed since that date. Search engine robots may generate a lot of these.

400-499

Request is incomplete for some reason.

400

Bad Request — there is a syntax error in the request, and it is denied.

401

The request header did not contain the necessary authentication codes, and the client is denied access.

402

Payment is required. This code is not yet in operation.

403

Forbidden — the client is not allowed to see a certain file. This is also returned at times when the server doesn't want any more visitors.

404

Document not found — the requested file was not found on the server. Possibly because it was deleted, or never existed before. Often caused by misspellings of URLs.

405

The method you are using to access the file is not allowed.

406

The requested file exists but cannot be used as the client system doesn't understand the format the file is configured for.

407

The request must be authorised before it can take place.

408

Request Timeout — the server took longer than its allowed time to process the request. Often caused by heavy net traffic.

409

Too many concurrent requests for a single file.

410

The file used to be in this position, but is there no longer.

411

The request is missing its Content-Length header.

412

A certain configuration is required for this file to be delivered, but the client has not set this up.

413

The requested file was too big to process.

414

The address you entered was overly long for the server.

415

The filetype of the request is unsupported.

500-599

Errors have occurred in the server itself.

500

Internal Server Error — nasty response that is usually caused by a problem in your Perl code when a CGI program is run.

501

The request cannot be carried out by the server.

502

Bad Gateway — the server you're trying to reach is sending back errors.

503

Temporarily Unavailable — the service or file that is being requested is not currently available.

504

The gateway has timed out. Like the 408 timeout error, but this one occurs at the gateway of the server.

505

The HTTP protocol you are asking for is not supported.

Wednesday, March 18, 2009

Using syslog or syslog-ng with slapd for OpenLDAP logging

OpenLDAP Quick Tips: Using syslog or syslog-ng with slapd for OpenLDAP logging

Friday, November 14. 2008

Open Source OpenLDAP Suretec
Hi All,

Here's my third tip in the "OpenLDAP Quick Tips" series:

"You want to enable logging via syslog or syslog-ng for your directory server":

For syslog, depending on your distro, you would edit /etc/syslog.conf or /etc/rsyslog.conf:



CODE:
# LDAP[?] logs LOCAL4.* -/var/log/openldap.log


and then restart syslog/rsyslog:

CODE:
/etc/init.d/syslog restart


For syslog-ng, the following will work:

CODE:
source s_all { unix-stream("/dev/log"); internal(); }; destination d_ldap { file("/var/log/ldap[?].log"); }; filter f_syslog { not facility(auth, authpriv) and not match(slapd); }; filter f_ldap { match("slapd"); }; log { source(s_all); filter(f_syslog); destination(d_syslog); }; log { source(s_all); filter(f_ldap); destination(d_ldap); };


You can also add:

CODE:
options { sync(n); };


and then restart as per your distro tools.

Thanks,

Gavin.

Monday, March 16, 2009

vista + mbr + grub

So you can boot XP and Ubuntu completely, just not Vista?
This is not a grub error or you wouldn't get a Welcome screen.
Vista needs to be repaired. The first step to try is Testdisk
because the second step of using Vista's Startup Repair makes 
some more work of restoring the Ubuntu grub menu to the MBR.

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

I borrowed this advice from meierfra about using
Testdisk. sda is the first drive and sdb is the second drive and so on.

"You might try testdisk to rebuild the Boot sector:

Code:

sudo apt-get install testdisk
sudo testdisk /dev/sda

Choose "proceed" on the first screen, then
"intel"
"advanced",
Select the Windows partition (although it should be selected already) and choose
"boot"
"RebuildBS"

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

RebuildBS uses a backup of your boot sector. If the backup and
the current boot sector are not identical then you want to use
Testdisk to restore the backup (maybe it says write).

If you have a Vista OEM recovery cd, rather than a Vista install cd
http://neosmart.net/blog/2008/window...disc-download/

bootrec /fixmbr
bootrec /fixboot
bootrec /rebuildbcd

Tuesday, March 10, 2009

extract *.tgz

tar xvzf file.tar.gz
tar xvzf file.tgz

Monday, March 9, 2009

softwares

windows activation tools
http://www.megaupload.com/?d=R4RYCC6N

Sunday, March 8, 2009

administrator log on on vista

Enable the Administrator Account

  1. Open the command prompt with Administrative privileges by opening the Start Menu, and typing cmd in the search box, and then press Ctrl+Shift+Enter or click the Start orb, All Programs, Accessories, right-click Command Prompt and select Run as administrator.
  2. Type the following in the command prompt and press Enter after:

    net user administrator /active:yes

  3. Restart your computer and logon as Administrator.

Note: You might want to set a password for the administrator’s account for at least a little protection.