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.
Reply
 
Thread Tools Display Modes
  #1  
Old 5th January 2006, 11:45
OnTheRun OnTheRun is offline
Member
 
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.:

Code:
<VirtualHost 10.0.0.17:80>
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:
127.0.0.1 - - [05/Jan/2006:09:06:52 +0100] "GET / HTTP/1.1" 302 390 "-" "Links (2.1pre16; Linux 2.4.32 i686; 80x24)"
127.0.0.1 - - [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 127.0.0.1/localhost?

Thanks and with kind regards
Reply With Quote
Sponsored Links
  #2  
Old 5th January 2006, 12:53
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,749 Times in 2,579 Posts
Default

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.
__________________
Falko
--
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
  #3  
Old 5th January 2006, 13:01
OnTheRun OnTheRun is offline
Member
 
Join Date: Nov 2005
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

Hello,
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:

Code:
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
Reply

Bookmarks

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 15:25.


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