How to create subdomain in IIS6 - iis-6

I'm quite new to the configuration of domains and subdomains.
I already have a subdomain "bar" that belongs to the domain "www.foo.es". When I want to access to the subdomain I just have to type "www.foo.es/bar", everything is alright so far.
What I intend to do is that the subdominion is accessed typing "bar.foo.es".
I've tried some things I found online but none of them worked. Could you tell me how to do this or at least give me some clues or tutorials that actually work?
I'm trying to set all up using the IIS6 properties (not dynamically, as it is not a user thing, just a subdomain that I want to access "directly".

Assuming you are working with a live server that you REMOTE DESKTOP INTO and not a shared hosting account here is what you will need to do:
Let's assume your file system looks like this:
c:\inetpub\wwwroot\www.foo.es { some html files in here}
c:\inetpub\wwwroot\www.foo.es\bar {some html files in here}
Without any custom ISAPI filters installed, you would do this by setting up two WEBSITE's in IIS.
The first website would have a home directory of c:\inetpub\wwwroot\www.foo.es and the 2 host headers "www.foo.es" and "foo.es"
The second website would have a home directory of c:\inetpub\wwwroot\www.foo.es\bar and 1 host header "bar.foo.es"
Once you DNS has a CNAME of "bar" that points to your server and you clear your local dns caches, this should work. If you don't know how to make the DNS change the easiest thing you can do is log into to your domain name control panel from whoever you purchased the domain name with and do the following:
ADD A CNAME RECORD:
For the host enter "bar" for the points to enter "foo.es" and you should be all set.

First of all you need to add an entry in your DNS in which you specify the "bar.foo.es" subdomain and the IP of the server to which it points to.
After that, in IIS you will have to create a site for the new subdomain you have just created. For that: right click on Web Sites -> New Website -> follow the steps normally but when you encounter the text box for the "Host header for this Web site (Default: None)" fill it with your subdomain value ("bar.foo.es").
Alternatively, if your web site is already created, you can bind subdomains to it by right clicking on the site -> properties -> Web site tab -> Advanced (the button near IP address) -> add / remove / edit the domains for your site which are represented by the "Host header value".
Please note that what you have at the moment ("www.foo.es/bar") is not a subdomain but a relative address.

Related

Keep old URL after redirect

How do I keep the URL after redirecting to a new server?
I have a server on Amazon, with a IP address for its URL. I also have a domain name which I got from nic.ru (a Russian hosting company). I paid $5 and got nic.ru to do a redirect to my new server.
When the redirect goes through, the URL that is displayed is the Amazon server IP (that is, I type http://bezpontavto.ru which is redirected to http://54.186.37.214/; but 54.186.37.214 is then displayed in the URL bar) I want the URL to redirect from http://bezpontavto.ru to http://54.186.37.214/ yet still display as http://bezpontavto.ru in the URL bar.
I dont have access to the apache.conf file at nic.ru (they do it automatically). I have however set up mod_rewrite, on my new server, and have a nice new blank .htaccess file set up in the /var/www/html/ directory.
What do I need to do to display the old URL in the url bar?
(I guess this is pretty simple, but I have been hitting my head against the wall all day, any help would be much appreciated)
You want to get nic.ru to set up A records that point to your new server. This is usually possible without additional charges, and there is usually a DNS configuration interface to make it possible.
Your Amazon server needs to have been prepared to serve the .ru domain (Apache needs to have a VirtualHost entry set up).
For anyone looking fo do a frame redirect from nic.ru, you have to do it under the menu item "My Domains" (Мои Домены):
To do a DNS redirect, which Pekka mentioned was superior, nic.ru offers a DNS service. The details are at http://dns-master.ru/tariff/en/

Point domain name to specific folder on server

I am currently working on a CMS type of site where users can create websites on my server.
I want to be able to create subdomains for the user's website for them to see the preview.
The next step would be for users to be able to point their domain name to my server, and when users go to the domain it would go to their own designated folder on my server.
How would I go about doing this automatically with php, I have been looking for solutions with no avail.
I currently have a Virtual Server with hostgator. Please advise, or point me in the right direction. Any solutions are welcome as well, I am pretty much stuck at this point.
Thank you very much.
EDIT
For example, if my domain is www.mydomain.com, when a user makes an account, the subdomain username.mydomain.com is created. Later down the line, if the user buys the domain name www.userdomain.com, I want to make it so that if www.userdomain.com is entered, it shows what is on www.mydomain.com/userdomain. The URL should still show www.userdomain.com
The answer is depends on which web server you are using ?(apache / nginx or any other)
You need to have separate directory for each sub domain you created
In your virtual host configuration you need to match the host name and get the subdomain as a parameter to set the root directory for your host name.
CNAME is also possible but if you can tell your web server there is a possibility for detailed answer.

Browser displays IP rather than name

I just built a web page and made it live. The web page was previously accessible by its IP address. I then went to godaddy and made a domain name forward to the IP. The problem is that once I get to the page, the web browser displays the IP rather than the domain name. The customer wants the domain name to display on the page along with the page itself. Most companies want their .com name on the browser bar.
Example: On this page, my browser displays stackoverflow.com/question/ask rather than the Server's ip address.
The web page is served by apache and the server OS is a Bitnami LAMP server.
Any advice? And what else should I do to register and make a domain name function properly?
You need to set up A records, not forwarding records. You can find GoDaddy's help on the subject here: http://help.godaddy.com/article/680#arecs
I had a similar issue. To resolve I had to go to "DNS Management" where "A" was marked as "#" and "Forwarded" (if not change it) then below there is a "Forwarding" section where if you click on the pencil it allows you to enter the data:
Forward To: "http://1.1.1.1" (your IP where you forward to)
Forward Type: Permanent(301)
Settings: HERE WAS MY PROBLEM: it was set as "Forward Only" and I changed it to "Forward with masking" and that fixed the issue

Trouble setting up a subdomain on a VPS under Ubuntu and Apache

I'm a complete newbie when it comes to servers, so I need some help. Basically, I want to have a subdomain on my VPS. I'm not too concerned where the files reside, though of course I would like them separated if possible.
I found a guide to doing this that basically sums the procedure up in five steps:
Create directories to host the content of a new virtual site.
Make a copy of the /etc/apache2/sites-available/defaults file with a site appropriate name.
Change the two /var/www/ entries to the actual directory of the new site.
Add the ServerName line with the real domain name you will be hosting.
Use a2ensite to enable the new site, and finally reload Apache2 so it knows about the new site
I tried all of this, but I can't get it to work. I didn't get any errors at any point during this process, but when I enter the address with the subdomain into my browser, I get a "Server not found" error.
The company that hosts my VPS has an admin page where I can set up subdomains. Stupid question: do I have to do reconfigure the DNS records or something while doing this, or is it likely that the problem is caused by something else?
Additional note: I followed a guide on howtoforge.com when setting up the server, which in hindsight may not have been the brightest move on my part. It is possible that I made a mistake there that is somehow affecting me now?
Assuming you've setup the subdomain correctly in your VPS' admin page, the only thing left to check here is that you've actually created the subdomain in your DNS administration page (have you?). For example, I use afraid.org to manage my DNS records and to add a subdomain, it's essentially:
Type: A
Subdomain: sparky
Domain: example.com
Destination: 120.34.2.3 (this would be your VPS' IP address)
In general, you add a (sub)domain by:
sparky.example.com A 120.34.2.3
Please keep in mind that you want to add an A record (this is important!).

Browsing sites with their domain name from the same server they are hosted on

I have a co-located webserver(Win2k8) having a public IP and have hosted my ASP.NET website on the IIS. Though, I am able to browse everything else from the local browser(IE) installed on the server, the server somehow fails to browse the websites that are hosted in its own IIS when I access them using their 'domain name' set as a host header. For e.g: If the website is for "www.mywebsite.com", so naturally I have set the Host header property to "www.mywebsite.com" and when I put "www.mywebsite.com" in my IE address bar it fails to get the request.
Ok, so now why I need to access this website is that, I plan to send a Query parameter to one of the pages from another page of the same website.
Any idea how to get this working? Thanks in advance folks.
It may be trying to reach itself via its public IP address, which it may not be able to route to.
You can try adding a line into your hosts file (C:\Windows\System32\Drivers\Etc\Hosts, or equivalent) as follows:
127.0.0.1 www.mywebsite.com
Which will force it to access it via the loopback adapter.