Subdomain on Windows server.

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Subdomain on Windows server.

Postby tuudik » 30. January 2009 08:53

Hi.
I have set up an Xampp server on windows.
I have domain like uk.domain.com
uk.domain.com is used by main server which hosts the main site.

So i want to make that my server is Subdomain.uk.domain.com
My server ip is 10.12.13.1
Subdomain is under 10.12.13.1/Subdomain

So what i have to do that Subdomain.uk.domain.com goes to 10.12.13.1/Subdomain

I want to setup other things to on server with ip 10.12.13.1 like:
Subdomain1.uk.domain.com goes to 10.12.13.1/Subdomain1
Subdomain2.uk.domain.com goes to 10.12.13.1/Subdomain2
and so on.

I cant set my QIP directly to redirect Subdomain.uk.domain.com to 10.12.13.1/Subdomain

Help me out guys. I hope you understand my problem.
tuudik
 
Posts: 9
Joined: 30. January 2009 08:44

Re: Subdomain on Windows server.

Postby Izzy » 30. January 2009 09:12

Do a forum search for virtualhost or vhost in the XAMPP for Windows forum and read some of the posts that will perhaps give you some ideas of what to do - there are many successful examples on the forums - the file to add your vhosts in is xampp\apache\conf\extra\httpd-vhosts.conf it has some examples already but the forum examples are more realistic.

You will also be editing C:\Windows\system32\drivers\etc\hosts file and drag it into your text editor for reading and editing to add your vhosts that you create for your sub domains like so:

127.0.0.1 localhost
10.12.13.1 uk.domain.com
10.12.13.1 subdomain.uk.domain.com
10.12.13.1 subdomain1
10.12.13.1 subdomain2
10.12.13.1 subdomain3

and so on etc. get the idea?

Do some reading then have a go with just one vhost and if you get that working then add others in the same style as the first only change the folders and paths etc.

If you have a go then get stuck paste your vhosts conf file and your hosts file with as much detail as possible of what you have done and someone here will take a look at it for you.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: Subdomain on Windows server.

Postby tuudik » 30. January 2009 10:28

So i tried
i putted in httpd-vhosts.conf this code:
Code: Select all
   
NameVirtualHost *:80

    <VirtualHost *:80>
    ServerName localhost
    DocumentRoot /xampp/htdocs
    </VirtualHost>

    <VirtualHost *:80>
    ServerName śubdomain
    DocumentRoot /xampp/htdocs/subdomain
    <Directory /xampp/htdocs/subdomain >
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>
    </VirtualHost>


And in hosts file
Code: Select all
127.0.0.1       localhost
10.28.0.30     uk.domain.com
10.28.0.30   subdomain.uk.domain.com


But still when i go to address subdomain.uk.domain.com it directs to server htdocs root 10.12.13.1
tuudik
 
Posts: 9
Joined: 30. January 2009 08:44

Re: Subdomain on Windows server.

Postby Izzy » 30. January 2009 10:45

Try this and change the drive letter if xampp is not in the C:\ drive.
Code: Select all
   
NameVirtualHost *:80

    <VirtualHost *:80>
    ServerName localhost
    DocumentRoot C:/xampp/htdocs
    </VirtualHost>

    <VirtualHost *:80>
    ServerName subdomain.uk.domain.com
    DocumentRoot C:/xampp/htdocs/subdomain
    <Directory C:/xampp/htdocs/subdomain >
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>
    </VirtualHost>


And in hosts file
Code: Select all
127.0.0.1       localhost
10.28.0.31    uk.domain.com
10.28.0.31     subdomain.uk.domain.com


http://subdomain.uk.domain.com should go to the htdocs/subdomain folder.

http://localhost should go to htdocs root folder



Is xampp on 10.28.0.31

Where is 10.28.0.30 as you can't change to this in your hosts file that xampp is on.

I don't know yet whether I understand fully what you are trying to do on your LAN.
Last edited by Izzy on 30. January 2009 10:50, edited 1 time in total.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: Subdomain on Windows server.

Postby tuudik » 30. January 2009 10:50

Now it goes to:
Code: Select all
http://subdomain.uk.domain.com/subdomain/index.php/Frontpage


should go
Code: Select all
http://subdomain.uk.domain.com/index.php/Frontpage
tuudik
 
Posts: 9
Joined: 30. January 2009 08:44

Re: Subdomain on Windows server.

Postby tuudik » 30. January 2009 10:56

10.28.0.30 is 10.12.13.1
i just changed 10.28.0.30 to 10.12.13.1 in this topic for security reasons.
tuudik
 
Posts: 9
Joined: 30. January 2009 08:44

Re: Subdomain on Windows server.

Postby Izzy » 30. January 2009 11:06

You local IPs are secure as they are only accessible from within your LAN and anyway it is all over your first post????
"Address information
10.12.13.1 is part of a special address block (10.0.0.0 - 10.255.255.255) that is reserved for private networks.'

tuudik wrote:Now it goes to:
Code: Select all
http://subdomain.uk.domain.com/subdomain/index.php/Frontpage
should go
Code: Select all
http://subdomain.uk.domain.com/index.php/Frontpage
That looks odd as you are saying your subdomain.uk.domain.com is in htdocs/index.php/Frontpage folder.

Do you have a folder called index.php?

If so you change the DocumentRoot and the <Directory> to this address for example
DocumentRoot C:/xampp/htdocs/index.php/Frontpage
Then it will go where you want.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: Subdomain on Windows server.

Postby tuudik » 30. January 2009 11:10

The index.php script is just done so.

Actually its like that
Code: Select all
http://subdomain.uk.domain.com/subdomain/index.php


should go
Code: Select all
http://subdomain.uk.domain.com/index.php
tuudik
 
Posts: 9
Joined: 30. January 2009 08:44

Re: Subdomain on Windows server.

Postby Izzy » 30. January 2009 11:16

tuudik wrote:The index.php script is just done so.

Actually its like that
Code: Select all
http://subdomain.uk.domain.com/subdomain/index.php


should go
Code: Select all
http://subdomain.uk.domain.com/index.php


Now the first vhost I posted above should do just that.

DocumentRoot C:/xampp/htdocs/subdomain
<Directory C:/xampp/htdocs/subdomain >


http://subdomain.uk.domain.com
Should go to:
http://subdomain.uk.domain.com/index.php

your hosts file could also look like this
Code: Select all
127.0.0.1       localhost
127.0.0.1       uk.domain.com
127.0.0.1       subdomain.uk.domain.com

10.28.0.31     uk.domain.com
10.28.0.31     subdomain.uk.domain.com
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: Subdomain on Windows server.

Postby tuudik » 30. January 2009 11:32

Thanks a lot!
Maybe i could handle it without your help but still have to thank because without you i would have already gone another way.
Problem was actually in wikis local settings that kept directing.
:D
so it was working all the time
:D
tuudik
 
Posts: 9
Joined: 30. January 2009 08:44

Re: Subdomain on Windows server.

Postby Izzy » 30. January 2009 11:37

Your welcome and thanks for posting back.

If you have more issues then it pays to give as many details as possible as we have no way of knowing what you can see on your monitor or what you are doing or have done.

Good luck and best wishes with your project.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 51 guests