Apache virtual hosts problem
Apache2 in Slackware 12 refuses to work for me. I have a file /etc/koha-httpd.conf with virtual host definitions like this:
Code:
<VirtualHost koha.xxx:80> All I get is the apache test-page annoyingly saying "It works!", although it obviously doesn't. I've done several Koha installations (Koha is an open source library system http://www.koha.org), and I clearly remember it being able to do more than just say "It works!" :P Oh yes, and I have Listen 80 and Listen 8080 in httpd.conf too. Anyone got any ideas on why it doesn't work? |
Do you have virtual hosts enabled with the following?
Code:
NameVirtualHost *:80 |
Quote:
Code:
NameVirtualHost koha.xxx:80 Code:
NameVirtualHost *:80 Then if I change the existing <VirtualHost> definitions to: Code:
<VirtualHost *:80> The only thing that draws my attention in apache's error_log is this: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName As you see from my original posting, there actually are ServerName definitions in VirtualHosts... At one point I tried addind a line that says: Code:
ServerName koha.xxx Koha's logs in /usr/local/koha/logs are all empty. Oh, and I've also tried using the ip-address of the server in VirtualHost definitions instead of it's name, but that doesn't work either. |
I don't think you need the :80 or :8080 on the end of the ServerName values. That may be why it's unable to determine the server's name.
There may be other differences between version 1.3 and 2.0 - have you had a look at the Apache docs at http://httpd.apache.org/docs/2.0/vhosts/? |
If I remove the port numbers from ServerName (i.e. :80 and :8080), I get "Forbidden - You don't have permission to access / on this server." instead of "It works!". The access_log says:
xxx.xxx.xxx.xxx - - [29/Jan/2008:18:17:57 -0600] "GET / HTTP/1.1" 200 44 xxx.xxx.xxx.xxx - - [29/Jan/2008:18:18:01 -0600] "GET / HTTP/1.1" 304 - xxx.xxx.xxx.xxx - - [29/Jan/2008:18:18:05 -0600] "GET / HTTP/1.1" 200 44 koha-httpd.conf is actually generated automatically by koha's installer and it should work fine with apache2. Could the virtualhost problem be caused by the fact that this is actually a virtual server? |
It shouldn't matter that you're running on a virtual server. All that needs to happen is that a DNS server resolves the host name to your IP address so that a browser gets to your IP address with a request for one of your virtual hosts.
Once it's there Apache doesn't care how (there are some exceptions, but the Apache docs aren't specific on this). It just checks its virtual hosts config for a matching server name and serves up the content. Have you tried something like this? Code:
NameVirtualHost * |
No luck, I get:
[Tue Jan 29 20:42:20 2008] [error] VirtualHost *:8080 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results [Tue Jan 29 20:42:20 2008] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results It seems to me that Apache is simply refusing to believe the DocumentRoot (and/or Redirect) directives inside the VirtualHosts. |
Edit your virtual host file like the following:
Code:
<VirtualHost koha.xxx:80> Code:
. Code:
. Give it a try, and see if it works. GL P.S. Don't forget to add another Listen entry to the httpd.conf file so that apache can listen on port 8080 (i.e. Listen 8080) |
Still I only get "It works!". Nothing chaged. The Listen directive for port 8080 has been there all the time. This is really starting annoy me, Exactly how complicated does this has to be. It's a webserver, I'm not trying to run a nuclear power plant or anything like that...
--edit--- Progress! Changing the VirtualHost entries from <VirtualHost koha.xxx:80> to <VirtualHost *:80> along with the matching NameVirtualHost lines and <Directory> entries in VirtualHosts displays "Welcome to Koha!" and then this: Forbidden You don't have permission to access /cgi-bin/koha/opac-main.pl on this server. So obviously the script alias is not working now... How can that be fixed? --edit-- Adding another <Directory> entry to <VirtualHost> does the trick: Code:
<Directory "/usr/local/koha/opac/cgi-bin"> Code:
<VirtualHost *:80> |
Thanks for posting the changes you had to make to get it working :)
|
Hello
I saw this tutorial, and I did it step by step but I got this error message: This page isn’t working.Website didn’t send any data. ERR_EMPTY_RESPONSE Log file is: client denied by server configuration: I checked my folder and file permissions how can I resolve that? ( this problem really tired me ) |
this is 12 years thread. Why not make a new one?
|
All times are GMT -5. The time now is 04:40 PM. |