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've got a problem : I've got a dedicated server where I use three different domain names and php. Now, I've got a new website that I developped with asp.net. I installed mono, mod_mono and transfered my assembly inside /var/www/mysite

My problem comes up when I try to access my website. I tried IpAdress/mysite/ but it just gives the three and if I want "IpAddress/mysite/Controller1/Action1" it says 404.

As I said my server is apache and is used with php websites which has several domain names. As one of those domain name can be used for my own website, I tried to create a subdomain name let's say mysite.maindomain.com Here is the content of the file /etc/apache/sites-enabled/mysite.maindomain.com

 <VirtualHost *:80>
    ServerName mysite.maindomain.com
    ServerAdmin web-admin@mysite
    DocumentRoot /var/www/mysite

    MonoServerPath sousdomaine.domaineprincipal.com "/usr/bin/mod-mono-server2"
    MonoSetEnv mysite.maindomain.com MONO_IOMAP=all


    MonoApplications mysite.maindomain.com "/:/var/www/mysite"
    <Location "/">
      Allow from all
      Order allow,deny
      MonoSetServerAlias mysite.maindomain.com
      SetHandler mono
      SetOutputFilter DEFLATE
      SetEnvIfNoCase Request_URI "\.(?:gif|jpe?g|png)$" no-gzip dont-vary
    </Location>
    <IfModule mod_deflate.c>
      AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript
    </IfModule>
  </VirtualHost>

When I call mysite.maindomain.com it says "137 ERR_NAME_RESOLUTION_FAILED"

What configuration must I give to make mysite.maindomain.com or IpAdress/mysite/ work?

Edit

I tried to change the vhost configuration by putting a maindomain.com instead of the * Then I also ran : nslookup mysite.maindomain.com and got

Server:         127.0.0.1
Address:        127.0.0.1#53
** server can't find mysite.maindomain.com: NXDOMAIN 

dig ciiarena.guildwars2-rage.com and got :

; <<>> DiG 9.7.3 <<>> mysite.maindomain.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 10196
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;mysite.maindomain.com.  IN      A

;; AUTHORITY SECTION:
maindomain.com.    9588    IN      SOA     a.dns.gandi.net. hostmaster.gandi.net.1342214675 10800 3600 604800 10800

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Thu Dec 27 17:21:05 2012
;; MSG SIZE  rcvd: 108

after a wget mysite.maindomain.com I get nothing on error.log. As a matter of fact the wget I tried on the server leads to a 302 redirection to another domain than maindomain.

share|improve this question
    
On the Apache server can you do a: dig mysite.maindomain.com also a: nslookup mysite.maindomain.com, if they resolve, try a : wget http: //mysite.maindomain.com/ (if no wget, try a curl, or failing that: telnet mysite.maindomain.com 80, then enter: GET /), and have a look at the output or tail /var/log/(httpd|apache2)/error*.log –  arober11 Dec 27 '12 at 15:53
    
nslookup says "server can't find mysite.maindomain.com –  artragis Dec 27 '12 at 16:05
    
Quick fix, add an entry to the local /etc/hosts file e.g. 127.0.0.1 xxxxxx.yyyyy.zzzzzz –  arober11 Dec 27 '12 at 16:32
    
127.0.0.1? and it will be ok from my browser? –  artragis Dec 27 '12 at 16:33
    
Possibly, if the host name wasn't resolving locally you'd likely see a browser error along the lines of: Oops! Google Chrome could not find mysite.maindomain.com –  arober11 Dec 27 '12 at 16:43

1 Answer 1

up vote 1 down vote accepted

Reviewing your questions and comments, I notice a number of things. But first, most importantly: This is a DNS issue.

  • Check your DNS server and make sure that you have an A record setup for this particular subdomain.
  • In the comments, when it was suggested to add 127.0.0.1 to your /etc/hosts file, that should have been done on the server, not on the client computer. Did you edit the /etc/hosts file on the server or on a workstation / client? If not the server, go back and fix it.
  • When you are sure that your DNS issues are resolved, if you're still having issues, then make sure you include the subdomain's vhost configuration in Apache in the SAME file as your primary domain. But when you do, make sure to put the subdomain's vhost above the primary domain's vhost container.

Good luck.

share|improve this answer
    
this was effectively a DNS issue. Checking with my friends, the one who registered the subname misspelled it. I accept your answer and wish you an happy new year –  artragis Jan 6 '13 at 8:55

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.