Networking


Hello,

To get the apache version on linux server we have to use following command.

# /usr/local/apache/bin/httpd -v

To get the php version on linux server we have to use following command.

#php -v

you can get the php modules install on server with command #php -m
To get the mysql version on linux server we have to use following command.

#mysql -v

To stop other sites directly linking to your images and media files and stealing your bandwidth You need to add following code in your .htaccess file

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?domain.com(/)?.*$ [NC]
RewriteRule .*.(gif|jpg|jpeg|bmp|wmv)$ http://www.domain.com/image.jpg [R,NC]

Note: replace your website with domain.com

Note: Please don’t disable the Windows Firewall unless and until you have the other appropriate firewall software installed on your system

There are mainly three methods for disabling the Windows Firewall. The first method is for any user with administrative privileges on an individual machine not remotely or collectively managed in any way. The other two methods are for use windows Administrators on fully managed systems or windows servers.

1) Using the Control Panel

This method is for any user with administrative access to unmanaged systems

1. From the Start menu, select Control Panel, then select Windows Firewall.
2. Select Off, then click Ok.

2) Using Local Policy

This method is for administrators with administrative access to unmanaged systems or locally managed systems where the machine is not part of a Windows 2000 or higher domain.

Go to Start menu >> select Run, here enter gpedit.msc.
Expand the Computer Configuration folder, then the Administrative Templates folder.
Expand the Network folder, then the Network Connections folder, then the Windows Firewall folder.
Select the Standard Profile folder.
Double-click the Windows Firewall: Protect all network connections option.
Select Disabled, then click OK.
Select the Domain Profile folder.
Double-click the Windows Firewall: Protect all network connections option.
Select Disabled, then click OK.
Close the Group Policy dialog box.

3) Using Group Policy

This method is for administrators with administrative access to managed machines that are part of a Windows 2000 or 2003 Active Directory domain.

Create a new Group Policy object, and give the object a descriptive name (for example, ITS-Turn off Windows Firewall).
Select the newly created group policy.
Right-click on the newly created policy and select Edit.
Expand the Computer Configuration folder, then the Administrative Templates folder.
Expand the Network folder, then the Network Connections folder, then the Windows Firewall folder.
Select the Standard Profile folder.
Double-click the Windows Firewall: Protect all network connections option.
Select Disabled, then click OK.
Select the Domain Profile folder.
Double-click the Windows Firewall: Protect all network connections option.
Select Disabled, then click OK.
Close the Group Policy dialog box.
In the Security Filter section, click Add.
Search for the objects that this group policy will be applied to, then click OK.
Close the Group Policy editor.

Understanding cURL :

It is a command line tool used for transfer of your file with URL from or to a server, using supported protocols such as (FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, FILE and LDAP)
This command is designed to work if you don’t want user interaction ie to automate unattended file transfers or sequences of operations; Just fire the command with proper parameters and sit aside. You can view the status of process at any time as cURL normally displays a progress meter during operations, indicating amount of transfered data, transfer speeds and estimated time left etc.

However if you invoke curl to write some data at some terminal then this progress meter gets disable otherwise it would mess up the output mixing progress meter and response data.

The URL syntax is protocol dependent if you don’t specify any protocol cURL will take it as HTTP by default. Curl will attempt to re-use connections for multiple file transfers, so that getting many files from the same server will not do multiple connects this improves transfer speed.

Every Web servers maintain some sort of system that stores information about which pages, images, and files are requested, who requests them, and how many bytes are transferred etc in a file called log file. With log file analysis tools, it’s possible to get a good idea about your visitors such as were they are coming from, how often they return, and how they navigate through your site, which pages are most visited etc.

These log files are used by administrator for effectively managing web server, getting feedback about performance of servers etc.

You can open and read log files in any text editor; for more user-friendly view you can use some stand-alone software or browser-based viewer which will give you more precise data in form of charts/graphs/tables.

The format of the common log file line has the following fields separated by a space:

Remotehost rfc931 authuser [date] “request” status bytes

151.99.190.27 - - [09/Jan/2007:13:06:51] “GET /~bacusHTTP/1.0″ 301 13276

For the above example:

remotrhost : 151.99.190.27
authuser : -
frc931 : -
[date] : [09/Jan/200713:06:51 -0600]
” request ” : ” GET /~bacuslab HTTP/1.0″
status: 301
bytes : 13276

Understanding log fields :

remotehost : Remote hostname or IP address number if DNS hostname is not available.

rfc931 : The remote login name of the user. (If not available a minus sign is typically placed in the field)

authuser :The username as which the user has authenticated himself. (If not available a minus sign is typically placed in the field)

[date] : Date and time of the request.

“request” : The request line exactly as it came from the client. (i.e., the file name, and the method used to retrieve it [typically GET])

status : The HTTP response code returned to the client. Indicates whether or not the file was successfully retrieved, and if not, what error message was returned.

bytes : The number of bytes transferred.

Sometimes we get some errors while using outlook express but we can’t understand what they mean and what could be the solution for that.

Here’s the usual errors codes with their solutions:

0×800CCC00 - Authentication did not load.
Solution :
*) Try closing and restarting Outlook express
*) If still getting same error, wait 20-30 minutes for a server reset of your account then try again.
*) It could be a corruption of the user account in Outlook Express. Try setting up a second identity and see if it works.

0×800CCC01 - INVALID CERTIFICATE CONTENT
0×800CCC02 INVALID CERTIFICATE DATE
Solution :
*) Get your certificate re-issued by your authority server.

0×800CCC03 - USER ALREADY CONNECTED
Solution :
*) Close all connections on all machines, wait 20-30 minutes and try again.
*) If you are not logged in on another machine or poplocked then someone may be using/downloading from your account or something is wrong with your account.
*) Sometimes due to improper disconnection your account gets ‘Poplocked’ so to get out of it either wait 20-30 minutes for it to time out or get somebody to shell into the mail server and stop the mail task that is running on the account.

0×800CCC05 NOT CONNECTED TO SERVER
0×800CCC0D CANT FIND HOST - Cannot locate server
Solution :
*) You may have typed wrong mail server in your account settings or the server may be down.
*) Reboot the computer and try again.
*) Data may not be moving across the network properly. Check DNS numbers, remove and then reinstall TCP/IP in Control Panel > Network.

0×800CCC0A MESSAGE DOWNLOAD INCOMPLETE
0×800CCC19 TIMEOUT
Solution :
*) This error may be due to corruption of pop3uidl file. Close the Internet connection and all programs. Search for the file ‘pop3uidl and delete it. Reconnect and it should work.

0×800CCC0F CONNECTION DROPPED
Solution :
*) may be modem or network cable was disconnected. If this happens frequently then try updating the modem drivers or adding an Init string.

0×800CCC10 INVALID ADDRESS - Address not known on server
Solution :
*) Check the spelling in the TO: field of the e-mail. Delete the old message from the Outbox and then try it again.

0×800CCC12 SOCKET READ ERROR - Unable to send Winsock request
Solution :
*) Remove the TCP/IP protocol and reinstall it. In windows, go into Network from the Control Panel. NOTE: You may need your Windows CD for this task!

0×800CCC16 INVALID ACCOUNT - User account not recognized
Solution :
*) Check the spelling of the account name and re-enter the password taking care to spell it correctly.

0×800CCC18 SICILY LOGON FAILED - Logon attempt failed
Solution :
*) Check account information, making sure account is not case sensitive, close Outlook Express, restart the computer and try reconnecting.
*) Create a different identity and see if it will logon on from this identity with the same information.
*) Make sure the account is still active with the ISP.

0×800CCC1A SECURE CONNECT FAILED - Unable to connect using SSL
Solution :
*) Your ISP may not require an SSL connection. Turn off SSL in the e-mail account properties and try again.

The event logs contain the most important information for diagnosing application and operating system failures, determining the health and status of a system and verifying that system and applications are operating properly.

Windows systems store all logs in binary .Evt files and there are three basic event logs: Application (AppEvent.Evt), System (SysEvent.Evt), and Security (SecEvent.Evt). Windows 2000 (and later) servers may contain additional event logs: DNS Server (DNSEvent.Evt), File Replication Service (NtFrs.Evt), and on Active Directory domain controllers, Directory Service (NTDS.Evt).

System log tracks miscellaneous system events like startup, shutdown and events like hardware and controller failures. The Application log is an important source for application status information. When properly integrated with the Windows operating system, applications can report their errors to the Event log by recording an event entry into the Application log. Security log tracks events such as logon, logoff, changes to access rights, and system startup and shutdown.

Windows event logs can be useful for ;

-Securing your network from internal attacks

-Monitoring availability of your critical applications

-Centralized eventlog management integrated with your network monitoring software

While on a network you sometime need to communicate with your colleague, you can do so with the help of an Talk commond. You can use a talk command for chatting with other concurrent user currently logged on your machine. This command can be considered as an visual communication program which copies lines from your terminal to that of another user and vice-versa.

Syntax :
talk person [ttyname ]

Parameter person  :
If you wish to talk to someone on your own machine, then person (parameter)  is just the person’s login name. If you wish to talk to a user on another host, then person (parameter) is of the form ‘user@host’.

Parameter ttyname :
When want to talk to a user who is logged in more than once, use ttyname to indicate the appropriate terminal name.It may be used to indicate the appropriate terminal name, where ttyname is of the form ‘ttyXX’ or ‘pts/X’.

Once communication has been established, the two parties may type simultaneously, with their output appearing in separate windows. Use Ctrl+L to redraw the screen and to exit just type your interrupt char;

If you are busy and you don’t want anybody to disrupts you by such talk request, your may use the command “mesg n” to refuse accepting messages.

You have to explicitly invoke this blocking command, as by default this talk command is not blocked.

You can also use write command for the same purpose :
Syntax :
write person [ttyname ] :  All parameters are same as that of talk command.

The protocol Stack:
In TCP/IP’s most basic level, a computer network is simply a series of connections between computers which allow them to communicate. The scope, size, speed, content and reliability of the network depending on its protocols suite and implementation. Protocols are pre-established means of communication. The term TCP/IP (Transmission Control Protocol/Internet Protocol) actually refers to a whole family of protocols, of which TCP and IP are just two. Following figure contains the standard “stack’’ diagram of TCP/IP. Rather than make protocols monolithic (which would mean ftp, telnet, and gopher would each have a full network protocol implementation, including separate copies of kernel code for the devices each protocol uses), the designers of TCP/IP broke the job of a full network protocol suite into a number of tasks. Each layer corresponds to a different facet of communication. Conceptually, it is useful to envision TCP/IP as a stack. In implementations, programmers often blur the layers for increased performance.

figure

Following are the TCP/IP Application protocols:
1.DHCP:

DHCP Dynamic Host Configuration Protocol is defined by RFC’s 2131
and 2132.DHCP is Dynamic Host Configuration
Protocol (DHCP) allows IP addresses to
be allocated to hosts on an as-needed basis.DHCP lets a host
‘borrow’ an IP address from a pool of IP addresses; when the
address is no longer required it is recycled and made available for
use by other host. DHCP also allows a host to retrieve a
verity of configuration information.

DCHP depends on UDP to carry packets between the client and server
tasks.

2. DNS

The DNS (Domain Name System) provides ondemand dynamic
translation between human-readable names (like www.mydoamin.com)
and the numeric addresses actually used by IP (like
192.169.10.28). The basics of DNS operation are defined in RFC’s
1034, 1101, 1876, 1982 and 2065.

A very widely-used implementation of DNS called BIND
(Berkeley Internet Name Domain)
DNS uses both UDP and TCP. It used UDP to carry simple queries and
responses but depends on TCP to guarantee the correct and orderly
delivery of large amounts of bulk data (eg zone configurations) across the network.

3. FTP

File Transfer Protocol (FTP) provides a mechanism for transfering data
files between various systems. In addition to the fundamental PUT and GET
operations, FTP provides a small number of file management and
user authentication facilities. FTP uses port 21

FTP depends on TCP to guarantee the correct and orderly delivery
of data across the network.

4. HTTP

Hyper Text Transfer Protocol (HTTP) is the protocol used to publish
Web pages across an internet. HTTP depends on TCP to guarantee the
correct and orderly delivery of data across the network.

5. IMAP

Interactive Mail Access Protocol (IMAP) allows clients to
manipulate email messages and mailboxes that reside on some server
machine. The current version of IMAP is Version 4, IMAP is more powerful
and more complex than the other widely-used mail-reading protocol
POP.

6. NFS

Network File System (NFS) allows files stored on one machine (the
“server”) to be accessed by other machines (the “clients”) as
though the files were actually present on the client systems. NFS
is defined in terms of a Remote Procedure Call (RPC) abstraction
which in turn formats its packets according to a
processor-independent eXternal Data Representation (XDR).

NFS is most often used over UDP. UDP does not guarantee packet delivery or ordering, so
when NFS runs over UDP the RPC implementation must provide its own
guarantees of correctness.

7. NNTP

Network News Transfer Protocol (NNTP) is used to propagate netnews
postings (including Usenet postings) between systems.

8. NTP

Network Time Protocol (NTP) is used to synchronise time-of-day
clocks between various computer systems. The current version of
NTP is Version 3, defined in RFC 1305.

9. POP

Post Office Protocol (POP) allows clients to read and remove email
from a mailbox that resides on some server machine. The current
version of POP is Version 3, usually referred to as POP3. POP uses port 110

10. Rlogin

Remote Login (rlogin) provides a network terminal or “remote
login” capability. Rlogin is similar to Telnet but it adds a
couple of features that make it a little more convenient than
Telnet.

11. Rsh

Remote Shell (rsh) is an r-command that provides for remote
execution of arbitrary commands. It allows you to run a command on
a server without having to actually log in on the server. More
importantly it allows you to feed data to the remote command and
retrieve the command’s output without having to stage the data
through temporary files on the server.

12. SMTP

Simple Mail Transfer Protocol (SMTP) is used to deliver email from
one system to another. The port used by SMTP is 25.
13. SNMP

Simple Network Management Protocol (SNMP) provides a means of
monitoring and managing systems over a network. SNMP defines a
method of sending queries (the GET and GET-NEXT primitives) and
commands (the SET primitive) from a management station client to
an agent server running on the target system, and collecting
responses and unsolicited event notifications.

14. Ssh

Secure Shell (ssh) provides remote login and execution features
similar to those of the rsh and rlogin r-commands, but ssh
encrypts the data that is exchanged over the network. Encryption
can protect sensitive information, and it is not uncommon for
security-conscious administrators to disable plain rsh and telnet
services in favour of ssh.

The SSH protocol used by the ssh command has also been used to
build a secure file transfer application which can be used as an
alternative to FTP for sensitive data.

15. Telnet

Telnet provides a network terminal or “remote login” capability.
The Telnet server accepts data from the telnet client and forwards
them to the operating system in such a way that the received
characters are treated as though they had been typed at a terminal
keyboard. Responses generated by the server operating system are
passed back to the Telnet client for display.

16. X Window System

The X Window System allows client programs running on one machine to control the graphic
display, keyboard and mouse of some other machine or of a
dedicated X display terminal.

Next Page »