Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running an apache webserver for a while now with a secure server. All traffic was rerouted to https://first.some.com (example names). Now I want to add a second site for testing purposes on the same server called http://second.some.com (no ssl for that one). My vhost.conf is below and is rerouting everything, even second.some.com, to https://first.some.com. What is wrong with my conf???

NameVirtualHost *:80
<VirtualHost *:80>
    ServerName first.some.com
    DocumentRoot /var/www-first/
    Redirect permanent / https://first.some.com/
</VirtualHost>
<VirtualHost *:80>
    ServerName second.some.com
    DocumentRoot /var/www-second/
    DirectoryIndex index.html index.php
</VirtualHost>

NameVirtualHost *:443
<VirtualHost *:443>
    ServerName first.some.com
    DocumentRoot /var/www-first/
    DirectoryIndex index.html index.php
    SSLEngine on
    SSLProtocol all -SSLv2
    SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
    SSLCertificateFile /etc/pki/tls/certs/first.some.com.crt
    SSLCertificateKeyFile /etc/pki/tls/private/first.some.com.key.nopass
    SSLCertificateChainFile /etc/pki/tls/certs/intermediate.crt
</VirtualHost>
share|improve this question

migrated from stackoverflow.com May 8 '13 at 6:30

This question came from our site for professional and enthusiast programmers.

    
Anyone out there who can help me? I thought I understood virtual hosting, but I'm really stuck here. Any suggestions are welcome. – Martijn Burger May 8 '13 at 13:22
    
Hmmm. Still looking for an answer. Anyone out there can spot the error???? – Martijn Burger May 16 '13 at 13:59
up vote 0 down vote accepted

Okay. Nothing wrong with this apache config. The www-first and www-second were rerouting to the right application after all. It was just that it was running the same application which both looked at the same database.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .