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.
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.
Check more discussion of this question.