• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 241
  • Last Modified:

apache virtual servers

Hy !

 I have a problem and i hope that someone can help me.

I run on a laptop mandrake 9.0 and on my big box Win9x.

 I've configured apache to work as a default server and works great !!!
Now when I tried to add a virtual server then came the problem .
It's not working .

 E.g.

My default Web server address is bengosul.ca and i try to make an virtual host by name test.ca ( note that i configured a dns server and works great , i mean i have in my dns config all the domains bengosul.ca, test.ca)

I've set up all the directories and file permisions but .. still gives me the same error :

" You don't have the permission to acces \ on this server
  Error 403 . "
I know that is a problem of permission settings , but i don't know where.
All my files are owned by user root and group root.

 Please give me a Hint !
 Tanks !

 
0
doveditul
Asked:
doveditul
  • 4
  • 4
  • 2
1 Solution
 
gizmolaCommented:
Is this box live on the Internet?  You aren't going to be able to add a bogus domain like test.ca and have it work.  Assuming you make an entry in your DNS server to support it, you could have a test.bengosul.ca domain and use that to test out your virtual server capability.
0
 
AzmeenCommented:
Are you able to ping test.ca? If yes, does it resolve to your IP? If you can, then add these lines to your httpd.conf...

<VirtualHost *>
ServerAdmin name@localhost
DocumentRoot /path/to/virtualhost/htdocs
ServerName test.ca
ErrorLog logs/test.ca.error.log
TransferLog logs/test.ca.access.log
</VirtualHost>

Restart apache... boom! You should have a working virtual host.
0
 
doveditulAuthor Commented:
Tanks For answering but ... It's not working.

First qizmola: The box is not on the internet it has only an network card and the address is 192.168.1.2 .

 The DNS is configured with 2 domanin names : www.bengosul.ca and www.test.ca pointing to the same address ( 192.168.1.2 )

The other machine with Win9x has the ip address 192.168.1.3

Second Azmmen :
 
 I did like you said and it's working , tanks but....
 
 when I try in the other's machine's browser :www.test.ca
It gives me the same page as www.bengosul.ca , iven if i have specified the documents directory to each.
 at the default www.bengosul.ca ( DocumentRoot "/var/www/something")
 and at the virtual host  DocumentRoot "/www/something")

 Iven so it prints me the same page !!
 I don't understant why ?
Apache sould look at the document root !
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
gizmolaCommented:
Make sure that the win9x machine has been restarted since you updated your DNS settings.  Some DNS information gets cached.
0
 
gizmolaCommented:
Also, if you could provide your httpd.conf here, we can check it over.
0
 
doveditulAuthor Commented:

  Here is my httpd.conf :

 <VirtualHost *>
     Options Includes MultiViews Indexes FollowSymlinks SymLinksIfOwnerMatch
     ServerName www.doveditul.ca
     DocumentRoot /www/doveditul/html
<Directory /www/doveditul/html>
     DirectoryIndex index.html index.htm
</Directory>
     HostNameLookups off
     ScriptAlias /cgi-bin/ /www/doveditul/cgi-bin/
     ErrorLog /www/doveditul/logs/error_log
</VirtualHost>
<Directory />
</Directory>


 And when i try to open the page actuali asks me to download the "/" on my server !!!

0
 
AzmeenCommented:
Alright... Here's a more in-depth description of what to do:

1) Check for the line "Listen 80" (without quotes) make sure it's uncommented.

2) Check for the line "Bind Address *" (without quotes) make sure it's COMMENTED. eg #Bind Address*

3) Change your Directory and VirtualHost directive to:

<Directory /www/doveditul/html>
    DirectoryIndex index.html index.htm
</Directory>

<VirtualHost *>
    Options Includes MultiViews Indexes FollowSymlinks SymLinksIfOwnerMatch
    ServerName www.doveditul.ca
    DocumentRoot /www/doveditul/html
    HostNameLookups off
    ScriptAlias /cgi-bin/ /www/doveditul/cgi-bin/
    ErrorLog /www/doveditul/logs/error_log
</VirtualHost>
0
 
gizmolaCommented:
Keep things simple:

Prior to having any Virtual hosts, you need this line:

NameVirtualHost 192.168.1.1:80 (Change the IP to be whatever your server's IP is)

Then have each VHost in it's own seperate VHost section.  Start with the minimum stuff you need, then add in the security tags, and options.

<VirtualHost 192.168.1.1>  (Again change the IP to be the same as the Host's IP)
  ServerName www.doveditul.ca
  ServerAdmin you@doveditul.ca
  DocumentRoot /www/doveditul/html
  Errorlog  logs/www.doveditul.ca_error_log
  CustomLog logs/www.doveditul.ca_access_log combined  
</VirtualHost>








0
 
doveditulAuthor Commented:
Guys thanks for help .

 But the problem is now that my default web server is working with the virtual : test.ca.

But on test.ca it says that I donèt have acces to / on that server .

 My default server is working great .

 So the problem is solved only a half .

If you would be so nice to help me . Please.

Maybe i didn't set up some file permisions well . I don't know ..
0
 
doveditulAuthor Commented:

  Tahks gizmola it's working !!!!\


 i own you !!
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 4
  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now