Saturday, December 10, 2016

Linux Interview Question - DNS

Q : What is DNS Server?
Domain Name System is used to resolve domain name to IP Address and also used to resolve IP Address to Domain Name. It has two zones forward and Reverse Lookup Zone. Forward Lookup Zone resolve Domain name to IP address. Reverse Lookup Zone is used to resolve IP address to Domain Name. Some records associate with DNS
•             A Record binds Name with IP Address
•             PTR Record binds IP Address to Name

Q : What is the Purpose of A and PTR Record?
•             A Record OR Host Record is used to bind a Name with IP Address.
•             PTR Record is used to bind an IP Address with Name.

Q : Explain SOA Record.
Start Of Authority (SOA) Records indicate that Name Server is authoritative server for the domain.

Q : Explain different zone involved in DNS Server?
DNS has two different Zones Forward Lookup Zone and Reverse Lookup Zone. There two Zones are categorized into three zones and are as follows

Primary zone: It contains the read and writable copy of the DNS Database.

Secondary Zone: It acts as a backup for the primary zone and contains the read only copy of the DNS database.

Stub zone: It is also read-only like a secondary zone; stub zone contains only SOA, copies of NS and A records for all name servers authoritative for the zone.

Q. Explain Briefly about Stub Zone?
It is also read-only like a secondary zone, so administrators can't manually add, remove, or modify resource records on it. But secondary zones contain copies of all the resource records in the corresponding zone on the master name server; stub zones contain only three kinds of resource records:
•             A copy of the SOA record for the zone.
•             Copies of NS records for all name servers authoritative for the zone.
•             Copies of A records for all name servers authoritative for the zone.

Q . Explain some types of DNS records?
A Record: Binds an Name with an IP Address
PTR Record: Binds an IP Address with an Host Name
NS Record: Is name of an DNS Server
MX Record: Responsible for Mail receiving mail from different MTA

Q. which are the important configuration files for DNS server?
BIND uses /etc/named.conf as its main configuration file, the /etc/rndc.conf file as the
configuration file for name server control utility rndc, and the /var/named/ directory for zone files and the like.

Q. What is BIND?
BIND stands for Berkeley Internet Name Domain which is the most commonly used Domain Name System (DNS) server on the Internet.

Q. On which version of bind u have worked?
BIND 9

Q. What is the role of DNS?
A DNS server, or name server, is used to resolve an IP address to a hostname or vice versa.

Q. On which port DNS server works?
DNS servers use port 53 by default. Incoming and outgoing packets should be allowed on
port 53. Also allow connections on port 921 if you configure a lightweight resolver server.
The DNS control utility, rndc, connects to the DNS server with TCP port 953 by default. If
you are running rndc on the name server, connections on this TCP port from localhost
should be allowed. If you are running rndc on additional systems, allow connections to
port 953 (or whatever port you have chosen to configure) from these additional systems.

Q. What is round robin DNS?
Round robin DNS is usually used for balancing the load of geographically distributed Web servers. For example, a company has one domain name and three identical home pages residing on three servers with three different IP addresses. When one user accesses the home page it will be sent to the first IP address. The second user who accesses the home page will be sent to the next IP address, and the third user will be sent to the third IP address. In each case, once the IP address is given out, it goes to the end of the list. The fourth user, therefore, will be sent to the first IP address, and so forth.

Q. What is Name Server?
A name server keeps information for the translation of domain names to IP addresses   and IP addresses to domain names. The name server is a program that performs the translation at the request of a resolver or another name server.

Q.  What is Primary name server or primary master server?
Primary name server/primary master is the main data source for the zone. It is the authoritative server for the zone. This server acquires data about its zone from databases saved on a local disk. The primary server must be published as an authoritative name server for the domain in the SOA resource record, while the primary master server does not need to be published.

Q. What is Secondary name server/slave name server?
Secondary name server/slave name server acquires data about the zone by copying the data from the primary name server (respectively from the master server) at regular time intervals. It makes no sense to edit these databases on the secondary name servers, although they are saved on the local server disk because they will be rewritten during further copying.

Q.  what is Root name server?
Root name server is an authoritative name server for the root domain (for the dot). Each root name server is a primary server, which differentiates it from other name servers.

Q. what is Stealth name server?
Stealth name server is a secret server. This type of name server is not published anywhere. It is only known to the servers that have its IP address statically listed in their configuration. It is an authoritative server. It acquires the data for the zone with the help of a zone transfer. It can be the main server for the zone. Stealth servers can be used as a local backup if the local servers are unavailable.

Q. What do you mean by "Resource Records"?
nformation on domain names and their IP addresses, as well as all the other information distributed via DNS is stored in the memory of name servers as Resource Records (RR).




Q. Explain "TTL"?
Time to live. A 32-bit number indicating the time the particular RR can be kept valid in a server cache. When this time expires, the record has to be considered invalid. The value 0 keeps nonauthoritative servers from saving the RR to their cache memory.

Q. Tell me 5 Types of DNS records?
A, NS, CNAME, SOA, PTR, MX.

Q. explain "SOA Record"?
The Start of Authority (SOA) record determines the name server that is an authoritative source of information for the particular domain. There is always only one SOA record in the file, and it is placed at the beginning of the file of authoritative resource records.

Q. what is "A Record"
A (Address) records assign IP addresses to domain names of computers. The IP address cannot have a dot at the end.

Q. Explain "CNAME Record"?
Synonyms to domain names can be created using CNAME records. This is often referred to as 'creating aliases for computer names'.

Q. What are "HINFO and TXT Records"?
HINFO and TXT records are for information only. An HINFO record has two items in its data part. The first item is information about hardware, and the second one is information about software. A TXT record contains a general data string in its data part.
Example :
test.com IN SOA ...
...
mail IN A 192.1.1.2
IN HINFO My_Server UNIX
IN TXT my server
...

Q. what are "MX Records"?
MX records specify the mailing server of the domain. An MX record shows to which computer a mail of a particular domain should be sent. The MX record also includes a priority number, which can be used to determine several computers where the mail for the domain can be sent. The first attempt is to deliver the mail to the computer with the highest priority (lowest value). If this attempt fails, the mail goes to the next computer (with a higher priority value), and so on.

test.com IN SOA ...
...
mail               IN        A         192.1.1.2
                       IN       HINFO    AlphaServer UNIX
                       IN        TXT       my  server
                       IN         MX   30    mail2.nextstep4it.com
                       IN         MX   20    mail3.nextstep4it.com
                       IN         MX   10    mail2.nextstep4it.com
20} Explain "PTR Records"?

A Pointer Record (PTR) is used to translate an IP address into a domain name.


Q. What is Dynamic DNS?
Dynamic DNS a method of keeping a domain name linked to a changing IP address as not all computers use static IP addresses. Typically, when a user connects to the Internet, the user's ISP assigns an unused IP address from a pool of IP addresses, and this address is used only for the duration of that specific connection. This method of dynamically assigning addresses extends the usable pool of available IP addresses. A dynamic DNS service provider uses a special program that runs on the user's computer, contacting the DNS service each time the IP address provided by the ISP changes and subsequently updating the DNS database to reflect the change in IP address.

Q. What is the role of "named-checkconf Utility"?
The named-checkconf utility checks the syntax of the named.conf configuration file.
Syntax: named-checkconf    [-t directory] [filename]

Q. what is the role of "named-checkzone Utility"?
The named-checkzone utility checks the syntax and consistency of the zone file.

Syntax:     named-checkzone [-dgv]   [-c class] zone   [filename]

Linux Interview Question - Basic Linux 1

Q : What is the difference between service and process?

A process is any piece of software that is running on a computer. For example, your anti-virus software runs in the background as a process, which was automatically started when the computer booted. Some processes start when your computer boots, others are started manually when needed.

Some processes are services that publish methods to access them, so other programs can call them as needed. Printing services would be an example of a service type of process, where your email program can just call the print services process to say it wants to print, and the service does the actual work.

Q : How to view crond status? If it’s show service is not found.
Service crond restart
Q. How to FTP user access other directory except his own home directory?
vim /etc/vsftpd/vsftpd.conf
Chroot_list_enable=yes
Q. What are the Linux-based security tools?
Selinux
Firewall
iptables
Tcp-wrappers

Q. What are the basic elements of firewall?
A firewall should be able to filter packets (drop/pass them) based on certain rules specified by the user. The rules may be used to identify an incoming packet to the computer or outgoing packet from the computer, it can be based on target port number/ip add , traffic from a particular Network card etc…
The firewall rules can be in a tabular form (saved on the disk) from where the firewall software can read them and implement it. iptables firewall on Linux is a great example
Q. What is a command to display top 10 users who are using huge space?
du -sh /home/* | sort -r | head -10

Q. How do find all failed login attempts via ssh?
tail -f /var/log/secure | grep Failed

Q. How do you configure Linux system as a router?
vim /etc/sysctl.conf
net.ipv4.ip_forward=1
system-config-network
eth0 192.168.1.120 eth0:1 172.24.0.1
255.255.255.0 255.255.0.0
172.24.0.1 192.168.1.120

Q. What is the UID and GID of root user? Can a normal user can change the ownership of a file? What is the command to change ownership of a file?      
The root UID/GID is 0 (zero). Which is why he can able to intervene in all normal users files even though he don’t had permission. A normal user will don’t have the permission to change ownership of file. The command to change ownership is < chown user.user file >
  
Q. What is the diff b/w ext2 and ext3?
Ext3 is a tiny bit slower than ext2 is, but it holds tremendous advantages. There is really only one difference between ext2 and ext3, and that is that ext3 uses a journal to prevent filesystem corruption in the case of an unclean shutdown (ie. before the filesystem is synced to disk). That makes ext3 a bit slower than ext2 since all metadata changes are written to the journal, and then flushed to disk, but on the other hand you don’t risk having the entire filesystem destroyed at power failure or if an unwitted person turns the computer off uncleanly. You don’t have to check the filesystem after an unclean shutdown either. Ext3 has three levels of journalling. Metadata (ie. internal filesystem structures) are always journalled, so that the filesystem itself is never corrupted. How ordinary data is written to the file system is controllable, though. The default option is the “ordered” mode, which causes file contents to be written to the filesystem before metadata is even committed to the journal. The highest reliable mode is called the “journal” mode, which causes file data to be committed to the journal before it is flushed to its final place, like the metadata. The least reliable mode, but rumoured to be the fastest, is called the “writeback” mode, which makes no promises at all regarding the consistency of file data. Only metadata is output reliably in writeback mode. So as for anything else, it’s mainly a matter of priority. If you don’t want ultimate speed, go with ext3. If you need the highest speed that is theoratically aquirable though, then go with ext2. For that to be effective you’ll probably need a really advanced hard drive controller, though.
Q. As the system administrator you need to review Bob’s cronjobs. What command would you use?
crontab –lu Bob

Q. What command is used to remove the password assigned to a group?
gpasswd –r groupname

Q. What are the different RAID levels?
 RAID level 0
 RAID level 1
 RAID level 2
 RAID level 3
 RAID level 4
 RAID level 5
 RAID level 6
 RAID level 10
 RAID level 50

Q. How do you create a swapfile?
dd if=/dev/zero of=/swapfile bs=1024 count=200M
mkswap /swapfile
swapon /swapfile


Q. What does nslookup do?
Nslookup is a program used to find information about internet Domain Name server.
The two modes of nslookup are: Interactive and non-interactive.
Using ‘interactive mode’ user can query the name servers for the information pertaining to hosts and domains.
Using ‘non-interactive mode’ the user can just print the name and requested information of a host.

Q. What is the difference between UDP and TCP?
TCP is a Transmission Control Protocol.
UDP is a User Datagram Protocol.
There are four major differences between UDP and TCP:

1. TCP can establish a Connection and UDP cannot.
2. TCP provides a stream of unlimited length, UDP sends Small packets.
3.TCP gurantees that as long as you have a connection data sent will arrive at the destination, UDP provides not guarantee delivery.
4.UDP is faster for sending small amounts of data since no connection setup is required, the data can be sent in less time then it takes for TCP to establish a connection.

Q. What command do you run to check file system consistency?
Need to run fsck [file system consistency check] command to check file system consistency and repair a Linux / UNIX file system.
Fsck

Q. What is the command to remove Lvm ,Pv and vg
1st remove the entry on /etc/fstab file & save – quit.
2nd remove LVM – lvremove lvname
3rd remove VG – vgremove vgname
4th remove PV – pvremove pvname

Q. How to create SAMBA server in fedora 9 Linux?
yum install samba -y
yum install samba-swat –y
vi /etc/samba/smb.conf

comment = windows sharing
path = path/your/share/directory
valid users = surendra
writable = yes
browseable = yes

then type testparm for code testing.

smbpasswd -a username
smbpasswd -e username

service smb restart
chkconfig smb on

Q. How to schedule cron backup to run on 4th Saturday of month?
* * * * 6 weekdaynum 4 && sh /backup/test.sh

Q. What is an inode?
ext2 and ext3 file systems keep a list of the files they contain in a table called an inode table. The inode is referenced by its number. This is unique within a file system.

The inode contains the metadata about files. Among the data stored in the inode is

File type
File permissions
Link count

User ID number of the file owner and the group ID number of the associated group

Last modification time
Location of the data on the hard disk
Other metadata about the file
ls -li – view inode number only
stat /etc/passwd – view inode details

Q. How to see unallocated hard disk space on linux
df -h

Q. How do u find remote machine operating system and version?
nmap -A –v 192.168.1.100

Q. How do you port scanning with netstat command?
netstat –an

Q. Linux system monitoring Tools?

top – Process Activity Command
vmstat – System Activity, Hardware and System Information
w – Find out Who Is Logged on And What They Are Doing
Uptime – Tell How Long the System Has Been Running
ps – Displays the Processes
free – Memory Usage
iostat – Average CPU Load, Disk Activity
sar – Collect and Report System Activity
mpstat – Multiprocessor Usage
pmap – Process Memory Usage

Q. Linux Network monitoring Tools?

netstat and ss – Network Statistics
iptraf – Real-time Network Statistics
tcpdump – Detailed Network Traffic Analysis
strace – System Calls

/Proc file system – Various Kernel Statistics
# cat /proc/cpuinfo
# cat /proc/meminfo
# cat /proc/zoneinfo
# cat /proc/mounts

Nagios – Server And Network Monitoring
Cacti – Web-based Monitoring Tool
Gnome System Monitor – Real-time Systems Reporting and Graphing

Q. What is mean by system calls?
A system call is the mechanism used by an application program to request service from the operating system.
On Unix-based and POSIX-based systems, popular system calls are open, read, write, close, wait, exec, fork, exit, and kill. Many of today’s operating systems have hundreds of system calls. For example, Linux has 319 different system calls. FreeBSD has about the same (almost 330). Tools such as strace and truss report the system calls made by a running process.

Q. How do u extract files from iso cd images in linux?
mount –o loop disk1.iso /mnt/iso

Q. What is Clustering?
Clustering means it is a group of two or more server running same application and fault tolerance it is called Clustering.


Linux Interview Question - Apache

 Q- How to check the version of Apache server ?
Ans :- rpm -qa |grep httpd

Q: – What is DocumentRoot ?
it is a location of files which are accessible by clients. By default, the Apache HTTP server  is configured to serve files from the /var/www/html/ directory.

Q: – On which port Apache server works ?
http – port 80
https – port 443
The port 80 is a regular port while port 443 is a secure port.

Q: – Tell me name of main configuration file of Apache server ?
httpd.conf

Q: – On which version of apache you have worked ?
httpd-2.2.3
httpd-2.4.16 ---- latest version 

Q: – What do you mean by a valid ServerName directive?
The DNS system is used to associate IP addresses with domain names. The value of ServerName is returned when the server generates a URL. If you are using a certain domain name, you must make sure that it is included in your DNS system and will be available to clients visiting your site.

Q: – What is the main difference between <Location> and <Directory> sections?
Directory sections refer to file system objects; Location sections refer to elements in the address bar of the Web page

Q: – What is the difference between a restart and a graceful restart of a web server?
During a normal restart, the server is stopped and then started, causing some requests to be lost. A graceful restart allows Apache children to continue to serve their current requests until they can be replaced with children running the new configuration.

Q: – What is the use of mod_perl module?
mod_perl scripting module to allow better Perl script performance and easy integration with the Web server.

Q: – If you have added “loglevel Debug” in httpd.conf file, than what will happen?
It will give you more information in the error log in order to debug a problem.

Q: – Can you record the MAC (hardware) address of clients that access your server.
No

Q: – If you have only one IP address, but you want to host two web sites on your server. What will you do?
In this case I will use Name Based Virtual hosting.
ServerName 10.111.203.25
NameVirtualHost *:80
<VirtualHost *:80>
ServerName web1.test.com
DocumentRoot /var/www/html/web1
</VirtualHost>
<VirtualHost *:80>
ServerName web2.test2.com
DocumentRoot /var/www/html/web2
</VirtualHost>

Q: – Can I serve content out of a directory other than the DocumentRoot directory?
Yes, by using “Alias” we can do this.

Q: – If you have to more than one URL map to the same directory but you don't have multiple Alias directives. What you will do?
In this case I will use “AliasMatch” directives.
The AliasMatch directive allows you to use regular expressions to match arbitrary patterns in URLs and map anything matching the pattern to the desired URL.

Q: – Can you record all the cookies sent to your server by clients in Web Server logs?
Yes, add following lines in httpd.conf file.
CustomLog logs/cookies_in.log "%{UNIQUE_ID}e %{Cookie}i" CustomLog logs/cookies2_in.log "%{UNIQUE_ID}e %{Cookie2}i"

Q: – Can we do automatically roll over the Apache logs at specific times without having to shut down and restart the server?
Yes,  Use CustomLog and the rotatelogs programs
Add following line in httpd.conf file.
CustomLog "| /path/to/rotatelogs/path/to/logs/access_log.%Y-%m-%d 86400" combined

Q: – What we can do to find out how people are reaching your site?
Add the following effector to your activity log format. %{Referer}

Q: – How you will put a limit on uploads on your web server?
This can be achieved by LimitRequestBody directive.
<Directory "/var/www/html/data_uploads">
LimitRequestBody 100000
</Directory>
Here I have put limit of 100000 Bytes

Q: – I want to stop people using my site by Proxy server. Is it possible?
<Directory proxy:http://www.test.com/myfiles>
Order Allow,Deny
Deny from all
Satisfy All
</Directory>

Q: – What is mod_evasive module?
mod_evasive is a third-party module that performs one simple task, and performs it very well. It detects when your site is receiving a Denial of Service (DoS) attack, and it prevents that attack from doing as much damage. mod_evasive detects when a single client is making multiple requests in a short period of time, and denies further requests from that client. The period for which the ban is in place can be very short, because it just gets renewed the next time a request is detected from that same host.

Q: – If Some One want Apache server should handle multiple requests over a single TCP connection. Which of the following would allow to do this?
Ans: KeepAlive

Q: -Which of the following HTTP headers will direct a browser towww.nextstep4it.com after waiting five seconds?
Ans: Refresh 5; URL = http://www.nextstep4it.com/

Q: -Cookies can be used by Apache to create a click stream log of user activity. However, for the cookies to work, Apache must be compiled with the _______ module, then the ______ directive must be
Ans:  mod_usertrack; Cookie Tracking on

Q: – Which of the following are TRUE regarding contains in httpd.conf? (Choose two.)
Ans:  . Containers consist of a Paired set of delimiters.
          . Containers allow individual virtual hosts to have their own settings.

Q: -Which of the following best explains why Apache Web servers are able to handles multiple requests?
Ans : B. Apache is able to spawn child processes that handle requests before they die.

Q: – Consider the file "test.html". Which of the following best describes what code does?
Ans: . When the user clicks on "set cookie," thefirst_name cookie is set to "Fred." The first_name cookie can be displayed by clicking the "display cookie" button.

Q: Briefly explain Apache Web Server.
Apache Web Server is one of the most secure, powerful and popular open source HTTP Servers. It can be used to host anything from personal web sites to corporate domains.

Q: You see "connection reset by peer" in error log. What could be the reason for this?
If the end user terminates the connection when the server response was being formed or was being transferred, we see "connection reset by peer" in the error log.

Q: What type of IP is required for Apache Web Server to host our website?
If we have a DSL connection with a static IP then we can use the Apache web server to host our website.

Q: While installing Apache HTTP server, do we need SSL and PHP support?
Yes, SSL and PHP support is required to install Apache HTTP server.

Q: What is virtual hosting?
Virtual hosting is a method for hosting multiple domain names on a server using a single IP address. Virtual hosting allows one server to share its resources, such as memory and processor cycles, in order to use its resources more efficiently.

Q: Is there any size limit for URL rewriting and aliasing in Apache web server?
Apache has no fixed limit on the numbers of Aliases and Redirects which may be declared in the config files.

Q Create a new user file and add a user with username "test" and password "test".
htpasswd -c /usr/local/etc/httpd/users test
User will be prompted to provide the password. The -c argument tells htpasswd to create new file for users. To add more users, -c argument can be omitted.

Q: You need to install Apache web server on Ubuntu server. How can you download and install the Apache2 package?
sudo apt-get install Apache2
OR
sudo aptitude install Apache2
aptitude is known to sort out program dependencies in a better way.

Q: What is the query to install update package of Apache server?
sudo aptitude update
sudo aptitude install Apache2

Q: Towards the end of the install, you may get a warning message during starting of the Apache process because domain name is not configured yet. What could that be?
Apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

Q: – What is location of log files for Apache server ?
Ans- /var/log/httpd

Q: – What are the types of virtual hosts ?
a. name-based
b. IP-based.
Name-based virtual host means that multiple names are running on each IP address.
IP-based virtual host means that a different IP address exists for each website served. Most configurations are named-based because it only requires one IP address.

Q: – Command to restart/start Apache web server ?
Ans- service httpd restart/start

Q: – Comamnd to check the conf file  of Apache server ?
httpd   -S
rpm –qc |grep httpd

Q: – What is meaning of “Listen” in httpd.conffile ?
Ans- Port number on which to listen for nonsecure (http) transfers.

Q: – How t to enable PHP scripts on your server?
Ans- If you have mod_php installed, use AddHandler to map .php and .phtml files to the PHP handler. AddHandler application/x-httpd-php .phtml .php

Q: – Which tool you have used for Apache benchmarking?
ab (Apache bench)
ab -n 1000 -c 10 http://www.test.com/test.html

Q: – Can we cache files which are viewed frequently?
Ans- Yes we can do it by using mod_file_cache module.
CacheFile /www/htdocs/index.html

Q : how optimize apache web site or URL
Ans : used memcache server  ???????

Q : How to add module in Apache server

Q : Explain Reverse proxy and why are used

Q : how to add PHP madule in apache

Q : Apache symtex check
httpd  -t

Q : we have 7 web server and my URL is not open, how to troubleshoot from client pc
Ans : add host entry in local pc, check hit URL and check logs
Ans : check server logs

Q : how to install gzip and groupzip  in apache

Q : which language used in apache code

Q : Apache and Nginix deference
  

Q : Specify the Port Number
LDAP - 389
DNS - 53
DHCP - 67,68
HTTP - 80
HTTPS - 443
SMTP - 25
POP3 - 110
FTP - 21,20
Telnet  23
Tomcat  8080, 8007-ajp12, 8009-ajp13,8005-shutdown
NFS  2049
Samba  167/169/445
Redies   6379
HAProxy  8080
SFTP   22
SSH  22
Squid  3128
SVN  3690
POP3 – 110
IMAP – 143
Mysql 3306 ( version 5.5)
  
Q : Apache's features to manipulate URL's

Often in the live of a webmaster it happens, that you want to map an old URL into a new one. The possibilities to manipulate an URL are:

o             Redirect the URL
o             Rewrite the URL
o             Proxy and ReverseProxy Server

Redirection

The Redirect directive maps an old URL into a new one. The new URL is returned to the client which attempts to fetch it again with the new address. One disadvantage is, that the manipulated URL will be displayed in the client browser. Suppose, you want to redirect each request to another Server on the Internet, you specify the following directive in http.conf


Each request to your server will be redirected to http://www.foobar.com.

Rewrite Module

The Apache Module mod_rewrite, is the Swiss Army Knife of URL manipulation, it is a really sophisticated module which provides a powerful way to do URL manipulations like:

o             Solve Trailing Slash Problem
o             Solve Moved DocumentRoot Problem
o             Solve Moved Homedirs to Different Webserver Problem
o             Solve FilesystemReorganisation Problem
o             Redirect Homedirs For Foreigners
o             Redirect Failing URLs To Other Webserver
o             From Old to New (intern)
o             From Old to New (extern)
o             Search pages in more than one directory
o             .... and many more ....

Example:

Map the non SSL URL http://www.foobar.com/abc to the SSL URL https://www.foobar.com/abc

<VirtualHost _default_:80>
  RewriteEngine on
  RewriteRule ^/abc/(.*)$ https://%{SERVER_NAME}/abc/$1 [R,L]
</VirtualHost>
  
Proxy Module

Apache Proxy allows remote servers to be mapped into the space of the local server; the local appears to be a mirror of the remote server. The following proxy directives. In the following example the website Arkum.ch is a proxy for Akadia.ch.
#
# Virtual Host for arkum.ch
#
  <VirtualHost 193.247.121.196>
  ServerAdmin martin dot zahn at akadia dot ch
  ServerName www.arkum.ch
  ProxyRequests On
  ProxyPass / http://www.akadia.ch/
  ProxyPassReverse / http://www.akadia.ch/
</VirtualHost>

ProxyPass

The directive ProxyPass allows remote servers to be mapped into the space of the local server; the local server does not act as a proxy in the conventional sense, but appears to be a mirror of the remote server.

Suppose the local server has address http://wibble.org/; then
  
ProxyPass /mirror/foo/ http://foo.com/

will cause a local request for the <http://wibble.org/mirror/foo/bar> to be internally converted into a proxy request to <http://foo.com/bar>.

ProxyPassReverse

The directive  ProxyPassReverse lets Apache adjust the URL in the Locationheader on HTTP redirect responses. For instance this is essential when Apache is used as a reverse proxy to avoid by-passing the reverse proxy because of HTTP redirects on the backend servers which stay behind the reverse proxy.

Suppose the local server has address http://wibble.org/; then

   ProxyPass /mirror/foo/ http://foo.com/
   ProxyPassReverse  /mirror/foo/ http://foo.com/

will not only cause a local request for the <http://wibble.org/mirror/foo/bar>to be internally converted into a proxy request to <http://foo.com/bar> (the functionality ProxyPass provides here). It also takes care of redirects the server foo.com sends: when http://foo.com/bar is redirected by him tohttp://foo.com/quux Apache adjusts this tohttp://wibble.org/mirror/foo/quux before forwarding the HTTP redirect response to the client.

Dataflow between HTTP-Client and HTTP-Server

Redirect and Rewrite

1.            The HTTP client sends a request to the HTTP Server.
2.            The HTTP Server sends the manipulated URL back to the Client.
3.            The HTTP client sends again a request using the changed URL. If the new URL points to a new HTTP Server, the request a new connection is setup to this server.
4.            The new server sends back the the answer.

One disadvantage using this approach together with another server is, that the manipulated URL is not hidden from the HTTP client, the changed URL is presented to the users.
  
 Proxy Server

1.            The HTTP client sends a request to the HTTP Proxy.
2.            The HTTP Proxy connects the HTTP Server.
3.            The HTTP Server sends back the answer to the HTTP Proxy.
4.            The HTTP Proxy sends back this answer to the HTTP client.

There are several advantages using proxies. The new server is completely hidden for the user. The URL always points to the HTTP Proxy, the connection to the real HTTP Server is hidden. The HTTP Proxy caches the documents locally, therefore we have  a performance gain.



Q : My clients are getting services from servers but how to know which client is using which service. is there any files to keep information about these? Clients used ftp, nis, samba, apache, squid, nfs and mail services how to know how many users got service from server side with date, time and client system ip?

Mail server – /var/log/mail/maillog [RedHat,centos]
ssh – /var/log/secure
Apache – /var/log/http/access.log
nfs – /var/lib/nfs/rmtab


Q. check log format and location
/var/log/httpd/
CustomLog "| /path/to/rotatelogs/path/to/logs/access_log.%Y-%m-%d 86400" combined
% -----hostname
Y ----- year
m ----- month
d -------- date
combined   --- log format templates
common ---log format templates
agent ---------log format templates

Q :- Apache error code, 500, 400, 403, 404, 303
404 error  ----- document root, path not found
400 -------
403 -------   forbiturn (permission, allow /deny )
500 ------madules issue (internal server error) miss configuration of modules, apache syntax error-pass error
300 -----  redirection issue                              
100  -----  request completed 
200  ----- client and server request service completed
  
Q. how to copy single word in linux
Used ye????   yye….
^ ----start
$-----end

Q. web site not opening, all contains ok

Clear browser history and check