Forum

Virtual Host

kaz
22 January 2010, 10:08

Hiawatha version: 6.16 (LAMP-6.16-5.1.35-5.2.9)
Operating System: puppy431

Hi!

I accessed ttp://pana/, and browser showed default site(/root/httpd/hiawatha/index.php).
Why cannot it access to /root/httpd/hiawatha/TEST/index.php?

Hostname=127.0.0.1
WebsiteRoot=/roothttpd/hiawatha
StartFile=index.php
Virtual host{
Hostname=pana
WebsiteRoot=/roothttpd/hiawatha/TEST
StartFile=index.php
UseFastCGI=PHP5
}
Hugo Leisink
22 January 2010, 10:10
Any other (virtual) host that matches pana present in your configuration?
kaz
22 January 2010, 10:30
Thanks!

I have default and 2 virtual host.
I deleted vaitual host(Hostname=localhost).
But I accessed http://pana/, and browser showed default site(/root/httpd/hiawatha/index.php).

Hostname=127.0.0.1
WebsiteRoot=/roothttpd/hiawatha
StartFile=index.php

Virtual host{
Hostname=pana
WebsiteRoot=/roothttpd/hiawatha/TEST
StartFile=index.php
UseFastCGI=PHP5
}

Virtual host{
Hostname=localhost
WebsiteRoot=/roothttpd/hiawatha
StartFile=index.php
UseFastCGI=PHP5
}
Hugo Leisink
22 January 2010, 14:35
have you restarted Hiawatha after changing the configuration?
kaz
22 January 2010, 15:05
Yes of course.

#/etc/rc.d/init.d/rc.httpd stop
stopping PHP FastCGI daemons
#/etc/rc.d/init.d/rc.httpd start
read /var/run/php-fcgi.pid: No such file or directory
starting PHP FastCGI daemons
kaz
22 January 2010, 15:22
I temporary changed to WebsiteRoot=/roothttpd/hiawatha for Virtual host(Hostname=pana).
Browser show /root/httpd/hiawatha/TEST/index.php by accessing http://pana/TEST. (both pana itself anf another PC)

contens of index.php
<?php diename(__FILE__) ?>
Hugo Leisink
22 January 2010, 15:34
What does your acceslog say?
kaz
22 January 2010, 15:57
accessing from pana itself

127.0.0.1|Fri 22 Jan 2010 23:53:13 +0900|200|40436||GET / HTTP/1.1|Host: pana|User-Agent: Mozilla/5.0 (X11; U; Linux i686; ja-JP; rv:1.8.1.23) Gecko/20090910 SeaMonkey/1.1.18|Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5|Accept-Language: ja,en-us;q=0.7,en;q=0.3|Accept-Encoding: gzip,deflate|Accept-Charset: UTF-8,*|Keep-Alive: 300|Connection: keep-alive|Cache-Control: max-age=0
127.0.0.1|Fri 22 Jan 2010 23:53:13 +0900|200|2706||GET /index.php?=PHPE9568F34-D428-11d2-A769-00AA001ACF42 HTTP/1.1|Host: pana|User-Agent: Mozilla/5.0 (X11; U; Linux i686; ja-JP; rv:1.8.1.23) Gecko/20090910 SeaMonkey/1.1.18|Accept: image/png,*/*;q=0.5|Accept-Language: ja,en-us;q=0.7,en;q=0.3|Accept-Encoding: gzip,deflate|Accept-Charset: UTF-8,*|Keep-Alive: 300|Connection: keep-alive|Referer: http://pana/|Cache-Control: max-age=0
127.0.0.1|Fri 22 Jan 2010 23:53:14 +0900|200|2328||GET /index.php?=PHPE9568F35-D428-11d2-A769-00AA001ACF42 HTTP/1.1|Host: pana|User-Agent: Mozilla/5.0 (X11; U; Linux i686; ja-JP; rv:1.8.1.23) Gecko/20090910 SeaMonkey/1.1.18|Accept: image/png,*/*;q=0.5|Accept-Language: ja,en-us;q=0.7,en;q=0.3|Accept-Encoding: gzip,deflate|Accept-Charset: UTF-8,*|Keep-Alive: 300|Connection: keep-alive|Referer: http://pana/|Cache-Control: max-age=0
Hugo Leisink
22 January 2010, 18:17
I have no idea what's going on. Try a hexeditor on your configuration file and see if there are any hidden characters behind the 'Hostname=pana' line. Somehow, the hostname matching goes wrong.
kaz
23 January 2010, 02:28
I tried hiawatha.conf by hexeditor.
I copy only part of Hostname.
"." is "0A".(only behind line)
I think 'Hostname=pana' line is not strange.

VirtualHost {.Hostname = pana.WebsiteRoot = /root/httpd/hiawatha/TEST.StartFile = index.php.
kaz
23 January 2010, 04:48
I installed WebserverPuppy1(hiawatha) to another PC.
I added virtual host same as pana to original hiawatha.conf.
(I commeted "showIndex=yes")
Result was same.
Hugo Leisink
23 January 2010, 08:09
Try using pana.lan instead of just pana. Maybe the absence of a dot causes problems.
kaz
23 January 2010, 09:34
Hi!

Sorry, same result.

kaz
23 January 2010, 10:04
Changed hosts and hotname are below:

/etc/hotname
pana.lan
/etc/hosts
127.0.0.1 localhost pana.lan
192.168.1.9 pana.lan
Hugo Leisink
23 January 2010, 10:25
Try downloading Hiawatha from this site instead of using the puppy version. I really can't explain why it's not working for you. Hiawatha works fine. I run more than 30 websites on this server. Never had any problems with virtual host matching. Never heard any complaints from others.
kaz
23 January 2010, 11:02
I see.
Thank you for your advise.
kaz
23 January 2010, 13:33
I use localized puppy431.
Localized puppy431 has hiawatha-6-17-1.
So, it work fine Virtualhost. (Hostname=pana was OK)
/etc/hotname and /etc/hosts are same.

But installed LAMP-6.16-5.1.35-5.2.9 , it don't work for Virtualhost.

Hugo Leisink
23 January 2010, 14:09
Hmm, I hope those Puppy guys didn't mess with the code. Virtual host selection has always worked fine. I have no idea what's wrong with this combined LAMP version of Hiawatha.
kaz
6 February 2010, 12:34
Hello.
I tried to change various setting.
And I notice to be able to connect on VirtualHost's directory adding to index.html.

change only part of VirtualHost
Virtual host {
Hostname=pana
WebsiteRoot=/roothttpd/hiawatha/TEST
#StartFile=index.php
StartFile=index.html.
#UseFastCGI=PHP5
}

In case of using index.html with Virtual host, browser show /root/httpd/hiawatha/TEST/index.html.
But using index.php, browser show default website(/root/httpd/hiawatha/index.php).

I have no idea.
Is not there hints of resolving?
kaz
8 February 2010, 12:27
I installed webserverpuppy1(hiawatha-version).
Same result.
Hiawatha access to Virtualhost.but it seemes hiawatha don't know index.php inside VirtualHost.
I checked FastCGI.
# ps ax|grep php
6364 ? Ss 0:00 /usr/local/bin/php-cgi -b 127.0.0.1:2005 -c /etc/php. ini
6368 ? S 0:00 /usr/local/bin/php-cgi -b 127.0.0.1:2005 -c /etc/php. ini
6369 ? S 0:00 /usr/local/bin/php-cgi -b 127.0.0.1:2005 -c /etc/php. ini
6370 ? S 0:00 /usr/local/bin/php-cgi -b 127.0.0.1:2005 -c /etc/php. ini
6415 pts/0 S+ 0:00 grep php
This php-cgi is FastCGI?

kaz
8 February 2010, 14:34
I found out php-fcgi not running.
php-fcgi is /usr/sbin/php-fcgi.

How does php-fcgi run?
Hugo Leisink
8 February 2010, 21:00
php-cgi with the -b flag is indeed php running as a FastCGI daemon. php-fcgi is a tool that only starts php-cgi. It terminates after starting php-cgi.
kaz
9 February 2010, 04:53
I try webserverpuppy1(hiawatha-version).
# /usr/local/bin/php-cgi -v
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/bcmath.so' - /usr/local/lib/php/extensions/bcmath.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/bz2.so' - /usr/local/lib/php/extensions/bz2.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/calendar.so' - /usr/local/lib/php/extensions/calendar.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/ctype.so' - /usr/local/lib/php/extensions/ctype.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/curl.so' - /usr/local/lib/php/extensions/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/dba.so' - /usr/local/lib/php/extensions/dba.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/dbase.so' - /usr/local/lib/php/extensions/dbase.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/exif.so' - /usr/local/lib/php/extensions/exif.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/ftp.so' - /usr/local/lib/php/extensions/ftp.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/gettext.so' - /usr/local/lib/php/extensions/gettext.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/gd.so' - /usr/local/lib/php/extensions/gd.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/iconv.so' - /usr/local/lib/php/extensions/iconv.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/ldap.so' - /usr/local/lib/php/extensions/ldap.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/mbstring.so' - /usr/local/lib/php/extensions/mbstring.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/mysql.so' - /usr/local/lib/php/extensions/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/mysqli.so' - /usr/local/lib/php/extensions/mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/openssl.so' - /usr/local/lib/php/extensions/openssl.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/pdo.so' - /usr/local/lib/php/extensions/pdo.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/pdo_mysql.so' - /usr/local/lib/php/extensions/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0

There are many PHP Warning.

Is this normal?
Hugo Leisink
9 February 2010, 09:35
No, that's not normal. Looks like your PHP installation is messed up. Try reinstalling it.
kaz
9 February 2010, 10:35
This is webserverpuppy1(hiawatha-version).
http://browserpuppy.com/server.html

There are also same warning on LAMP-6.16-5.1.35-5.2.9(installed pet file for Localized puppy).

This is reason that Virtual not operate?
Hugo Leisink
9 February 2010, 10:42
I don't know, could be. I'm sorry I am not able to be helpful, I have no idea what goes wrong in your case. Hiawatha works, I have many servers to prove it.
Da_JoJo
9 March 2010, 02:18
you have installed php without extensions needed for the config u set it to.
does it work with plain index.html ?
LAMP is also has a auto-config for php , so if you installed it after hiawatha it probably has messed up your config.
i would suggest to install the correct packages separate (mysql,php5,hiawatha) and do a dependency check afterwards.
skip apache as it inbuild features to fix user mistakes are not a good way to learn how a webserver should behave.
it also does not comply to standard rules and is by far to complex to configure it right for security.
This topic has been closed.