Problem getting from localhost on virtual host

Discussion in 'Installation/Configuration' started by OnTheRun, Jan 5, 2006.

  1. OnTheRun

    OnTheRun New Member

    Hello all,
    I have the following problem:

    I'm using a php-script, which uses the fsockopen-function. The scrip gets executed from the server (i.e. itself on itself:

    fsockopen (""80$errno$errstr30);
    First he didn't knew his own domains, so I had the idea, that it sure wouldn't be bad to add the domainnames to /etc/hosts.
    The server now knows the domains, but doesn't forward them correctly to the
    corresponding vhost.

    The vhost is i.e.:

    ServerAdmin [email protected]
    DocumentRoot /var/www/webX/web
    DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.jsp Default.htm default.htm
    ScriptAlias  /cgi-bin/ /var/www/webX/cgi-bin/
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl
    ErrorLog /var/www/webX/log/error.log
    He forwards not to /var/www/webX/web as it's defined in the vhosts-file, but he forwards to /var/www/apache2-default (I tried this by using links2 on the server itself).

    The system is Debian 3.1 with apache 2 and ISPConfig.

    I checked the logs. In error.log is nothing, in access.log the following:

    Code: - - [05/Jan/2006:09:06:52 +0100] "GET / HTTP/1.1" 302 390 "-" "Links (2.1pre16; Linux 2.4.32 i686; 80x24)" - - [05/Jan/2006:09:06:52 +0100] "GET /apache2-default/ HTTP/1.1" 200 1457 "-" "Links (2.1pre16; Linux 2.4.32 i686; 80x24)"
    Has anybody a clue how I can tell the server to use the vhosts-file when a request comes from

    Thanks and with kind regards
  2. falko

    falko Super Moderator ISPConfig Developer

    Please check if is used somewhere else in your main Apache configuration file. Also make sure the Vhosts_ispconfig.conf is included in your main Apache configuration.
  3. OnTheRun

    OnTheRun New Member

    thank you for your answer.
    The isn't anywhere in /etc/apache2/apache2.conf. Vhots_ispconfig.conf gets included in the last line of apache2.conf:

    Include /etc/apache2/vhosts/Vhosts_ispconfig.conf
    Could it be, that the function fsockopen doesn't send any headers? And links2 from console neither? Because from outside it works like a charm to reach the domain Just from the server itself I get forwarded to apache2-default. But exactly that's the problem, because I need to call the function fsockopen from the server itself.

    Thanks and with kind regards.
    Last edited: Jan 5, 2006

Share This Page