[Ilugc] More than one Virtual Host setup's

  • From: knura9@xxxxxxxxx (Arun Khan)
  • Date: Sat, 2 Jul 2011 17:40:42 +0530

On Fri, Jul 1, 2011 at 10:04 AM, Suresh Kumar <suresh1876 at gmail.com> wrote:

.....................

?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


"isinfotech.com", "cefpress.com" and "bobstores.com"   are legitimate
active domains.  Unless you or the company you work for, has been
contracted to do work for the owners of the said domains,   you should
avoid them.  Instead "example.{org,com,net}  can be used for such
purposes.

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 believe you need to define a **default**  virtual host which is missing - see:
<http://httpd.apache.org/docs/2.0/vhosts/examples.html>
<http://serverfault.com/questions/82306/apache-default-catch-all-virtual-host>

-- 
Arun Khan
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

Other related posts: