Networking Forums  

Go Back   Networking Forums > Networking Newsgroups > Linux Networking

Apache virtual hosts not resolving correctly

Reply
 
Thread Tools Display Modes
  #1  
Old 01-11-2007, 05:18 PM
Default Apache virtual hosts not resolving correctly



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:+SSL v2:+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?



Ninjak on FW
Reply With Quote
  #2  
Old 01-11-2007, 05:51 PM
Giovanni
Guest
 
Posts: n/a
Default Re: Apache virtual hosts not resolving correctly

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/ >
Reply With Quote
  #3  
Old 01-11-2007, 05:51 PM
shimmyshack
Guest
 
Posts: n/a
Default Re: Apache virtual hosts not resolving correctly


Ninjak on FW a écrit :
> 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:+SSL v2:+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.

Reply With Quote
  #4  
Old 01-11-2007, 08:31 PM
Lew Pitcher
Guest
 
Posts: n/a
Default Re: Apache virtual hosts not resolving correctly


Giovanni wrote:
> 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>


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

Reply With Quote
  #5  
Old 01-12-2007, 02:03 AM
Phil Frisbie, Jr.
Guest
 
Posts: n/a
Default Re: Apache virtual hosts not resolving correctly

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
Reply With Quote
  #6  
Old 01-12-2007, 01:56 PM
Mark
Guest
 
Posts: n/a
Default Re: Apache virtual hosts not resolving correctly

"Ninjak on FW" <(E-Mail Removed)> 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:+SSL v2:+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 Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Reply With Quote
Reply

Tags
apache, correctly, hosts, resolving, virtual

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


All times are GMT. The time now is 02:10 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.