Sub Domain

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

Sub Domain

Postby mitchellkellett » 18. June 2014 06:56

Hey,

Currently I run Xampp V3 and have a domain through go daddy. I want to have subdomains setup so that xyz.domain.com points to domain.com/xyz but doesn't mask the title or just redirect to domain.com/xyz. I know how to do this if i purchase hosting but as I host my own I dont know.

Go Daddys solution was to create a redirect from xyz.domain.com that redirects to domain.com/xyz but this looks messy, so id like to clean it up by having xyz.domain.com

Hopefully that makes sense, so if anyone knows how to do this, help a brother out?
mitchellkellett
 
Posts: 3
Joined: 18. June 2014 06:50
Operating System: Windows 7

Re: Sub Domain

Postby Nobbie » 18. June 2014 11:18

Seems you are looking for a "VirtualHost" (Google for that!).
Nobbie
 
Posts: 8775
Joined: 09. March 2008 13:04

Re: Sub Domain

Postby mitchellkellett » 19. June 2014 04:55

yeah i tried that, it didn't work for me.

do I just setup the virtual host part at my end and nothing at the dns end or both?
mitchellkellett
 
Posts: 3
Joined: 18. June 2014 06:50
Operating System: Windows 7

Re: Sub Domain

Postby Nobbie » 19. June 2014 12:43

mitchellkellett wrote:do I just setup the virtual host part at my end and nothing at the dns end or both?


Of course you have to apply either the subdomain to a DNS Server or (if only used within a local Network) to the hosts file of the clients or similar. You have to assign a valid IP to the Subdomain (I thought, that this is already quite clear to you, this does not affect Xampp, this is a basic requirement for using domains and subdomains).

The VirtualHost declaration is used for Xampp in order to define which DocumentRoot is used for that Subdomain (as far as I understood, exactly what you are looking for).

P.S.: In most cases, all subdomains of a domain yield to the same IP as the main domain. This is how most providers implement subdomains. So xyz.domain.com yields to the same server as domain.com.
Nobbie
 
Posts: 8775
Joined: 09. March 2008 13:04

Re: Sub Domain

Postby mitchellkellett » 21. June 2014 16:40

OK, I've finally got that fixed. But now I have the issue that I host BigBlueButton on another server it has an internal IP of 10.0.0.250 and I want to be able to redirect relay.domain.com to this server.

Is there a way to do it, I found this on the apache website but it doesn't help as I get a 500 error. Is there something I've missed

Code: Select all
<VirtualHost *:*>
    ProxyPreserveHost On
    ProxyPass / http://192.168.111.2/
    ProxyPassReverse / http://192.168.111.2/
    ServerName hostname.example.com
</VirtualHost>
mitchellkellett
 
Posts: 3
Joined: 18. June 2014 06:50
Operating System: Windows 7

Re: Sub Domain

Postby Nobbie » 21. June 2014 19:29

Is there a way to do it, I found this on the apache website but it doesn't help as I get a 500 error. Is there something I've missed


Yes, that is the right way, it is called "reverse proxy".

If you get any errors, you MUST look into the error log. This tells you precisely what went wrong. In case of error 500, this means a syntax error in .htaccess or httpd.conf, and this is usually due to the fact, that "something" is unknown to Apache. For example the directive "ProxyPass". And most usually the reason therefore is, that you did not load (via "LoadModule") the desired module.

Next time, you will find the reason for any error by yourself, simply follow the instructions and evaluate the error log file.
Nobbie
 
Posts: 8775
Joined: 09. March 2008 13:04


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 41 guests