Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I was configuring a VPS with Apache2, MySQL, PHP. The Main site is working fine. Then i went to create a webmail with a Subdomain. Whenever someone browse webmail.mydomain.com he or she should have the webmail login screen. I created another Virtual Host and enabled it via a2ensite. Then Reloaded Apache. Meanwhile, I thought it would be good to restart apache, so i restarted it, But it wasn't restarting. Then I disabled the webmail virtualhost, and everything works fine !!!

Here is my original Virtual host file for Main site,

    <VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName www.mydomain.com
    ServerAlias mydomain.com www.mydomain.com
    DirectoryIndex index.html, index.php
    DocumentRoot /sites/bswapit

    LogLevel warn
    ErrorLog  /sites/bswapit/log/error.log
    CustomLog /sites/bswapit/log/access.log combined
    <Directory />
            Options FollowSymLinks
            AllowOverride ALL
    </Directory>
    <Directory /sites/bswapit/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
    </Directory>

    AccessFileName .htaccess

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
            AllowOverride None
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all

    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined
    </VirtualHost>

And Here is the Virtualhost i Created for Webmail,

    <VirtualHost *:7640>
    ServerAdmin webmaster@localhost
    ServerName webmail.mydomain.com
    ServerAlias webmail.mydomain.com
    DirectoryIndex index.html, index.php
    DocumentRoot /sites/webmail/mail

    LogLevel warn
    ErrorLog  /sites/webmail/log/error.log
    CustomLog /sites/webmail/log/access.log combined
    <Directory />
            Options FollowSymLinks
            AllowOverride ALL
    </Directory>
    <Directory /sites/webmail/mail/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all

    </Directory>

    AccessFileName .htaccess

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
            AllowOverride None
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined
    </VirtualHost>

I pointed my main domain using A Record, and then pointed the subdomain webmail.mydomain.com using A Record. But whenever i am Browsing through that subdomain, its not working !

I am pretty Confuse whether apache is reloading with service apache2 reload its showing okey, But its not working and i can't dare to restart the server. Anybody?

share|improve this question
    
Any virtual hosts should be placed above the default or else they'll never be used. –  Nathan C Feb 18 at 16:22
    
I deleted the Original Default Virtualhost file and created two for my own ! –  Oritro Ahmed Feb 18 at 16:23
    
Where does webmail.domain.com:7640 bring you? Be sure to include the port. –  Nathan C Feb 18 at 16:23
    
Nowhere, Browser can't find server for that subdomain ! I tried including the port ! –  Oritro Ahmed Feb 18 at 16:27
    
That means it's a DNS problem. What does nslookup webmail.domain.com put out? If not found, then that means the A record isn't being found. –  Nathan C Feb 18 at 16:28

1 Answer 1

up vote 2 down vote accepted

First, double-check your DNS settings to ensure they're correct. If it's not resolving, ensure that it can't be reached by multiple nameservers (try nslookup webmail.mydomain.com 8.8.4.4 for Google's nameservers) or use an online tool to check to see if it's reachable.

Otherwise, depending on your host you may be able to troubleshoot that way or contact technical support for your host to see if they can assist. At this point, it's a DNS problem and not Apache causing your problem.

share|improve this answer
    
Well, Which Google DNS, Its showing the IP Correct ! That mean, its my DNS problem? –  Oritro Ahmed Feb 18 at 16:37
    
That just means it hasn't replicated to whatever your computer's DNS is set to. Give it a few hours and try again. Or, if Windows, try ipconfig /flushdns. –  Nathan C Feb 18 at 16:38
    
By the way, pingdom is showing Not enough nameserver information was found to test the zone webmail.*******.com, but an IP address lookup succeeded in spite of that. –  Oritro Ahmed Feb 18 at 16:39
    
Not really sure what that entails, but probably because there's only one nameserver for your domain. I'd just wait a few hours and see if it works then. :) –  Nathan C Feb 18 at 16:41
    
Well, Thanks for your Help. I will check back in a few hour. –  Oritro Ahmed Feb 18 at 16:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.