logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Subdomain pointing to base domain
Author
ticketstub



Joined: 07 Jun 2013
Posts: 2

PostPosted: Fri 07 Jun '13 19:29    Post subject: Subdomain pointing to base domain Reply with quote

Switched from NGINX to Apache2 and now having challenge getting my subdomain s to work properly. Everything worked fine w/ NGINX - so I don't think this is related to my DNS or hosts file setup.

PROBLEM: Calls to dev.domain-name.org are going to www.domain-name.org.

I have tried many different changes to the conf files... NameVirtualHost changes, VirtualHost changes... I can't count how many times I have restarted Apache now. Smile

Here is my setup:

ports.conf
-----------
Listen 80
Listen 443
NameVirtualHost 96.126.xxx.xxx:443 (xxx'd out for privacy on forum)
NameVirtualHost *:80


within sites-available and activated and linked in sites-enabled:
----------------
<VirtualHost *:80>
ServerName dev.domain-name.org
DocumentRoot /srv/www/dev.domain-name.org/public_html/
ErrorLog /srv/www/dev.domain-name.org/logs/apache-error.log
CustomLog /srv/www/dev.domain-name.org/logs/apache-access.log combined
</VirtualHost>

<VirtualHost *:80>
ServerAdmin contact@domain-name.org
ServerName www.domain-name.org
ServerAlias domain-name.org
DocumentRoot /srv/www/domain-name.org/public_html/
ErrorLog /srv/www/domain-name.org/logs/apache-error.log
CustomLog /srv/www/domain-name.org/logs/apache-access.log combined
</VirtualHost>

<VirtualHost *:80>
ServerAdmin contact@domain-name.org
ServerName www.domain-name.com
ServerAlias domain-name.com
DocumentRoot /srv/www/domain-name.org/public_html/
ErrorLog /srv/www/domain-name.org/logs/apache-error.log
CustomLog /srv/www/domain-name.org/logs/apache-access.log combined
</VirtualHost>


<VirtualHost 96.126.xxx.xxx:443>
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/domain-name.org.crt
SSLCertificateKeyFile /etc/apache2/ssl/domain-name.org.key
SSLCACertificateFile /etc/apache2/ssl/gd_bundle.crt

ServerAdmin contact@domain-name.org
ServerName www.domain-name.org
DocumentRoot /srv/www/domain-name.org/public_html/
ErrorLog /srv/www/domain-name.org/logs/apache-error.log
CustomLog /srv/www/domain-name.org/logs/apache-access.log combined
</VirtualHost>


Any ideas?
Back to top
ticketstub



Joined: 07 Jun 2013
Posts: 2

PostPosted: Fri 07 Jun '13 19:39    Post subject: .htaccess Reply with quote

DUH!

Checked my .htaccess file and it was re-writing to the www. instead of dev.

Stupid me.
Back to top


Reply to topic   Topic: Subdomain pointing to base domain View previous topic :: View next topic
Post new topic   Forum Index -> Apache