web server _ apache and nginx

Upload: ashok-prajapati

Post on 04-Apr-2018

229 views

Category:

Documents


1 download

TRANSCRIPT

  • 7/29/2019 Web Server _ Apache and NginX

    1/8

    Ads by Google

    Apache Server Support

    Apache SSL Certificate

    Cheap Linux Hosting

    Linux How Tos...

    Linux InterviewQuetions

    My Profile

    0ShareShare More Next Blog Create Blog Sign

    http://www.blogger.com/http://www.blogger.com/http://www.blogger.com/home#createhttp://www.blogger.com/next-blog?navBar=true&blogID=783712521471379179http://manojsprofile.blogspot.com/http://linuxinterviewquetions.blogspot.com/http://linuxtroubleshoot.blogspot.in/http://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-2381651380176034&format=fp_al_lp&output=html&h=90&w=180&lmt=1343256319&host=pub-1556223355139109&h_ch=0001%2BS0017%2BL0001&flash=11.5.31&url=http%3A%2F%2Fapache-error.blogspot.in%2F&dt=1357670112848&bpp=9&shv=r20121206&jsv=r20121214&prev_fmts=180x90_0ads_al_s&correlator=1357670113158&pv_h_ch=0001%2BL0001&frm=20&adk=3031328095&ga_vid=1259823207.1357670113&ga_sid=1357670113&ga_hid=106703639&ga_fc=0&u_tz=330&u_his=2&u_java=1&u_h=800&u_w=1280&u_ah=760&u_aw=1280&u_cd=32&u_nplug=15&u_nmime=105&dff=arial&dfs=12&adx=207&ady=1105&biw=1263&bih=699&oid=3&ref=http%3A%2F%2Flinuxinterviewquetions.blogspot.in%2F&fu=0&ifi=5&dtd=771&xpc=sE6jdKkYmW&p=http%3A//apache-error.blogspot.in&f=arial&kw_type=radlink&rt=ChBQ7GbnAA3NaAripyE6AFLmEhNDaGVhcCBMaW51eCBIb3N0aW5nGgi9lswJSFuFdCgBMAJSEwiq7t2ps9m0AhWupOIKHZ55AK4&hl=en&kw0=Apache+Server+Support&kw1=Apache+SSL+Certificate&kw2=Cheap+Linux+Hosting&okw=Cheap+Linux+Hostinghttp://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-2381651380176034&format=fp_al_lp&output=html&h=90&w=180&lmt=1343256319&host=pub-1556223355139109&h_ch=0001%2BS0017%2BL0001&flash=11.5.31&url=http%3A%2F%2Fapache-error.blogspot.in%2F&dt=1357670112848&bpp=9&shv=r20121206&jsv=r20121214&prev_fmts=180x90_0ads_al_s&correlator=1357670113158&pv_h_ch=0001%2BL0001&frm=20&adk=3031328095&ga_vid=1259823207.1357670113&ga_sid=1357670113&ga_hid=106703639&ga_fc=0&u_tz=330&u_his=2&u_java=1&u_h=800&u_w=1280&u_ah=760&u_aw=1280&u_cd=32&u_nplug=15&u_nmime=105&dff=arial&dfs=12&adx=207&ady=1105&biw=1263&bih=699&oid=3&ref=http%3A%2F%2Flinuxinterviewquetions.blogspot.in%2F&fu=0&ifi=5&dtd=771&xpc=sE6jdKkYmW&p=http%3A//apache-error.blogspot.in&f=arial&kw_type=radlink&rt=ChBQ7GbnAA3NZAripyE6AFLmEhZBcGFjaGUgU1NMIENlcnRpZmljYXRlGgjazK0tcgFL3SgBMAJSEwiq7t2ps9m0AhWupOIKHZ55AK4&hl=en&kw0=Apache+Server+Support&kw1=Apache+SSL+Certificate&kw2=Cheap+Linux+Hosting&okw=Apache+SSL+Certificatehttp://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-2381651380176034&format=fp_al_lp&output=html&h=90&w=180&lmt=1343256319&host=pub-1556223355139109&h_ch=0001%2BS0017%2BL0001&flash=11.5.31&url=http%3A%2F%2Fapache-error.blogspot.in%2F&dt=1357670112848&bpp=9&shv=r20121206&jsv=r20121214&prev_fmts=180x90_0ads_al_s&correlator=1357670113158&pv_h_ch=0001%2BL0001&frm=20&adk=3031328095&ga_vid=1259823207.1357670113&ga_sid=1357670113&ga_hid=106703639&ga_fc=0&u_tz=330&u_his=2&u_java=1&u_h=800&u_w=1280&u_ah=760&u_aw=1280&u_cd=32&u_nplug=15&u_nmime=105&dff=arial&dfs=12&adx=207&ady=1105&biw=1263&bih=699&oid=3&ref=http%3A%2F%2Flinuxinterviewquetions.blogspot.in%2F&fu=0&ifi=5&dtd=771&xpc=sE6jdKkYmW&p=http%3A//apache-error.blogspot.in&f=arial&kw_type=radlink&rt=ChBQ7GbnAA3NUQripyE6AFLmEhVBcGFjaGUgU2VydmVyIFN1cHBvcnQaCCe18eq-9wNhKAEwAlITCKru3amz2bQCFa6k4godnnkArg&hl=en&kw0=Apache+Server+Support&kw1=Apache+SSL+Certificate&kw2=Cheap+Linux+Hosting&okw=Apache+Server+Supporthttps://www.google.com/adsense/support/bin/request.py?contact=abg_afc&url=http://apache-error.blogspot.in/&hl=en&client=ca-pub-2381651380176034&rad0=Apache+Server+Support&rad1=Apache+SSL+Certificate&rad2=Cheap+Linux+Hostinghttp://apache-error.blogspot.in/search?updated-min=2008-01-01T00:00:00-08:00&updated-max=2009-01-01T00:00:00-08:00&max-results=1http://void%280%29/http://apache-error.blogspot.in/search?updated-min=2011-01-01T00:00:00-08:00&updated-max=2012-01-01T00:00:00-08:00&max-results=6http://void%280%29/http://apache-error.blogspot.in/2012/02/how-to-install-nginx-webserver.htmlhttp://apache-error.blogspot.in/2012/02/reverse-proxy-with-nginx.htmlhttp://apache-error.blogspot.in/2012_02_01_archive.htmlhttp://void%280%29/http://apache-error.blogspot.in/search?updated-min=2012-01-01T00:00:00-08:00&updated-max=2013-01-01T00:00:00-08:00&max-results=2http://void%280%29/https://plus.google.com/113701026524170699917https://plus.google.com/113701026524170699917http://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-2381651380176034&format=fp_al_lp&output=html&h=90&w=160&lmt=1343256319&host=pub-1556223355139109&h_ch=0001%2BS0018%2BL0001&flash=11.5.31&url=http%3A%2F%2Fapache-error.blogspot.in%2F&dt=1357670112834&bpp=11&shv=r20121206&jsv=r20121214&prev_fmts=160x90_0ads_al_s&correlator=1357670113158&pv_h_ch=0001&frm=20&adk=2967624004&ga_vid=1259823207.1357670113&ga_sid=1357670113&ga_hid=106703639&ga_fc=0&u_tz=330&u_his=2&u_java=1&u_h=800&u_w=1280&u_ah=760&u_aw=1280&u_cd=32&u_nplug=15&u_nmime=105&dff=arial&dfs=12&adx=207&ady=630&biw=1263&bih=699&oid=3&ref=http%3A%2F%2Flinuxinterviewquetions.blogspot.in%2F&fu=0&ifi=4&dtd=716&xpc=EiI2bAZtgq&p=http%3A//apache-error.blogspot.in&f=arial&kw_type=radlink&rt=ChBQ7GbnAA2__wriomEyAAWJEg5MaW51eCBEb3dubG9hZBoIDKe-r03wEhQoAVITCJvy16mz2bQCFSuo4godJC8AYA&hl=en&kw0=Apache&kw1=Apache+Web+Server&kw2=Linux+Download&okw=Linux+Downloadhttp://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-2381651380176034&format=fp_al_lp&output=html&h=90&w=160&lmt=1343256319&host=pub-1556223355139109&h_ch=0001%2BS0018%2BL0001&flash=11.5.31&url=http%3A%2F%2Fapache-error.blogspot.in%2F&dt=1357670112834&bpp=11&shv=r20121206&jsv=r20121214&prev_fmts=160x90_0ads_al_s&correlator=1357670113158&pv_h_ch=0001&frm=20&adk=2967624004&ga_vid=1259823207.1357670113&ga_sid=1357670113&ga_hid=106703639&ga_fc=0&u_tz=330&u_his=2&u_java=1&u_h=800&u_w=1280&u_ah=760&u_aw=1280&u_cd=32&u_nplug=15&u_nmime=105&dff=arial&dfs=12&adx=207&ady=630&biw=1263&bih=699&oid=3&ref=http%3A%2F%2Flinuxinterviewquetions.blogspot.in%2F&fu=0&ifi=4&dtd=716&xpc=EiI2bAZtgq&p=http%3A//apache-error.blogspot.in&f=arial&kw_type=radlink&rt=ChBQ7GbnAA2__QriomEyAAWJEhFBcGFjaGUgV2ViIFNlcnZlchoIllOdrv-UWsYoAVITCJvy16mz2bQCFSuo4godJC8AYA&hl=en&kw0=Apache&kw1=Apache+Web+Server&kw2=Linux+Download&okw=Apache+Web+Serverhttp://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-2381651380176034&format=fp_al_lp&output=html&h=90&w=160&lmt=1343256319&host=pub-1556223355139109&h_ch=0001%2BS0018%2BL0001&flash=11.5.31&url=http%3A%2F%2Fapache-error.blogspot.in%2F&dt=1357670112834&bpp=11&shv=r20121206&jsv=r20121214&prev_fmts=160x90_0ads_al_s&correlator=1357670113158&pv_h_ch=0001&frm=20&adk=2967624004&ga_vid=1259823207.1357670113&ga_sid=1357670113&ga_hid=106703639&ga_fc=0&u_tz=330&u_his=2&u_java=1&u_h=800&u_w=1280&u_ah=760&u_aw=1280&u_cd=32&u_nplug=15&u_nmime=105&dff=arial&dfs=12&adx=207&ady=630&biw=1263&bih=699&oid=3&ref=http%3A%2F%2Flinuxinterviewquetions.blogspot.in%2F&fu=0&ifi=4&dtd=716&xpc=EiI2bAZtgq&p=http%3A//apache-error.blogspot.in&f=arial&kw_type=radlink&rt=ChBQ7GbnAA2_9AriomEyAAWJEgZBcGFjaGUaCLwBsjZxwpY0KAFSEwib8teps9m0AhUrqOIKHSQvAGA&hl=en&kw0=Apache&kw1=Apache+Web+Server&kw2=Linux+Download&okw=Apachehttps://www.google.com/adsense/support/bin/request.py?contact=abg_afc&url=http://apache-error.blogspot.in/&hl=en&client=ca-pub-2381651380176034&rad0=Apache&rad1=Apache+Web+Server&rad2=Linux+Downloadhttp://apache-error.blogspot.in/2012/02/how-to-install-nginx-webserver.htmlhttp://apache-error.blogspot.in/2012/02/reverse-proxy-with-nginx.htmlhttp://www.googleadservices.com/pagead/aclk?sa=L&ai=CFDQr52bsUIynJsGCiAfHnIGQCsnT-eMCoevJ_EO_6d7UQBABIOD33RVQ0vGntAJg5Zrpg-AOoAG3sYneA8gBAqkCTOaOOA6DUz6oAwHIA90EqgSFAU_Q9cwmVesh0mk5iTBU3wwzvcPWuNZGVvtHtSaluweD-qjHMq1cGyu2tj6sCz53Z2F7i5Vtv4pF0ZyDrIM2FkJCoc9Nh30M-XlAJqh5YRbU6v7-wzE67TUBGbgAunnSk2ViG-VaWOhlKUbkXyG2kXc2sZv1066rnfiaL1iE0FKikVftq8KIBgGgBgKAB7HO9iE&num=1&cid=5GhMuHGWBS25_bI3U--a3oyJ&sig=AOD64_0QCjOcXmZFC6EBr4waLKGyf4XGBw&client=ca-pub-2381651380176034&adurl=http://www.cromaretail.com/mastercard-offers.aspx%3Futm_source%3DGoogle-Search%26utm_medium%3DContent%26utm_content%3D%26utm_campaign%3DCroma-Dec%26cm_mmc%3DMastercard-_-Christmas-_-22nd%2BDec-_-Master%2BCard%2BLanding%2BPagehttp://www.google.com/url?ct=abg&q=https://www.google.com/adsense/support/bin/request.py%3Fcontact%3Dabg_afc%26url%3Dhttp://apache-error.blogspot.in/%26gl%3DIN%26hl%3Den%26client%3Dca-pub-2381651380176034%26ai0%3DCdMg352bsUI6mIYi5ige6lIHgCab26bUC1vm2jSLAjbcBEAEg4PfdFVCi0ZHr-_____8BYOWa6YPgDqABys-S8APIAQGpAr81bZgpfVM-qAMByAOfBKoEf0_QwvvOy5ywceU5w3BWcDjVtyJ-jPdKF7EVRnVW2DGYGXkDMuvgRD7ODEIoeVftlnRoWmKc6cR1mfL6djsnSsM-6w6eTAqvRzFp6Me_0v8Kj8SQJ5p9NGfMXQLxKUzBs_wOzV8K3bUHKd64_60fuyb8s-MXBwIqWNDzmePUBV6IBgGAB56w7Q8&usg=AFQjCNH4DI0dE4X4lgsXKS-XJoU0gGpOmghttp://www.googleadservices.com/pagead/aclk?sa=L&ai=CdMg352bsUI6mIYi5ige6lIHgCab26bUC1vm2jSLAjbcBEAEg4PfdFVCi0ZHr-_____8BYOWa6YPgDqABys-S8APIAQGpAr81bZgpfVM-qAMByAOfBKoEf0_QwvvOy5ywceU5w3BWcDjVtyJ-jPdKF7EVRnVW2DGYGXkDMuvgRD7ODEIoeVftlnRoWmKc6cR1mfL6djsnSsM-6w6eTAqvRzFp6Me_0v8Kj8SQJ5p9NGfMXQLxKUzBs_wOzV8K3bUHKd64_60fuyb8s-MXBwIqWNDzmePUBV6IBgGAB56w7Q8&num=1&cid=5Gg1CxfpjhywGcYyns8Tt6qb&sig=AOD64_0JXeq-RgKZ8B80a71vKUOYT8oqrw&client=ca-pub-2381651380176034&adurl=http://www.aptechnpower.com/hn4v1.aspx%3FSource%3Dctenggnew%26kwrd%3Dlinux%2520system%2520administration%2520coursehttp://www.google.com/url?ct=abg&q=https://www.google.com/adsense/support/bin/request.py%3Fcontact%3Dabg_afc%26url%3Dhttp://apache-error.blogspot.in/%26gl%3DIN%26hl%3Den%26client%3Dca-pub-2381651380176034%26ai0%3DCu_yE52bsUP_OHsHEige_34D4C8m6vZ8DsfyoqUnVn_DQNxABIOD33RVQ_Pns7v7_____AWDlmumD4A6gAYuT1e0DyAEBqQJM5o44DoNTPqgDAcgD3wSqBH9P0CKzOxVGagZQF6IXA5ErwGF6JtxP8ONk8USj6vDQu7KhDLzq3MnXOrb_gtKFRXleIl4EdyuMky4H_sx7nw23zbJv30bzG93z_zZgRC2Frjaf0F0Nok3vcb9ErYpfdXTOfBwn8WjGpBdG2pGY-VYhM29RLwfesnq_bJWuomhriAYBgAfd7KoS&usg=AFQjCNFwIim3-xzZ4Y7bd32MfylJUsf6RAhttp://www.googleadservices.com/pagead/aclk?sa=L&ai=Cu_yE52bsUP_OHsHEige_34D4C8m6vZ8DsfyoqUnVn_DQNxABIOD33RVQ_Pns7v7_____AWDlmumD4A6gAYuT1e0DyAEBqQJM5o44DoNTPqgDAcgD3wSqBH9P0CKzOxVGagZQF6IXA5ErwGF6JtxP8ONk8USj6vDQu7KhDLzq3MnXOrb_gtKFRXleIl4EdyuMky4H_sx7nw23zbJv30bzG93z_zZgRC2Frjaf0F0Nok3vcb9ErYpfdXTOfBwn8WjGpBdG2pGY-VYhM29RLwfesnq_bJWuomhriAYBgAfd7KoS&num=1&cid=5GggcZSiI9Oxdq1osnFT_bKV&sig=AOD64_0eVDrFyiTezaMxNtjLNLXs11gPDA&client=ca-pub-2381651380176034&adurl=http://MyHealthySpeak.co.in&nm=2
  • 7/29/2019 Web Server _ Apache and NginX

    2/8

    9/13 Web Server : Apache And NginX

    ache-error.blogspot.in

    Posted by Manoj Kumarat 10:00 AM No comments:

    proxy_read_timeout 60;

    proxy_buffer_size 4k;

    proxy_buffers 4 32k;

    proxy_busy_buffers_size 64k;

    proxy_temp_file_write_size 64k;

    }

    }

    For Caching contents create a file/etc/nginx/conf.d/ca che.confand enter following

    contents:

    ## Size Limits

    client_body_buffer_size 128K;

    client_header_buffer_size 1M;

    client_max_body_size 1M;

    large_client_header_buffers 8 8k;

    ## Timeouts

    client_body_timeout 60;

    client_header_timeout 60;

    expires 24h;

    keepal ive_timeout 60 60;

    send_timeout 60;

    ## General Options

    ignore_invalid_headers on;

    keepalive_requests 100;

    limit_zone gulag $binary_remote_addr 5m;

    recursive_error_pages on;

    sendfile on;

    server_name_in_redirect off;

    server_tokens off;

    ## TCP options

    tcp_nodelay on;

    tcp_nopush on;

    ## Compre ssion

    gzip on;

    gzip_buffers 16 8k;

    gzip_comp_level 6;

    gzip_http_version 1.0;

    gzip_min_length 0;

    gzip_types text/plain text/css image/x -icon application/x-perl

    application/x-httpd-cgi;

    gzip_vary on;

    ## Log Format

    log_format main '$remote_a ddr $host $remote_user [$time_local]

    "$request" '

    '$status $body_bytes_sent "$http_referer" "$http_user_agent" ''"$gzip_ratio" "$http_x_forwarded_for"';

    This cache.confwill be used by default for all your VHOSTS content caching, so

    you can manage accordingly :)

    Start nginx service : service nginx start

    Please correct if find somewhere mis-spelled or incorrect!!!

    WEDNESDAY, FEBRUARY 1, 2012

    http://www.blogger.com/email-post.g?blogID=783712521471379179&postID=1616851787551691528http://www.blogger.com/comment.g?blogID=783712521471379179&postID=1616851787551691528http://apache-error.blogspot.in/2012/02/reverse-proxy-with-nginx.htmlhttps://plus.google.com/113701026524170699917
  • 7/29/2019 Web Server _ Apache and NginX

    3/8

    9/13 Web Server : Apache And NginX

    ache-error.blogspot.in

    Posted by Manoj Kumarat 3:37 AM No comments:

    How to Install Nginx WebServer

    How to Install Nginx Web Server using Yum

    Add Nginx yum repository, create a file named /etc/yum.repos.d/nginx.repoand

    paste one of the configurations below:

    For CentOS

    CentOS:[nginx]

    name=nginx repo

    baseurl=http://nginx.org/packages/centos/$releasever/$basearch/

    gpgcheck=0

    enabled=1

    For Redhat

    RHEL:[nginx]

    name=nginx repo

    baseurl=http://nginx.org/packages/rhel/$releasever/$basearch/

    gpgcheck=0

    enabled=1

    Due to differences between how CentOS, RHEL, and Scientific Linux populate the

    $releasever variable, it is necessary to manually replace $releasever with either "5"

    (for 5.x) or "6" (for 6.x), depending upon your OS version.

    Now Run following command to install NginX Web Server:

    yum -y install nginx

    Start NginX Service : service nginx start

    How to Install Nginx Web Server using source code

    Download stable source code from http://nginx.org/download/nginx-1.0.11.tar.gz

    Unzip source code : tar zxvf nginx-1.0.11.tar.gz

    Unzipped directory should be nginx-1.0.11:

    cd nginx-1.0.11

    Run following commands to install:

    ./configure --prefix=/opt/nginx (--prefix=[path where to install].... use ./configure --

    help to find more options to enable or disable features)

    make

    make install

    Start Nginx Web Server : /opt/nginx/bin/nginx

    Stop Nginx Web Server : /opt/nginx/bin/nginx -s stop

    Nginx Logs and PID file : /opt/nginx/logs/{access.log}{error.log}{nginx.pid}

    Thats it!!!

    Ref : http://wiki.nginx.org/Install

    http://www.thegeekstuff.com/2011/07/install-nginx-from-source/

    WEDNESDAY, DECEMBER 28, 2011

    Apache vs NginX

    Nginx is known for its high performance, stability, rich feature set, simple

    configuration, and low resource consumption

    http://apache-error.blogspot.in/2011/12/apache-vs-nginx.htmlhttp://www.thegeekstuff.com/2011/07/install-nginx-from-source/http://wiki.nginx.org/Installhttp://nginx.org/download/nginx-1.0.11.tar.gzhttp://apache-error.blogspot.in/2012/02/how-to-install-nginx-webserver.htmlhttp://www.blogger.com/email-post.g?blogID=783712521471379179&postID=1089791733736838024http://www.blogger.com/comment.g?blogID=783712521471379179&postID=1089791733736838024http://apache-error.blogspot.in/2012/02/how-to-install-nginx-webserver.htmlhttps://plus.google.com/113701026524170699917
  • 7/29/2019 Web Server _ Apache and NginX

    4/8

    9/13 Web Server : Apache And NginX

    ache-error.blogspot.in

    Posted by Manoj Kumarat 9:38 AM No comments:

    Labels:Apache, linux, nginX, ubuntu, w eb server

    Nginx is one of a handful of servers written to address the C10K problem. Unlike

    traditional servers, Nginx doesn't rely on threads to handle requests. Instead it uses

    a much more scalable event-driven (asynchronous) architecture . This

    architecture uses small, but more importantly, predictable amounts of memory under

    load.

    Even if you don't expect to handle thousands of simultaneous requests, you can still

    benefit from Nginx's high-performance and small memory footprint. Nginx scales in

    all directions: from the smallest VPS all the way up to clusters of servers.

    Nginx particularly excels at serving static fileslike the Tectonicus map t ile images.

    For larger websites, it's often employed as a front-end Web server to quickly dish upunchanging page content, while passing on requests for dynamic stuff to more

    complex Apache Web servers running elsewhere. However, I was interested in it

    purely as a fast single Web server.

    http://joeandmotorboat.com/2008/02/28/apache-vs-nginx-web-server-performance-

    deathmatch/

    http://www.wikivs.com/wiki/Apache_vs_nginx

    Apache

    The drawback to doing everything with processes is that Apache prefork can be a bit

    of a memory hog, especially under load. Another precompiled flavor of Apache can

    be installed as an alternative:Apache MPM worker. "Worker" differs from "prefork" in

    that worker's processes are multithreaded, giving them the ability to service more

    requests with fewer system resources. This can translate into faster pages served

    with less RAM and CPU. However, because some Apache modules don't

    necessarily work well when run under multithreaded Apache, you have to specifically

    select this version to install on Ubuntu and on other GNU/Linux distros with package

    management.

    Alternatively we can use FastCGI with Apache to handle PHP requests. FastCGI can

    use a single persistent process which handles many requests over its lifetime

    http://www.cyberciti.biz/tips/rhel-centos-fedora-apache2-fastcgi-php-

    configuration.html

    Other Surveys for All Web Servers

    http://news.netcraft.com/archives/2011/04/06/april-2011-web-server-survey.html

    FRIDAY, DECEMBER 2, 2011

    Apache Questions

    Q1 How to enable Directory Listing

    Ans Place "Options +Indexes" in Directory Tabs

    Q2 Allow Apache to use / access symbolic links directory/files

    Ans Place "Options +FollowSymLinks" in Directory Tabs

    Q3 Allow Apache to use / access .htaccess file

    Ans Place "AllowOverride All" in Directory Tabs

    Q4 Can we replace .htaccess file to some other for our convenient

    Ans Yes, change "AccessFileName .htaccess" to "AccessFileName .xyz"

    Q5 Set default number of start processes

    Ans Find "StartServers ..." and set as per your requirement

    Q6 How to disable Apache signature/version

    http://apache-error.blogspot.in/2011/12/apache-questions.htmlhttp://news.netcraft.com/archives/2011/04/06/april-2011-web-server-survey.htmlhttp://www.cyberciti.biz/tips/rhel-centos-fedora-apache2-fastcgi-php-configuration.htmlhttps://httpd.apache.org/docs/2.0/mod/worker.htmlhttp://www.wikivs.com/wiki/Apache_vs_nginxhttp://joeandmotorboat.com/2008/02/28/apache-vs-nginx-web-server-performance-deathmatch/http://www.kegel.com/c10k.htmlhttp://apache-error.blogspot.in/search/label/web%20serverhttp://apache-error.blogspot.in/search/label/ubuntuhttp://apache-error.blogspot.in/search/label/nginXhttp://apache-error.blogspot.in/search/label/linuxhttp://apache-error.blogspot.in/search/label/Apachehttp://www.blogger.com/email-post.g?blogID=783712521471379179&postID=7102095825600501784http://www.blogger.com/comment.g?blogID=783712521471379179&postID=7102095825600501784http://apache-error.blogspot.in/2011/12/apache-vs-nginx.htmlhttps://plus.google.com/113701026524170699917
  • 7/29/2019 Web Server _ Apache and NginX

    5/8

    9/13 Web Server : Apache And NginX

    ache-error.blogspot.in

    Ans ServerSignature Off

    Q7 How to block/disable TRACE

    Ans Use "TraceEnable Off" globally so that TRACE will be disabled for all VHOSTS

    Q8 Best tools for monitoring Apache Requests

    Ans use Apache Handler "server-status" and APACHETOP tool (its like TOP

    command in linux)

    Q9 How can we protect our site to avoid DOS/DDOS attacks

    Ans Use mod_evasive apache module or this can also be done through firewall

    Q10 Redirect abc.com to www.abc.com

    Ans Use following in abc.com VHOST : - "Redirect / http://www.abc.com/"

    Q11 Which Apache processes are consuming higher memory

    Ans Use ApacheTop or "ps -ylC httpd --sort rss" this command will show all apache

    processes in ascending order according to \memory size used by per process (RSS

    field)

    Q12 What are different MPM's available in Apache for Linux and how they work

    Ans There are 2 MPMs available 1) Worker 2) Prefork

    Worker:- This Multi-Processing Module (MPM) implements a hybrid multi-

    process multi-threaded server. By using threads to serve requests, it is able to serve

    a large number of requests with fewer system resources than a process-based

    server. However, it retains much of the stability of a process-based server by keeping

    multiple processes available, each with many threads.

    The most important directives used to control this MPM are ThreadsPerChild, which

    controls the number of threads deployed by each child process and MaxClients,

    which controls the maximum total number of threads that may be launched

    Prefork :- This Multi-Processing Module (MPM) implements a non-threaded,

    pre-forking web server that handles requests in a manner similar to Apache 1.3. It is

    appropriate for sites that need to avoid threading for compatibility with non-thread-safe libraries. It is also the best MPM for isolating each request, so that a problem

    with a single request will not affect any other.

    This MPM is very self-regulating, so it is rarely necessary to adjust its configuration

    directives. Most important is that MaxClients be big enough to handle as many

    simultaneous requests as you expect to receive, but small enough to assure that

    there is enough physical RAM for all processes.

    Q13 Write a Rewrite rule to redirect (www).abc.com/request.php to

    www.abc.com/request1.php

    Ans RewriteEngine On

    RewriteCond %{HTTP_HOST} abc.com$ [NC,OR]

    RewriteCond %{HTTP_HOST} www.abc.com$ [NC]RewriteRule ^/request.php$ http://www.abc.com/request1.php [L]

    Q14 How many connections apache server can handle

    Ans This completely depends on our server configuration mainly on RAM

    Max no. of connections = (Total Memory - Memory Used By System For Its

    use) / average single apache process size*

    *Average Single Apache Process Size : Can be find using "top" command or

    "ps -ylC httpd --sort rss"

    To be continued....

    http://httpd.apache.org/docs/2.1/mod/mpm_common.html#maxclientshttp://httpd.apache.org/docs/2.1/mod/mpm_common.html#maxclientshttp://httpd.apache.org/docs/2.1/mod/mpm_common.html#threadsperchild
  • 7/29/2019 Web Server _ Apache and NginX

    6/8

    9/13 Web Server : Apache And NginX

    ache-error.blogspot.in

    Posted by Manoj Kumarat 1:11 AM No comments:

    THURSDAY, DECEMBER 1, 2011

    Posted by Manoj Kumarat 10:58 AM No comments:

    HTTP Status Codes

    http://en.wikipedia.org/wiki/List_of_HTTP_status_codes

    TUESDAY, MARCH 29, 2011

    Posted by Manoj Kumarat 12:18 AM No comments:

    Install Apache module without re-installation withAPXS

    In case we have installed Apache using source c ode and we would like to install one of

    its modules called mod_rewrite or whatever. Then we need to do the following to

    install module without re-installing Apache:

    cd apache-source-code

    cd modules/mappers

    /path/to/apache2/bin/apxs -iac mod_rewrite.c

    Add following to httpd.conf file:

    LoadModule rewr ite_module modules/mod_rewrite.so

    Then Restart Apache, thats it!!!

    TUESDAY, MARCH 15, 2011

    Apache Virtual Hosting

    What is Apache Virtual Hosting?

    When setting up more then One Host/Site over Single Server, this is called Virtual

    Hosting.

    Virtual Hosting can be of 2 type's:

    1) Name Based Virtual Hosting

    2) IP Based Virtual Hosting

    1) Name Based Virtual Hosting : Running multiple virtual hosts over a Single IP iscalled Name Based Virtual Hosting.

    2) IP Based Virtual Hosting : When a Server is having multiple IP's and per IP is

    having it's own Virtual Host is called IP Based Virtual Hosting.

    How to Setup Name Based Virtual Hosting and IP Based Virtual Hosting?

    Name Based Virtual Host :

    edit /etc/httpd/conf/httpd.conf

    Listen 192.168.1.1:80

    http://apache-error.blogspot.in/2011/03/apache-virtual-hosting.htmlhttp://apache-error.blogspot.in/2011/03/install-apache-module-without-re.htmlhttp://www.blogger.com/email-post.g?blogID=783712521471379179&postID=6621269460012177541http://www.blogger.com/comment.g?blogID=783712521471379179&postID=6621269460012177541http://apache-error.blogspot.in/2011/03/install-apache-module-without-re.htmlhttps://plus.google.com/113701026524170699917http://en.wikipedia.org/wiki/List_of_HTTP_status_codeshttp://apache-error.blogspot.in/2011/12/http-status-codes.htmlhttp://www.blogger.com/email-post.g?blogID=783712521471379179&postID=5253450366620154039http://www.blogger.com/comment.g?blogID=783712521471379179&postID=5253450366620154039http://apache-error.blogspot.in/2011/12/http-status-codes.htmlhttps://plus.google.com/113701026524170699917http://www.blogger.com/email-post.g?blogID=783712521471379179&postID=8640862256947835287http://www.blogger.com/comment.g?blogID=783712521471379179&postID=8640862256947835287http://apache-error.blogspot.in/2011/12/apache-questions.htmlhttps://plus.google.com/113701026524170699917
  • 7/29/2019 Web Server _ Apache and NginX

    7/8

    9/13 Web Server : Apache And NginX

    ache-error.blogspot.in

    NameVirtualHost 192.168..1.1:80

    VirtualHost 192.168..1.1:80

    ServerName localhost

    ServerAlias localhost.localdomain

    DocumentRoot /var/www/html

    Directory /var/ww w/html

    AllowOverride None

    Options -Indexes -FollowSymLinks

    Order allow, deny

    Allow from All

    /Directory

    CustomLog logs/localhost_access.log common

    ErrorLog logs/localhost_error.log

    /VirtualHost

    VirtualHost 192.168..1.1:80

    ServerName fistsite.com

    ServerAlias www.firstsite.com

    DocumentRoot /var/www/html/firstsite

    Directory /var/www/html/firstsite

    AllowOverride None

    Options -Indexes -FollowSymLinks

    Order allow, deny

    Allow from All

    /Directory

    CustomLog logs/firstsite_access.log common

    ErrorLog logs/firstsite_error.log

    /VirtualHost

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

    IP Based Virtual Host:

    edit /etc/httpd/conf/httpd.conf

    Listen 192.168.1.1:80

    Listen 192.168.1.2:80

    VirtualHost 192.168..1.1:80

    ServerName localhost

    ServerAlias localhost.localdomain

    DocumentRoot /var/www/html

    Directory /var/ww w/html

    AllowOverride None

    Options -Indexes -FollowSymLinks

    Order allow, deny

    Allow from All

    /Directory

    CustomLog logs/localhost_access.log common

    ErrorLog logs/localhost_error.log/VirtualHost

    VirtualHost 192.168..1.2:80

    ServerName fistsite.com

    ServerAlias www.firstsite.com

    DocumentRoot /var/www/html/firstsite

    Directory /var/www/html/firstsite

    AllowOverride None

    Options -Indexes -FollowSymLinks

    Order allow, deny

    Allow from All

    /Directory

    CustomLog logs/firstsite_access.log common

  • 7/29/2019 Web Server _ Apache and NginX

    8/8

    9/13 Web Server : Apache And NginX

    ache-error.blogspot.in

    Older PostsHome

    Subscribe to: Posts (Atom)

    Posted by Manoj Kumarat 2:41 AM 1 comment:

    ErrorLog logs/firstsite_error.log

    /VirtualHost

    VirtualHost 192.168..1.3:80

    ServerName second.com

    ServerAlias www.second.com

    DocumentRoot /var/www/html/second

    Directory/var/w ww/html/second

    AllowOverride None

    Options -Indexes -FollowSymLinks

    Order allow, denyAllow from All

    /Directory

    CustomLog logs/second_access.log common

    ErrorLog logs/second_error.log

    /VirtualHost

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

    Simple template. Powered by Blogger.

    http://www.blogger.com/http://www.blogger.com/email-post.g?blogID=783712521471379179&postID=6676758512985942307http://www.blogger.com/comment.g?blogID=783712521471379179&postID=6676758512985942307http://apache-error.blogspot.in/2011/03/apache-virtual-hosting.htmlhttps://plus.google.com/113701026524170699917http://apache-error.blogspot.com/feeds/posts/defaulthttp://apache-error.blogspot.in/http://apache-error.blogspot.in/search?updated-max=2011-03-15T02:41:00-07:00&max-results=7