Problem with Vhost set up and cgi-bin

Discussion in 'Apache' started by GMC, Dec 27, 2011.

  1. #1
    Just struggling a bit here and looking for your help - PLEASE!!

    I own a file sharing site, where I have a main server and multiple file servers

    I havent bothered naming the file servers (in a virtual host sense) before as they have one hard drive and I can just use the IP address for the apache Vhost.

    Well with all file sharing sites, space is the issue and now I have added an external hard drive to one of these file servers, connected by USB.

    I have added mounted and formatted the drive and then went to figure out how to use it!!!

    As the server only has 1 IP I decided to try creating a sub domain called usb.mydomain.com, and added it as a vhost under apache (sending the Aname through bind to the servers IP address)

    This is where I have run into trouble

    The address: http://usb.mydomain.com/files/index.html

    Appears to serve the correct file (I should check that on second thoughts - let me get back to this)

    But, the address: http://usb.mydomain.com/cgi-bin/install_fs.cgi gives me a 404 error (install_fs.cgi is the install script for the file sharing service)

    I check the error logs, and the problem I have is the cgi is checking the IP (Original Vhost) based cgi-bin (found at home/www) rather than the one I set up in the new named server found at diskusb/pro

    Is there a way to have these two vhosts on the same machine?


    Any help is more than appreciated

    Graeme

    Here are the contents of the apache files

    <VirtualHost *:80>
    DocumentRoot /diskusb/pro
    ServerName usb.mydomain.com
    ScriptAlias /cgi-bin/ "/diskusb/pro/cgi-bin/"
    </VirtualHost>
    Code (markup):
    <VirtualHost 94.xxx.xx.6:80>
    DocumentRoot "/home/www"
    <Directory "/home/www">
    allow from all
    Options +Indexes
    </Directory>
    ScriptAlias /cgi-bin/ "/home/www/cgi-bin/"
    </VirtualHost>
    Code (markup):
     
    GMC, Dec 27, 2011 IP
  2. GMC

    GMC Member

    Messages:
    99
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    45
    #2
    Ignore this - Its solved

    I solved it by naming the IP vhost, setting up another entry in Bind and then crossing my fingers and changing the server details in the scripts admin panel

    Alls well that ends well

    GMC
     
    GMC, Dec 28, 2011 IP