Sunday, October 2, 2011

Creating Virtual Hosts in Apache

I am sure most of what I am writing is available on the Apache Documentation but posting this so that it will be helpful for Users to configure Simple Virtual Hosts easily and faster. 

To start with "What is a VIRTUAL HOST"??
It is a method of Hosting multiple domain names on a server using a Single IP address. This allows sharing of resources of one server such as memory, processor cycles etc which lead to efficient utilization of the resources increasing the efficiency.

Now all of us know Apache is the HTTP Web Server which stores and maintains large number of Websites, It is designed to achieve a very high performance. To configure Virtual Host in Apache is very simple. It involves performing a few steps:


1.Firstly, Install the new Apache Web Server from the http://httpd.apache.org/ site. The downloads for all the OS are available.

2.After installation the Apache will be present in the following directory by default in case of Windows:  "C:\Program Files\Apache Software Foundation\Apache2.X" or "C:\Program Files (x86)\Apache Software Foundation\Apache2.X" in case if 64-bit machines.The httpd.conf file is present under the "conf" folder.
To create Virtual hosts define the following entries in the httpd.conf file which is present under "C:\Program Files\Apache Software Foundation\Apache2.X\conf" directory.

3.Open the file.In the beginning of the file there will be an entry to Listen on a particular port. By default the port is 80.
To create Virtual Hosts which run on port 81 and 82, include the lines after the Listen 80 line ie:            
    Listen 80 
    Listen 81                
    Listen 82
   .  
 
4.Now go to the bottom of the file and search for the entry:
         # Virtual hosts
         #Include conf/extra/httpd-vhosts.conf
       
5.Add the following under the entry:
          NameVirtualHost *:81
          NameVirtualHost *:82


         <VirtualHost *:81>
         DocumentRoot "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs1"
         ServerName www.example1.com


         # Other directives here


         </VirtualHost>


         <VirtualHost *:82>
        DocumentRoot "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs2"
        ServerName www.example2.org


        # Other directives here


       </VirtualHost>
    Note: The directory htdocs1 and htdocs2 should be created.
 6.Edit the hosts file located under the System32/drivers/etc/ directory. Add the two entries:
           <ip_address of the machine> www.example1.com         
           <ip_address of the machine> www.example2.com

 7.Save the file and close it. restart the Apache Web server either from Services or console.
 Access the link : http://www.example1.com:81/. It should redirect the control to the htdocs1 directory.Place few files in this directory. It must be served.
 Similary, accessing http://www.example2.com:82/ should be redirected to htdocs2 directory. To access the htdocs folder http://localhost:80/ will do.

Thus, We have setup a dedicated Virtual Host setup in Apache. 

113 comments:

  1. Thanks a lot very much for the high quality and results-oriented help. I won’t think twice to endorse your blog post to anybody who wants and needs support about this area.Rprogramming Training in pune

    Rprogramming Training in Bangalore

    Rprogramming Training in btm

    Rprogramming Training in bangalore

    Rprogramming Training in tambaram

    Rprogramming Training in annanagar

    ReplyDelete
  2. Thank you for sharing such valuable information and tips. This can give insights and inspirations for us; very helpful and informative! Would love to see more updates from you in the future.

    Selenium training in chennai
    Selenium training institute in Chennai
    iOS Course Chennai
    Digital Marketing Training in Chennai
    php courses in chennai
    PHP Training in Velahery
    French Classes in Chennai

    ReplyDelete
  3. I'm really glad that I came across your post. I was searching for this information. Thanks for sharing.
    LINUX Training in Chennai | LINUX Course | Best LINUX Training institute in Chennai | LINUX Course in Chennai

    ReplyDelete
  4. Thank you for this great article i learn a lot from your article keep it up.
    WordPress with LEMP Stack

    ReplyDelete
  5. Great post thanks for the share,
    You may know that Telegram is a great social media platform with lot of useful groups and channels, so you may like Telegram Group Links

    ReplyDelete
  6. Wonderful article!!! It is very useful for improve my skills. This blog makes me to learn new thinks. Thanks for your content.
    ORACLE TRAINING IN CHENNAI

    ReplyDelete
  7. Thanks for the information. The one thing I have noticed in this website is that you were continuously updating the changes that you have been made. It is a good sign to attract more people and I appreciate it. Hope more update and news from you.

    Matlab Training in Chennai | Robotics Training in Chennai | Machine Learning Training in Chennai | PHP Training in Chennai | Java Training in Chennai | Big Data Training in Chennai | Android Training in Chennai | Web Design Training in Chennai | Python Training in Chennai

    ReplyDelete
  8. This comment has been removed by the author.

    ReplyDelete
  9. awesome blog.
    https://www.kaashivinfotech.com/summer-internship-in-chennai/
    https://www.kaashivinfotech.com/summer-internship-in-chennai/
    https://www.kaashivinfotech.com/winter-internship-in-chennai/
    https://www.kaashivinfotech.com/online-internships/

    ReplyDelete
  10. Very interesting information blog post, my favorite this post, thanks a lot for these amazing content.
    Assignment Help
    Online Assignment Help
    programming homework help

    ReplyDelete
  11. This comment has been removed by the author.

    ReplyDelete
  12. KTM Bike launch a super bike KTM 790 Duke in India at a price of Rs. 8.64 Lakh ex-showroom Delhi, Check it MotoBike

    ReplyDelete
  13. Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing.

    Best phones under 10000
    Top 10 best mobile phones in india
    Best phones under 20000
    Coolpad 35031 model
    Mobiles
    Best phones under 5000

    ReplyDelete
  14. Nice information, you write very nice articles, I visit your website for regular updates
    the hindu pdf

    ReplyDelete
  15. Nice information, you write very nice articles, I visit your website for regular updates.
    current affairs august 2019 yojana magazine pdf download in hindi

    ReplyDelete
  16. Wow What A Nice And Great Article, Thank You So Much for Giving Us Such a Nice & Helpful Information, please keep writing and publishing these types of helpful articles, I visit your website regularly.
    bag trends 7 bags every girl should have

    ReplyDelete
  17. This is very helpful content and I also want to say that Starting a YouTube channel in 2020 is very important.

    ReplyDelete
  18. Thank you for sharing such valuable information and tips...
    IoT Training in Bangalore | Internet of Things Course | IoT Course in Bangalore - Tecmax - Tecmax offers the Best IoT Training in Bangalore, We offer Real-Time Job Oriented IoT Training with Live Projects,
    Our IoT (Internet of Things) Trainers are Working Professionals with 4+ years of Expertise in IoT, we also provide 100% Placement Assistance after IoT Course Completion.

    ReplyDelete
  19. Wow What A Nice And Great Article, Thank You So Much for Giving Us Such a Nice & Helpful Information, please keep writing and publishing these types of helpful articles, I visit your website regularly.
    school fee management software

    ReplyDelete
  20. This comment has been removed by the author.

    ReplyDelete
  21. thank you for share this wonderful information 파워볼사이트

    ReplyDelete
  22. Marijuana—also called weed, herb, pot, grass, bud, ganja, Mary Jane, and a vast number of other slang terms—is a greenish-gray mixture of the dried flowers of Cannabis sativa.

    The main active chemical in marijuana is THC (delta-9-tetrahydrocannabinol), the psychoactive ingredient. The highest concentrations of THC are found in the dried flowers, or buds. When marijuana smoke is inhaled, THC rapidly passes from the lungs into the bloodstream and is carried to the brain and other organs throughout the body. THC from the marijuana acts on specific receptors in the brain, called cannabinoid receptors, starting off a chain of cellular reactions that finally lead to the euphoria, or "high" that users experience. Feeling of a relaxed state, euphoria, and an enhanced sensory perception may occur. With higher THC levels in those who are not used to the effects, some people may feel anxious, paranoid, or have a panic attack.
    Cannabis plant used for medical or recreational purposes. The main psychoactive part of cannabis is tetrahydrocannabinol, one of the 483 known compounds in the plant, including at least 65 other cannabinoids. 
    buy real weed online
    how to buy weed online
    buy legal weed online
    buy recreational weed online
    buy weed edibles online
    can i buy weed online
    buy medical weed online
    buy weed online canada
    buying weed online reviews
    buy weed online legit
    buy weed online without medical card
    buy weed seeds online canada
    order marijuana online
    order marijuana seeds online
    how to order marijuana online
    order marijuana online without a medical card
    can you order medical marijuana online
    order marijuana online

    ReplyDelete
  23. Really i found this article more informative, thanks for sharing this article! Also Check here
    Sarkari Result CCC

    ReplyDelete

  24. thanks for share this amazing article sir 아바타배팅
    very nice and very good article 필리핀아바타배팅

    ReplyDelete
  25. amazing content nice thank you Very interesting information blog post, my favorite this post, thanks a lot for these amazing content. https://www.sermseo.com/

    ReplyDelete
  26. Let me tell you something...

    This might sound a little weird, and maybe even kind of "strange"

    HOW would you like it if you could simply hit "Play" to LISTEN to a short, "magical tone"...

    And INSTANTLY attract MORE MONEY to your LIFE??

    And I'm really talking about BIG MONEY, even MILLIONS of DOLLARS!!!

    Sound too EASY?? Think it couldn't possibly be REAL?!?

    Well, I'll be the one to tell you the news.

    Many times the greatest blessings in life are the easiest to GET!!!

    In fact, I'm going to PROVE it to you by letting you PLAY a REAL "miracle money-magnet tone" I've synthesized...

    YOU simply push "Play" and watch as your abundance angels fly into your life... starting so fast, you will be surprised...

    CLICK here NOW to play this marvelous "Miracle Money TONE" as my gift to you!!!

    ReplyDelete
  27. Very good post, keep sending us such informative articles I visit your website on a regular basis.
    temperature in bhilai

    ReplyDelete
  28. Listen...

    What I'm going to tell you may sound a little weird, maybe even kind of "out there"....

    WHAT if you could just push "PLAY" to listen to a short, "miracle tone"...

    And magically attract MORE MONEY into your LIFE?

    And I'm really talking about BIG MONEY, even MILLIONS of DOLLARS!!

    Think it's too EASY? Think it's IMPOSSIBLE?!?

    Well then, I'll be the one to tell you the news...

    Sometimes the greatest miracles life has to offer are the EASIEST!!

    Honestly, I'm going to PROVE it to you by letting you listen to a real-life "miracle money-magnet tone" I've synthesized...

    YOU just push "PLAY" and the money will start coming into your life.. starting so fast, you will be surprised..

    CLICK here to experience the magical "Miracle Abundance Tone" - as my gift to you!!

    ReplyDelete
  29. 당신이 공을 통제 할 때, 항상 법정에서 일어나는 일에주의를 기울여야합니다. 다른 플레이어가 어디에 있는지 알고 있습니다. 땅을 쳐다 보지 마십시오. 귀하가 그렇게한다면, 귀하가 반드시 성공해야한다는 법원의 인식을 가질 수있는 방법이 없습니다 구글상위노출.

    ReplyDelete
  30. Really i found this article more informative, thanks for sharing this article! Also Check here 파워볼사이트

    ReplyDelete
  31. very nice and greatw ebsite thank you very much for this amazing website very very nice and great 필리핀 아바타배팅

    ReplyDelete
  32. Really Nice & Very helpful article. Keep up the good work.
    Best Website Design Company In Dehradun

    ReplyDelete
  33. A very inspiring blog your article is so convincing that I never stop myself to say 메이저사이트

    ReplyDelete
  34. A very inspiring blog your article is so convincing that I never stop myself to say 바카라사이트

    ReplyDelete
  35. A very inspiring blog your article is so convincing that I never stop myself to say 파워볼사이트

    ReplyDelete
  36. A very inspiring blog your article is so convincing that I never stop myself to say 파워볼 메이저 사이트

    ReplyDelete
  37. I found your article on Google when I was surfing, it is written very nicely and is optimized.Thank you I visit your website regularly.
    sakshi epaper

    ReplyDelete
  38. Really i found this article more informative, thanks for sharing this article! Also Check here 파워볼 메이저 사이트

    ReplyDelete
  39. Really i found this article more informative, thanks for sharing this article! Also Check here 파워볼사이트

    ReplyDelete
  40. I think this is definitely an amazing project here. So much good will be coming from this project. The ideas and the work behind this will pay off so much. I am very happy to see your blog. You did a great job and thanks for sharing.We provide best services Ecommerce Website Development Dubai for your digital product you visit for more details.

    ReplyDelete
  41. Thank you for such a nice article keep posting, I am a RegularVisitor of your website.
    best time to visit goa

    ReplyDelete
  42. This comment has been removed by the author.

    ReplyDelete
  43. What a fantabulous post this has been. Never observed this sort of helpful post.
    The Best Homework Writing Service

    ReplyDelete
  44. Internet Download Manager segments the files downloaded dynamically during the download process and reused available connections without connecting and accessing additional stages to achieve the best acceleration performance.idm crack download
    idm crack download
    idm crack download
    idm crack download
    idm crack download
    idm crack download
    idm crack download


    ReplyDelete
  45. However, we are not responsible for this crack version of windscribe vpn crack 2020 will smoothly work on your system. Sometimes, you may be activating the antivirus that’s assuming the crack as a virus, so you need to disable it and then install it. But , still we can’t claim that will work on the system, if it not work please mention in the comments section, we will provide the latest crack version with serial and license key. Thanks again for visiting us.

    ReplyDelete
  46. Learning is a hard process if not handled with proper tools. We offer Test Banks and Solution Manuals for the most popular textbooks including Macroeconomics Sixth Canadian Edition Test Bank. View today!

    ReplyDelete
  47. Find instant solutions for thousands of college homework questions like: how many fluoride ions are present in 65.5 ml of 0.210 m alf3 solution? only on ScholarOn, the best academic assistance available online.

    ReplyDelete
  48. Really i found this article more informative, thanks for sharing this article! Also Check here 로또

    ReplyDelete
  49. Your Design is awesome and the page loads so fast even after so much of comments. My site too loads fast. You can check out my site ShoutMeBack from Here.

    ReplyDelete
  50. Bachelor of Commerce Semester wise Exam Schedule 2021 now available online.Allahabad University BCom Time Table Students Can Check 1st 2nd 3rd Year BCom Datesheet 2020-2021.

    ReplyDelete
  51. The Free Hearth Mod Menu APK is Only a modded Variant of the game Garena No Cost Hearth. It’s by far the most sought after arcade game app by gamers since it permits them to inject different features like auto aim, higher rate, teleportation, amongst the others, which makes it simpler to allow them to progress in positions and battle. FREE FIRE HACK thanks ....

    FREE FIRE DIAMONDS UNLIMITED thanks ....

    Click Here For Visit My Site thanks ....

    Temp Mail Mod thanks ....

    PUBG MOBILEHACK thanks ....

    pubg mobile esp hack thanks ....

    Click Here For Visit My Site thanks ....


    Click Here For Visit My Site thanks ....


    Click Here For Visit My Site thanks ....


    Click Here For Visit My Site thanks ....

    ReplyDelete
  52. This is an extremely supportive post, exceptionally educational there is no uncertainty about it. A debt of gratitude is in order for imparting this data to us. bank truly value your work.

    ReplyDelete
  53. Wonderful article! This blog makes me to learn new thinks. Thanks for your content. Best digital marketing course I am suggesting here. This field having more job opportunity in future.

    ReplyDelete
  54. http://readineurope.blogspot.com/2017/04/first-day-in-rome.html
    http://kmaiya.blogspot.com/2011/10/creating-virtual-hosts-in-apache.html
    http://kinographics.blogspot.com/2012/12/stop-motion-animation.html
    http://jeff-vogel.blogspot.com/2009/11/make-your-game-easy-then-make-it-easier.html
    https://mumbainewsnetworks.blogspot.com/2020/06/njla-announces-online-programs-for.html
    http://bitsquid.blogspot.com/2017/02/stingray-renderer-walkthrough-4-sorting.html
    https://drlibsc.blogspot.com/2018/10/senior-library-and-information-officer.html
    https://testallforone.blogspot.com/2015/09/sp-flash-tool-error.html
    http://chrisnart.blogspot.com/2011/07/abandoned-cnc-mill.html
    http://mkalugin-cq.blogspot.com/2012/11/how-to-use-maven-project-to-create.html

    ReplyDelete
  55. You may want to ask, "Would someone be able to take care of my assignment" because of an absence of clear idea. Our assignment helpers are exceptionally capable and have a huge information. Subsequently, they can undoubtedly set up a profoundly useful assignment for you. With their help, you can likewise get out the entirety of your ideas.
    myassignmenthelp

    ReplyDelete

  56. This sort of clever work and exposure! Keep up the very good works. Wonderful! Thank you for you great knowledgeable article. Thank you for sharing. Also visit eub post utme past questions

    ReplyDelete
  57. Best 10 Easy Yoga Pose Of The Day In 2022



    How to do it

    Stand together along with your ft collectively or hip-width apart. Ground down via the 4 corners of your ft. Roll your shoulders farfar from your ears, draw your shoulder blades down your lower back, and raise the crown of your head.



    Engage your thighs, draw your stomach button in, and extend up via the backbone. Turn your hands dealing with the the front of the room. Relax your jaw and unfurrow your brow. Breathe easy.

    Topest 2 Fitness Trackers For Women in UK,USA AND CANADA IN 2022
    t



    The advantages

    It may also appear to be you’re, well, simply status there, however undergo with us. This is the blueprint for all different poses. It promotes stability and directs your interest to the prevailing moment.

    ReplyDelete
  58. Thanks for sharing a valuable information .Knowledge is the foundation of a successful and fulfilling life. online-shiksha

    ReplyDelete