?
Solved

apache virtual servers

Posted on 2003-03-07
10
Medium Priority
?
237 Views
Last Modified: 2013-11-18
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
Comment
Question by:doveditul
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 2
10 Comments
 
LVL 4

Expert Comment

by:gizmola
ID: 8093039
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
 
LVL 2

Expert Comment

by:Azmeen
ID: 8093756
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
 

Author Comment

by:doveditul
ID: 8094037
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
Building an interactive eFuture classroom

Watch and learn how ATEN provided a total control system solution including seamless switching matrix switch, HDBaseT extenders, PDU, lighting control to build an interactive eFuture classroom.

 
LVL 4

Expert Comment

by:gizmola
ID: 8094574
Make sure that the win9x machine has been restarted since you updated your DNS settings.  Some DNS information gets cached.
0
 
LVL 4

Expert Comment

by:gizmola
ID: 8094593
Also, if you could provide your httpd.conf here, we can check it over.
0
 

Author Comment

by:doveditul
ID: 8094802

  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
 
LVL 2

Expert Comment

by:Azmeen
ID: 8096185
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
 
LVL 4

Accepted Solution

by:
gizmola earned 200 total points
ID: 8099699
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
 

Author Comment

by:doveditul
ID: 8100061
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
 

Author Comment

by:doveditul
ID: 8100103

  Tahks gizmola it's working !!!!\


 i own you !!
0

Featured Post

How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to update Firmware and Bios in Dell Equalogic PS6000 Arrays and Hard Disks firmware update.
Microservice architecture adoption brings many advantages, but can add intricacy. Selecting the right orchestration tool is most important for business specific needs.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question