Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Old 5th January 2006, 11:45
OnTheRun OnTheRun is offline
Join Date: Nov 2005
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem getting from localhost on virtual host

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. domain.ch) itself on itself:

PHP Code:
fsockopen ("www.domain.ch"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.:

ServerName www.domain.ch:80
ServerAdmin webmaster@domain.ch
DocumentRoot /var/www/webX/web
ServerAlias www.domain.ch domain.ch ftp.domain.ch subdomain.domain.ch subdomain2.domain.ch subdomain3.domain.ch
DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl 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 www.domain.ch 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
Reply With Quote
Sponsored Links
Old 5th January 2006, 12:53
falko falko is offline
Super Moderator
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,749 Times in 2,579 Posts

Please check if www.domain.ch is used somewhere else in your main Apache configuration file. Also make sure the Vhosts_ispconfig.conf is included in your main Apache configuration.
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Old 5th January 2006, 13:01
OnTheRun OnTheRun is offline
Join Date: Nov 2005
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts

thank you for your answer.
The domain.ch 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 domain.ch. 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 by OnTheRun; 5th January 2006 at 13:08.
Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
view webalizer stats kuyaedz General 22 12th March 2006 15:45
External Email Getting Lost jash General 10 8th November 2005 22:55
Virtual Host for Shared IP Tribal-Dolphin Feature Requests 3 24th October 2005 21:55
postfix config jmroth Installation/Configuration 6 18th September 2005 16:58
default virtual host jmroth Installation/Configuration 3 17th September 2005 21:29

All times are GMT +2. The time now is 07:17.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.