[Ilugc] More than one Virtual Host setup's

  • From: suresh1876@xxxxxxxxx (Suresh Kumar)
  • Date: Fri, 1 Jul 2011 10:04:22 +0530

On Tue, Jun 28, 2011 at 4:18 PM, Mehul Ved <mehul.n.ved at gmail.com> wrote:

----text snipped----

Why not just put them all in the same file?
See
http://library.linode.com/web-servers/apache/installation/fedora-14#sph_configure-name-based-virtual-hosts

 Thanks Mehul,
  Sorry for the delayed response...
  i have followed the steps in the above link, except that, i have not
changed the document root to
  /srv/www/  and so i have not created symbolic links
 instead i have left my project files reside at  /var/www/htm/project1 ,
project2...

 i have created a vhost.conf in the path /etc/httpd/conf.d/vhost.conf.
 here is the contents...

NameVirtualHost *:80

<virtualhost *:80>
      ServerAdmin admin at gmail.com
      DocumentRoot /var/www/html/dev_setup/
      ServerName dev_setup
      ServerAlias www.dev_setup.com
   </virtualhost>
   <virtualhost *:80>
      ServerAdmin admin at gmail.com
      DocumentRoot /var/www/html/cefpress.com/
      ServerName  cefpress.com
      ServerAlias cefpress.com
   </virtualhost>
   <virtualhost *:80>
      ServerAdmin admin at gmail.com
      DocumentRoot /var/www/html/dev.bobstores.com/
      ServerName dev.bobstores.com
      ServerAlias dev.bobstores.com
   </virtualhost>


and the entries in the /etc/hosts file are ...

127.0.0.1 wks17.isinfotech.com wks17 localhost.localdomain localhost
localhost4
::1 wks17.isinfotech.com wks17 localhost6.localdomain6 localhost6
127.0.0.1 localhost localhost
127.0.0.1 www.dev_setup.com dev_setup
127.0.0.1 www.cefpress.com cefpress.com
127.0.0.1 dev.bobstores.com   dev.bobstores.com



Now i am able to view the virtual sites,  as
http://dev_setup/
http://cefpress.com
http://dev.bobstores.com

but not able to view the sites which i create at /var/www/html/
 for example
 if create a new project at mobilesite at /var/www/html/mobilesite

and try to access it as http://localhost/mobilesite/

i get the following error  - " The requested URL /mobilesite was not found
on this server. "

do i need add corresponding entry to the /etc/httpd/conf.d/vhost.conf and
/etc/hosts files.?

Please let me know.
Thanks in Advance.


-- 
~ J Suresh Kumar
  95000 90432
http://myrakshana.info/blog/

Other related posts: