My Create Virtual Host Doesn't Work

Posted October 23, 2014 9.2k views

I have followed the detailed instructions on How To Set Up Apache Virtual Hosts on Ubuntu 14.04 LTS
When I go to I get - Example Domain

This domain is established to be used for illustrative examples in documents. You may use this domain in examples without prior coordination or asking for permission.

When I go to - a website comes up for

I can’t figure out why the html PAGES ON Apache2 will not show. I have created the HTML pages.

I am running Ubuntu 14.04 LTS and Apache2 Server

1 comment
  • 1.Make sure you include the file types (index.htm,index.html) with in the vhost entry.

    1. Make sure that the apache user has correct permissions on your www directory

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
3 answers

Hi! and should be replaced by the domain names that you actaully own and use. In the tutorial “How To Set Up Apache Virtual Hosts on Ubuntu 14.04 LTS,” everything highlighted in red is meant to be replaced.

by Justin Ellingwood
The Apache web server is the most popular way to serve web content on the internet. Apache has the ability to serve multiple domains from a single server by using a mechanism called "virtual hosts". If a virtual host is configured correctly for each domain, the web server can correctly route traffic to the appropriate files based on the domain name requested. In this guide, we'll demonstrate how to configure Apache virtual hosts on an Ubuntu 14.04 VPS.
  • Thanks asb but I do not own any domain names. I just wanted to test the virtual host for future domain names. Is there a way to test the virtual host? I’m just setting up my home web server.

  • If you’re just doing it on a home webserver, then instead of setting up multiple VirtualHosts just use one and install your sites into subfolders. Then you can access them via the server’s IP address like http://ip.address/wiki, http://ip.address/random_app

Thanks everyone for helping. I went over all my files to make everything was spelled correct and in the right file. I finally got it to work using URL

I have follow all steps and create virtual directory then when run file given error all contents encoding format. how to solve this issue in Ubuntu.
Example link


output:‹;RTA¯Ó0¾ïW˜ri]÷€S×V @âàÂ1kÜÕZ“”$í6¡÷ßqÛ½®åí@+µŽþlÇIžI“ûsPzUe‹äñ‡Bfà'ñä+Ì>Ÿ„ª+„OF ÒI4hÃ…^@^ ëЧAã‹p@”MŒ¥÷uˆ¿jÓà£Ñµ»°äÃ* <ž|ԅߎP·´P˜-á±6ÖOü$}™Jl)Ç°,4yUèrQazw…rþÌÉt.sç‚Á¶3òz±Šü°·¦Ñ2ÌMelÏ‹5¿¯¶ã%ìžt뫪R’ÞÏt3 ¡¨:Ç|¯Qá]°„àV-zÊ|ÃY3–ðÁrKp¼5th©¸"öÂCÿ•ÔNH÷éÇðv½®OOyÞ£ÑxsƒîýÌáVîÅ$þÎX‰6´BRãb¸CµPqEú°äKŽ<Ê ÁG¸×›7›Í±ëE(17Vx2ÌUSÐ÷ % x¡Ä)¼dù®Ëòå´eóþO&£4/䤘óŠÍú~ÃöOiÖsëXï±dWÃ7‰ú#šuò"‰†y\$]j<žLòrË»'£ÉªÁVg?Kr {=°„΋]E®ä^x;„ƱXTUó]Õ[Ï{çâs+øeÎùÜ9gäáà]ÐõÕëH¾4‡Ú#ç†KAºï'ðZ¸§Þ­ÑrŽ «$ªGÖ ß‹4èn8ŠŽÇ㊄+c÷ÑÏE—hAöÕXäðŒ§ú«ƒ‰¬L¢¾RIt©[4\o•ª‹ö