Apache Server configuration support - Apache virtual hosts not resolving correctly

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > January 2007 > Apache virtual hosts not resolving correctly





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Apache virtual hosts not resolving correctly
Ninjak on FW

2007-01-11, 1:32 pm

Hello,

I'm having a problem with my Apache virtual hosts config. I'm mixing
http and https, here's my config:

NameVirtualHost *:80

<VirtualHost _default_:443>

DocumentRoot "/usr/share/squirrelmail"
ErrorLog logs/ssl_error_log
TransferLog logs/ssl_access_log
SSLEngine on
SSLCipherSuite
ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM
:+LOW:+SSLv2:+EXP
SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key
SSLCertificateChainFile /etc/httpd/conf/ssl.crt/intermediate.crt
<Files ~ "\.(cgi|shtml|phtml|php3?)$">
SSLOptions +StdEnvVars
</Files>
<Directory "/var/www/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog logs/ssl_request_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "/usr/share/timeclock"
ServerName timeclock.blahblah.com:80
</VirtualHost>



When I go to http://timeclock.blahblah.com I don't get directed to
/usr/share/timeclock, instead I get the Apache test page. I checked
permissions on the folder and files and they are fine. Any idea why
this isn't working correctly?

Giovanni

2007-01-11, 1:32 pm

Ninjak on FW wrote:

> I'm having a problem with my Apache virtual hosts config. I'm mixing
> http and https, here's my config:
>
> NameVirtualHost *:80


This directive forces the server to handle virtual hosts on port 80 only.

> <VirtualHost _default_:443>
>


Ciao
Giovanni
--
A computer is like an air conditioner,
it stops working when you open Windows.
Registered Linux user #337974 < http://giovanni.homelinux.net/ >
shimmyshack

2007-01-11, 1:32 pm


Ninjak on FW a =E9crit :
> Hello,
>
> I'm having a problem with my Apache virtual hosts config. I'm mixing
> http and https, here's my config:
>
> NameVirtualHost *:80
>
> <VirtualHost _default_:443>
>
> DocumentRoot "/usr/share/squirrelmail"
> ErrorLog logs/ssl_error_log
> TransferLog logs/ssl_access_log
> SSLEngine on
> SSLCipherSuite
> ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM
:+LOW:+SSLv2:+EXP
> SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
> SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key
> SSLCertificateChainFile /etc/httpd/conf/ssl.crt/intermediate.crt
> <Files ~ "\.(cgi|shtml|phtml|php3?)$">
> SSLOptions +StdEnvVars
> </Files>
> <Directory "/var/www/cgi-bin">
> SSLOptions +StdEnvVars
> </Directory>
> SetEnvIf User-Agent ".*MSIE.*" \
> nokeepalive ssl-unclean-shutdown \
> downgrade-1.0 force-response-1.0
> CustomLog logs/ssl_request_log \
> "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
> </VirtualHost>
>
> <VirtualHost *:80>
> DocumentRoot "/usr/share/timeclock"
> ServerName timeclock.blahblah.com:80
> </VirtualHost>
>
>
>
> When I go to http://timeclock.blahblah.com I don't get directed to
> /usr/share/timeclock, instead I get the Apache test page. I checked
> permissions on the folder and files and they are fine. Any idea why
> this isn't working correctly?


check your server name, I would put
ServerName timeclock.blahblah.com
myself.

you're probably getting the test page because no virtual host
servernames match.
Check that you are suing an HTTP/1.1 compliant user agent as well - you
must send the host name along too for apache to be able to match it.

Lew Pitcher

2007-01-11, 7:33 pm


Giovanni wrote:[vbcol=seagreen]
> Ninjak on FW wrote:
>
>
> This directive forces the server to handle virtual hosts on port 80 only.
>

In any case, port 443 is ssl http, and thus the url would have to start
with https:// not http:// as the OP had presented.

--
Lew

Phil Frisbie, Jr.

2007-01-12, 1:33 am

Ninjak on FW wrote:
> Hello,
>
> I'm having a problem with my Apache virtual hosts config. I'm mixing
> http and https, here's my config:
>
> NameVirtualHost *:80
>
> <VirtualHost _default_:443>


I hope you understand that SSL does not support virtual hosts.....

--
Phil Frisbie, Jr.
Hawk Software
http://www.hawksoft.com
Mark

2007-01-12, 1:17 pm

"Ninjak on FW" <shawnn@gmail.com> wrote in news:1168535912.432404.37390@
77g2000hsv.googlegroups.com:

> Hello,
>
> I'm having a problem with my Apache virtual hosts config. I'm mixing
> http and https, here's my config:
>
> NameVirtualHost *:80
>
> <VirtualHost _default_:443>
>
> DocumentRoot "/usr/share/squirrelmail"
> ErrorLog logs/ssl_error_log
> TransferLog logs/ssl_access_log
> SSLEngine on
> SSLCipherSuite
> ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM
:+LOW:+SSLv2:+EXP
> SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
> SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key
> SSLCertificateChainFile /etc/httpd/conf/ssl.crt/intermediate.crt
> <Files ~ "\.(cgi|shtml|phtml|php3?)$">
> SSLOptions +StdEnvVars
> </Files>
> <Directory "/var/www/cgi-bin">
> SSLOptions +StdEnvVars
> </Directory>
> SetEnvIf User-Agent ".*MSIE.*" \
> nokeepalive ssl-unclean-shutdown \
> downgrade-1.0 force-response-1.0
> CustomLog logs/ssl_request_log \
> "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
> </VirtualHost>
>
> <VirtualHost *:80>
> DocumentRoot "/usr/share/timeclock"
> ServerName timeclock.blahblah.com:80
> </VirtualHost>
>
>
>
> When I go to http://timeclock.blahblah.com I don't get directed to
> /usr/share/timeclock, instead I get the Apache test page. I checked
> permissions on the folder and files and they are fine. Any idea why
> this isn't working correctly?
>
>


Try this....


NameVirtualHost *

<VirtualHost machine-ip-address>
DocumentRoot "/usr/share/timeclock"
ServerName timeclock.blahblah.com
</VirtualHost>



And you still need a ServerName in your SSL vhost container.



----== Posted via webservertalk.com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.webservertalk.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com