Please login or register.

Login with username, password and session length
Advanced search  

News:

(2009-05-04) The Rules and Terms of Service have been updated. Please make sure you read, understand, and follow them.

Author Topic: VirtualHost Issue  (Read 343 times)

0 Members and 1 Guest are viewing this topic.

GUKPT

  • Irregular
  • Offline Offline
  • Posts: 9
    • View Profile
VirtualHost Issue
« on: November 17, 2008, 07:42:55 AM »
Hi all.really hope someone can help me here..
I have 3 sites in my vhost
site1.com
site2.com
site3.com

when i try my local ip to the server 192.162 etc it loads up site1.com ok with runnin scirpts
when i try same thing local i192.168etc/site2.com its loads up fine all html pages an not runnin any scirpts on this 1..
when i try same 192.168etc/site3.com i get forbiddon.i look in the error logs and see options ExecCGI is off in this directory but i know i have it on..site 1 and 3 are runnin the same scirpts and i have set then up the same. does anyone know whats goin on.do i have to put something dif in site3.com to run scirpts aswell and site1.com
« Last Edit: November 17, 2008, 07:45:14 AM by GUKPT »
Logged

thorpe

  • 'Mind Boggling!'
  • Offline Offline
  • Posts: 17,544
    • View Profile
Re: VirtualHost Issue
« Reply #1 on: November 17, 2008, 08:05:17 AM »
Virtual hosts should have there own document root not inside another virtual hosts document root. Seems you have an odd setup.

Can we see the relevent vhost configs?
Logged

GUKPT

  • Irregular
  • Offline Offline
  • Posts: 9
    • View Profile
Re: VirtualHost Issue
« Reply #2 on: November 17, 2008, 08:27:23 AM »
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#


<VirtualHost *:80>
    ServerAdmin Admin@site1.com
    DocumentRoot "C:/wwws/forum"
    ServerName site1.com
    ServerAlias www.site1.com
<Directory "C:/wwws/forum">
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
    ScriptAlias /cgi-bin "c:/wwws/forum/Yabb2/cgi-bin/yabb2"
<Directory "c:/wwws/forum/Yabb2/cgi-bin/yabb2">
    AllowOverride all
    Options +ExecCGI
    AddHandler cgi-bin .cgi ,pl
    Order allow,deny
    Allow from all
</Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin Admin@site2.com
    DocumentRoot "C:/wwws/forum/site2.com"
    ServerName site2.com
    ServerAlias www.site2.com
<Directory "c:/wwws/forum/site2.com/">
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
</Virtualhost>

<VirtualHost *:80>
    ServerAdmin Admin@site3.com
    DocumentRoot "C:/wwws/forum/site3.com"
    ServerName site3.com
    ServerAlias www.site3.com
<Directory "C:/wwws/forum/site3.com">
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
    ScriptAlias /cgi-bin "c:/wwws/forum/site3.com/Yabb2/cgi-bin/yabb2"
<Directory "c:/wwws/forum/site3.com/Yabb2/cgi-bin/yabb2">
    AllowOverride all
    Options +ExecCGI
    AddHandler cgi-bin .cgi ,pl
    Order allow,deny
    Allow from all
</Directory>
</VirtualHost>



Logged

thorpe

  • 'Mind Boggling!'
  • Offline Offline
  • Posts: 17,544
    • View Profile
Re: VirtualHost Issue
« Reply #3 on: November 17, 2008, 08:29:15 AM »
Why are your document roots within each other? I'm not 100% sure, but that may cause issues.
Logged

GUKPT

  • Irregular
  • Offline Offline
  • Posts: 9
    • View Profile
Re: VirtualHost Issue
« Reply #4 on: November 17, 2008, 08:35:01 AM »
i tryed to keep all sites in wwws/forum/site.com folder...if this was a prob then surly site2.com wouldnt work..but 1 and 2 does work only site3 dont work..just keep gettin the same error
   
Logged

GUKPT

  • Irregular
  • Offline Offline
  • Posts: 9
    • View Profile
Re: VirtualHost Issue
« Reply #5 on: November 17, 2008, 10:39:15 PM »
still no joy.i seem to still be gettin the same error with site3.com (error logs and see options ExecCGI is off in this directory)
Just dont understand why site1.com runs scirpts but not site3.com,as you can see they both have options ExecCGI there..
Logged

neogranas

  • Enthusiast
  • Offline Offline
  • Gender: Male
  • Posts: 67
    • View Profile
Re: VirtualHost Issue
« Reply #6 on: November 18, 2008, 10:07:42 AM »
You may need to look at an apache module for setting two separate directories for cgi-bin's. mod_cgi perhaps?
Logged

PHP Freaks Forums

 
 
 

Page created in 0.075 seconds with 21 queries.