Forum

Virtual Host web page not appearing

Dave Reckoning
30 May 2015, 10:05


Hiawatha version: 6.17.1
Operating System: Lucid Puppy 5
I got my dotcom website on the web using this home server (after much struggling, and much assistance from several good people including yourself). But it only displays the default page (when I'm not getting a "Service Temporarily Unavailable" page, which happens frequently) I'm trying to configure Virtual Hosts to direct to the web page I want to display, based on manual pages and instructions you have given to others, and I'm clearly missing something. I understand this is to improve security, or I would simply place my website files in the default Web-Site root folder, which would certainly work, and I'm sorely tempted to do just that. I am unclear as to what it is that makes Hiawatha distinguish whether the IP is being addressed directly or via DNS from the dotcom URL. I'm confused as to what the hostname should be-- mywebsite.com? my server's internal IP address? the local loopback IP address (127.,etc), or something else? Should a port other than port 80 be used for this, and should that port be indicated in the IP address (using the colon) entered at the DNS server? I see so many variables in the config templates that it is bewildering to me, and any advice you can offer would be much appreciated. As for the Service Temporarily Unavailable page, could that be caused by inadequate Connections settings? I merely used those I found in the template that came with my "puppy" distro. Thanks & God bless you.
Dave Reckoning
2 June 2015, 15:47
A postscript to above. I know an almost identical scenario was addressed by Klemens back on 8 Aug 2013. I have tried to adjust my config file in accordance with his advice to John Doe, but I obviously am not getting it right, as only the default host page appears when my dotcom url is entered in the browser. I have tried adding lines suggested in other posts (I remember one used a term like "force" or "enforce") but they made hiawatha quit with a syntax error, so I deleted them. It is so close to working, but obviously I'm missing something. Thanks & God bless you.
Hugo Leisink
2 June 2015, 15:55
First, sorry for long delay. I must have missed your first post.

The hostname in the Hiawatha configuation must match the hostname of the complete URL that will be used in the browser. So, if you are the owner of the domain example.com and you want to have a website at the http://mysite.example.com/, then 'mysite.example.com' must be the hostname. Port numbers, HTTP / HTTPS and files within your website are all irrelevant in this case.

Finally, make sure that that hostname resolves correctly to the IP address of your webserver.
Dave Reckoning
2 June 2015, 22:30
That much I seem to have right. My server is found and the dummy page in my default host directory displays on the web. My problem is how to get the index.htm page in my virtual host directory to display. Or is there not a real security problem with simply placing all my website files in the default host directory and forgetting about virtual host?

Thanks again and God bless you.
Hugo Leisink
3 June 2015, 11:43
Can you reach that file if you explicitly specify it in the URL? If so, simply use the StartFile option to let Hiawatha know which file to use if none was specified in the URL.
Dave Reckoning
3 June 2015, 18:10
I'm not sure how to specify the file in the URL. I get the idea that domain name and my external and internal IP addresses are all URLs. My domain name resolves to my external IP address. I paste below the relevant portion of the config file, substituting <descriptions> for my actual IP addresses.
Binding {
Port = 80
# Interface = 127.0.0.1
}

Hostname = www.rosarygraphics.com
WebsiteRoot = /root/Web-Server
StartFile = index.html
AccessLogfile = /var/log/hiawatha/access.log
ErrorLogfile = /var/log/hiawatha/error.log
#ErrorHandler = 404:/error.cgi

# VIRTUAL HOSTS
# Use a VirtualHost section to declare the websites you want to host.
#
VirtualHost {
Hostname = www.rosarygraphics.com, *.rosarygraphics.com, <my external IP>, <server internal IP>
WebsiteRoot = /root/Web-Server/RGWeb
StartFile = index.htm
AccessLogfile = /root/Web-Server/RGWeb/log/access.log
ErrorLogfile = /root/Web-Server/RGWeb/log/error.log
# ExecuteCGI = yes
# FastCGI = PHP4
}

Note that the location of the start file I want to display on the web is in a directory within the directory containing the dummy page. What am I missing?
Dave Reckoning
3 June 2015, 18:42
Another postscript. Trying different combinations of specifying file in URL, I came up with a URL which, when typed into the browser, brings up the desired file. It is: http://www.rosarygraphics.com/RGWeb/index.html
How to get the config file to express this?
Dave Reckoning
3 June 2015, 18:53
Well, I found one error. I had the virtual host start file identified in the config file as "index.htm" instead of "index.html". This has been corrected. But still not displaying correct page on web.
Hugo Leisink
3 June 2015, 19:44
Can you show me your complete configuration file?
Dave Reckoning
3 June 2015, 19:49
I've been tweaking it, without changing the outcome. Here is is as it stands right now:
ServerId = webuser
ConnectionsTotal = 150
ConnectionsPerIP = 10
SystemLogfile = /var/log/hiawatha/system.log
GarbageLogfile = /var/log/hiawatha/garbage.log

Binding {
Port = 80
# Interface = 127.0.0.1
}

Hostname = www.rosarygraphics.com
WebsiteRoot = /root/Web-Server
StartFile = index.html
AccessLogfile = /var/log/hiawatha/access.log
ErrorLogfile = /var/log/hiawatha/error.log
#ErrorHandler = 404:/error.cgi

# VIRTUAL HOSTS
# Use a VirtualHost section to declare the websites you want to host.
#
VirtualHost {
Hostname = www.rosarygraphics.com
WebsiteRoot = /root/Web-Server/RGWeb
StartFile = index.html
AccessLogfile = /root/Web-Server/RGWeb/log/access.log
ErrorLogfile = /root/Web-Server/RGWeb/log/error.log
# ExecuteCGI = yes
# FastCGI = PHP4
}

#add this stuff to get a perl script working (pplog)...
#QUISP has a binary executable CGI named 'quisp.bin'...
MimetypeConfig = /etc/hiawatha/mimetype.conf
#CGIhandler = /usr/bin/perl:pl
#CGIextension = pl,bin
#ExecuteCGI = yes
#QUISP puts %0D, %0A (carriage-return, line-feed) chars in the url
#(v128), to allow chars below ascii 32 need this...
SecureURL = no
Hugo Leisink
3 June 2015, 19:51
The problem is that you specified the same hostname for a virtual host and the default host. Replace the hostname of the default host with your IP address.
Dave Reckoning
3 June 2015, 20:05
I substituted first my external Ip, then my internal ip address. Still the dummy page displaying.
Hugo Leisink
3 June 2015, 20:08
When I get www.rosarygraphics.com, I see a website. Not a dummy page. Perhaps something else is going wrong.
Dave Reckoning
3 June 2015, 20:16
If the website says the Fax is out of order, it's the dummy page (I think I don't have the concept of that right.) If there are a series of blue buttons with white text linking to other pages, it is the real website.
Hugo Leisink
3 June 2015, 20:19
I see the real website.
Dave Reckoning
3 June 2015, 20:24
OK. Thanks much. I guess there are issues with viewing from computers on the same internet connection! I think that works itself out in time. Thanks for taking the time to help get it straightened out. May God bless you and yours.
Dave Reckoning
3 June 2015, 20:39
Postscript again. A friend of mine in town here reports seeing the dummy page (the one without the line of button links). That is the one I still see as well. I'm ready to go bonkers.
Hugo Leisink
3 June 2015, 20:47
This is what I see:

(image removed)
Dave Reckoning
3 June 2015, 20:51
That is the dummy page. Sorry to be so confusing. The one I'm targeting has a line of blue link buttons beneath the logo.
Hugo Leisink
3 June 2015, 20:55
Make your config like this:

...
Hostname = <external IP-address>
...

VirtualHost {
Hostname = www.rosarygraphics.com, *.rosarygraphics.com
...

Make sure www.rosarygraphics.com resolves to the right IP-address!
Dave Reckoning
3 June 2015, 20:58
Done. Not picking up any change on this end.
Hugo Leisink
3 June 2015, 21:00
Did you restart Hiawatha after every config change?
Dave Reckoning
3 June 2015, 21:04
I restarted puppyos each time. I presume that will restart hiawatha
Hugo Leisink
3 June 2015, 21:05
Are you sure you are working on the right machine? You can test by adding a text file with a random text to your website and see if you can request it via the browser.
Dave Reckoning
3 June 2015, 21:11
I typed in my firefox browser "www.rosarygraphics.com/testindex.html", to call up my original dummy page which I renamed and kept in the same folder. It came up (Congratulations, etc)
Hugo Leisink
3 June 2015, 21:18
Are you sure Hiawatha reads the right configuration file? /etc/hiawatha or /usr/local/etc/hiawatha?

What is the output of "strings /usr/sbin/hiawatha | grep etc" ?
Dave Reckoning
3 June 2015, 21:22
/etc/hiawatha
That is the location of hiawatha.conf, which is the file I have been working on, and copying/pasting to this forum.
Hugo Leisink
3 June 2015, 21:26
Weird. I think I'm out of options now... I have no idea what goes wrong.
Dave Reckoning
3 June 2015, 21:27
There is no hiawatha directory at /usr/local/etc/
Dave Reckoning
3 June 2015, 21:34
Now I'm really scared. Guess I need a workaround. Should I create the blank dummy page, name it "start.html" and place it in my RGWeb directory, designating it as default start page, and see if that works, or is that too risky a fix?
Hugo Leisink
3 June 2015, 22:21
I'm very curious about what goes wrong here. If you trust me, you could give me a login so I can see for myself what goes wrong. My public SSH key is
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDFJhDfiizNtXkqOdspaEuStwL2JWAVTmBuQfrpf0+x5CpqN9Yi0moFcTXyKMraFiPEtNSvFSCe079hQvCTzEnKhzR2Jvbt8bgA43dsJz/vkCHcj/M7XIj2Ds1clfEHTZQHOyyeieF3ofnB9pNLx5nldYQnENu7kes8we6nsvH/jPxx63Khb2j19Fl7vb9sTyASj++k+nh5ftUnn1c6O/Y8r7jFQBnuV7cCnAjvvEuQ/u6bLdGCiq7HXrBt/lSwqG8f0sqnP17cCEZh+Lq0gGYlenwWweVcRPzqGkcB8HzlQS2in54I+b1JRCiVqJtm2cuVPXIjzt4wzmEXsb8dXNU5 hugo@leisink.net
Dave Reckoning
3 June 2015, 22:53
I'm willing to give it a try, especially if it will help in the development of good tools. But this is totally new territory for me. I'm not sure how to go about giving you a log-in, or what an SSH public key is, or what one does with it. Can you walk me through it?
Hugo Leisink
3 June 2015, 23:02
Create a normal system account named 'hugo'. Within its homedirectory, create the file .ssh/authorized_keys (make sure the directory and the file are owned by the user hugo) and place my public SSH key in it. Make sure it has access rights rw------- (chmod 600 authorized_keys). Also give me sudo rights (this will give me root access to your machine, so only do this if you really want this) by adding "hugo ALL=(ALL:ALL) ALL" to /etc/sudoers. Make sure my IP (141.138.201.249) has access to your machine at port 22.
Dave Reckoning
3 June 2015, 23:35
I'm afraid this is very embarrassing. It all sounds like stuff I need to know how to do. Of all the above, I think I can open port 22 on the router. It only just occurred to me that I have not yet used ftp to upload files to my website folder. I copied them there directly from a flash drive plugged into my server's USB port.

I just now used filezilla to attempt uploading a small file to the server from another machine, www.rosarygraphics.com, via port 21. Filezilla sent back some interesting info, indicating, among other things, that any password will work, and "only anonymous ftp is allowed here". At any rate, it showed me a directory (not the one I expected) and I uploaded the file to it. I then located the file on the server in /root/ftpd directory. What I am guessing is that just about anyone with some knowledge of these things could get in there the way it is set up right now. Obviously that needs to be fixed, or some hacker could fill my hard drive with useless junk. I used username "rosarygraphics" to get in. I imagine this post should be redacted. maybe this should be carried on via e-mail? graphics73@yahoo.com is mine.
Dave Reckoning
4 June 2015, 00:45
22 is open. There is no sensitive financial data on this server. If I do not hear from you soon I have an alternative yet that I can try.
Erik S
4 June 2015, 15:26
In Puppy Linux Lucid 5.2.8 the FTP server built in is set up for user "root" and will land in directory /root
Have you checked that /root/Web=Server ownership is for webuser? Originally the Hiawatha is set up to run the PERL Blog script in Puppy Linux Lucid 5.2.8 which resides in /root/Web-Server/blog. I usually use chown -R webuser:webgroup Web-Server in a terminal opened in /root to make sure.

Begin by changing the default Hostname = www.rosarygraphics.com to Hostname = 127.0.0.1
the rest of your config looks okay for this setup.

Here is a link to the Puppy Linux forum which has many times helped me. The community is friendly and patient and there is a wealth of information. http://murga-linux.com/puppy/index.php

upgrading Hiawatha in Puppy Linux is very easy. rename your hiawatha.conf file in /etc/hiawatha.....then click on the Debian package version https://files.tuxhelp.org/hiawatha/hiawatha_9.13_i386.deb

Puppy will install it. Then modify the new hiawatha.conf from your renamed one.

restart Hiawatha in a terminal with
#killall hiawatha
#hiawatha

OR
#/etc/init.d/hiawatha restart
If you need more help getting it going let me know.
I use Puppy Linux Tahr 6.03 CE and Hiawatha 9.12 php5-fpm or php5 and MySQL with inadyn to sync my IP to an alias domain name. Tahr is the successor to Puppy Linux Lucid.

there is an adduser function using the terminal to be able to add hugo as a user. Puppy is built mainly as a single user system so it can be a little tricky.

I have had huge success running Hiawatha as a webserver running Puppy Linux.
Erik S
4 June 2015, 15:36
http://wormgear.us.to/info.php
to see an example of Hiawatha running under Puppy Linux.
Dave Reckoning
4 June 2015, 16:29
Erik, Thanks for the input. I am running Lucid Puppy 5.0. I tried some later versions and had problems with lack of compatible video drivers. Hard to use when you can't see the display. I typed "chown -R webuser:webgroup" into the console, and the output read "BusyBox v1.15.0.svn (2009-07-25 18:23;53 GMT-8) multi-call binary", followed by some hints about usage that are beyond the current scope of my understanding as far as implementation is concerned. For example, I see that -R means "recurse directories", but I have no idea what that means. Unfortunately the console does not support copy/paste, or I'd paste the whole output here. And I can't figure out how to paste a screenshot here, even though Hugo did that yesterday. Anyway, I seem to remember reading somewhere that if you're using puppy, you're running it as root. Its console does not even recognize "sudo" as a valid command. I don't know if the above is useful to the discussion, but I'm going to break for 30 or 40 minutes now.
Erik S
4 June 2015, 18:05
That is correct that sudo is not present. Since Puppy runs at root there is no SUDO as in other distros of Linux per say.

To copy and paste from the terminal highlight the text with the mouse using the left mouse button. then press the middle mouse button (the wheel on mine)to paste it. Play around with it you will see how it works.

Open the ROX filer. in the ROX filer window right click the mouse and in the menu find Window > Terminal Here
then type at the terminal prompt # chown -R webuser:webgroup Web-Server
yes the -R is recursive which means that the command will be done on the Web-Server directory AND all the sub-directories and files in /Web-Server
Dave Reckoning
4 June 2015, 19:20
Press wheel to paste. I'll try to remember that. Done. No response. Was there supposed to be, or was that supposed to have solved a problem?
Erik S
4 June 2015, 19:58
just a # after the command? is correct That indicates that it worked. by entering in the terminal

#ls -l
you can see the permissions and ownership of the directories and files.
did you change the default hostname to 127.0.0.1?
Your config is pretty simple did you clear your browser cache?
restart the server .....does it work?
Dave Reckoning
4 June 2015, 20:18
ls -l does seem to list Web-Server as owner. I changed default hostname per your suggestion. I'm not clear as to the reason for this. I then saved the change and restarted puppy. I accessed Internet with my i-pad, typed www.rosarygraphics.com, and got my dummy page (without the line of button links) In other words, no change. Hugo thought I should have my external IP for defult hostname. It really seems to make zero difference what I put there!
Dave Reckoning
4 June 2015, 21:21
I'd also like to add the reminder that if I add "/RGWeb/" to my domain name URL in the browser, the correct page appears, with links that work perfectly. All I am trying to get Hiawatha's Virtual Host to do is to point to this subdirectory.
Erik S
4 June 2015, 21:50
If you change WebsiteRoot = /root/Web-Server to /root/Web-Server/RGWeb in the default section of the conf file does it work?
when I go to your URL http://www.rosarygraphics.com/ I see a page with Rosary Graphics welcome page.
Dave Reckoning
4 June 2015, 21:59
I have not tried this, but have no doubt that it would work. If the page you are viewing lacks a line of blue link buttons, and contains a message about FAX being out of order, it's my dummy page. to see the "real" one, add "/RGWeb/" to the URL in the browser.
Erik S
4 June 2015, 22:23
yes I see both page and the site now. Definitely try changing the default WebsiteRoot. If this works then your VirtualHost block is not functioning in the conf file.
Dave Reckoning
4 June 2015, 22:28
Erik- Under the rule, "Never assume anything", I figured I'd better try your suggestion, i.e. insert "/RGWeb" in the path under Default Host. I'm still getting the dummy page. This leaves a perplexing question: What IS pointing the DNS server to this folder on this computer? Is there a command I can type into the Console to tell me what Hiawatha is reading? There are other config files in hiawatha's folder, but only one "hiawatha.conf".
Dave Reckoning
4 June 2015, 22:39
I should also add that "hiawatha.conf" looks different in Geany's interface from the others. The others are plain black text, whereas the hiawatha.conf file displays blue text before the = sign, and red text after, as if this file was seen differently by the OS.
Dave Reckoning
4 June 2015, 22:46
I figured out this on my own using hiawatha -k in the console. It claims to be following the configuration in /etc/hiawatha/hiawatha.conf, the only file I have been messing with these last weeks. The question remains what is keeping Hiawatha from pointing to the directory its config file tells it to point to?
Dave Reckoning
4 June 2015, 23:54
Just letting you know I fixed the problem. Unfortunately, my 3 efforts at explaining what I did have all been seen as "spam", and I cannot figure out why. My question: Is "killall" and restarting in the Console somehow a more effective method for restarting hiawatha than re-starting the OS? If so, why? Apart from that, this issue appears to be solved. Thanks much for your help and patience. God bless you.
Erik S
5 June 2015, 02:45
Your welcome. I hope I helped somewhat. I think starting / stopping / restarting Hiawatha with #killall hiawatha and #hiawatha
OR /etc/inid.t/hiawatha start |stop | restart saves having to reboot the entire system and directly controls hiawatha, with out having to restart or reset any other programs/scripts. Otherwise your method works as well.
Dave Reckoning
5 June 2015, 03:59
Except it didn't work as well, and I think I figured out why. It turns out that what I was restarting was what the main puppy menu calls "X server". I'm guessing that is merely the GUI that supports the window manager. So hard to get used to this world of Linux, though I like it better the more I use it. Anyway, I'm guessing that Hiawatha, which starts by a command line only, is not dependent on, or affected much by, the "X server". Does this sound like a logical explanation? I hope so, even if it emphasizes my ignorance. Sounds like an issue to stress with us puppy users. Thanks much again, to you and to Hugo. I think I still might have security issues to deal with,, but probably not here and now.
Erik S
5 June 2015, 16:00
That makes sense. You were not actually rebooting the system, but only graphic interface! Puppy Linux can run completely from the command line without any GUI. So the changes to the conf never came into effect. Hiawatha will start at power up or a complete reboot. Hiawatha will not be effected by an X server restart. Your simple conf does not seem to pose many security issues. You do not seem to have any CGI activated and serve up HTML pages only. Turn off the FTP server. No databases and Hiawatha is not running as root. This server setup probably will run very stable. Good Luck and may the road rise with you.
Hugo Leisink
5 June 2015, 16:01
Lol! That makes indeed a lot of sense. I knew there had to be some silly reason for all of this. I simply couldn't figure out what. Hope it all works now!
Dave Reckoning
6 June 2015, 04:10
It works as perfectly as it can on my bandwidth. I can get that increased as needed. Thank you both again. Much obliged. I'll go ahead and close the ftp port and just let it run till it wears out the server PC. There are more where that came from, and not really so difficult to set up. I have also added a line to my home page indicating the web site is utilizing Hiawatha. God bless you again.
This topic has been closed.