Setting up sub-domains and directories

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

Setting up sub-domains and directories

Postby puttsy » 24. December 2011 09:44

Hello all, I'm new to these parts but have been using XAMPP for some time now. Currently I am trying to setup several subdomains, such as wiki.mydomain.com and forum.mydomain.com. I DO own a domain that IS hosted(ish) elsewhere and want to keep it that way (hosted on blogger) but I want to direct wiki.mydomain.com and forum.mydomain.com to my personal server. I've creadted the subdomains with the registrar and when I enter the address in a browser (internal or external of my network) I get directed to XAMPP. I provide credentials (username and password) but, wiki.mydomain.com changes to wiki.mydomain.com/xampp and I'm at the xampp control panel. I tried working with the vhosts.conf and that doesn't seem to have really done much. I've got the forum and wiki 'applications' in c:\xampp\htdocs so those should be in the right place.

What do I need to do in order to get the subdomains directed to the right places? And why are all the subdomains just taking me to the XAMPP control panel? I've looked at a bunch of the "Editing vhosts" walkthroughs and that hasn't gotten me to succeed. Any thoughts or advice? It seems like it *should* work and since it doesn't, it seems like there's something small that I'm missing but I can't figure it out.
puttsy
 
Posts: 6
Joined: 24. December 2011 09:21
Operating System: Windows 7 Pro x64

Re: Setting up sub-domains and directories

Postby Sharley » 24. December 2011 09:48

Try deleting or renaming the index.php and index.html files in the htdocs folder as they belong to XAMPP and the index.php will redirect you to the orange xampp Welcome page.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Setting up sub-domains and directories

Postby puttsy » 24. December 2011 19:46

Sharley wrote:Try deleting or renaming the index.php and index.html files in the htdocs folder as they belong to XAMPP and the index.php will redirect you to the orange xampp Welcome page.


Well, that at least fixed the "Welcome Screen" coming up regardless but, how do I get it to direct to the subfolders and therefore, the sub-domains? I know this is likely a simple/rudementary question and issue but it is one that is causing a fair amount of confusion. Currently, when I type in "wiki.mydomain.com" get to the apache page with the list of files/folders. If I open one of the folders (i.e. mediawiki) I receive an error "Connection Problems:.." which gives an error regarding password for database. But, the primary problem is that I get taken to the list of file in the htdocs directory and NOT the subfolder my domain should be directing to. (if I type in wiki.mydomain.com or forum.mydomain.com, I receive the same apache file list. And selecting the subfolders from there gives the access error) Any ideas? Please note, no answer is too 'simple'. I may not have thought of or know about some of the "little" things that should be done so any suggestions/thoughts are appreciated.
puttsy
 
Posts: 6
Joined: 24. December 2011 09:21
Operating System: Windows 7 Pro x64

Re: Setting up sub-domains and directories

Postby Sharley » 24. December 2011 21:35

You have 2 domains (sub domains) so you would need to use virtual hosts so Apache knows which one to serve when a request from your browser is received.

Have a read through these forum search results and see if you can configure the \xampp\apache\conf\extra\httpd-vhosts.conf file.

There are some useful examples for you to work with.

You can paste in between forum code tags your attempt if you don't have any success so I can see perhaps what may need fixing.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Setting up sub-domains and directories

Postby puttsy » 26. December 2011 07:30

I've got it 'semi' working now. I'm in the sticks for the holidays with a MacBook Pro so I'm working on configuring THAT as a test box/server. I actually got it working to the point that I go to: wiki.mydomain.com, I get taken to my wiki, BUT, If I just type localhost, I am sent to the forum I have setup. The wiki(wikimedia) and the forum(smf) are installed in the same subdirectory.

BUT, if I type in localhost/xampp I receive "Object no found." "Error 404". Any suggestions? I'm not too concerend because in a few days I'm needing to configure it all again on a Win7 box and Win Server 2k8 server but I would like to have an idea of what I'm doing then.

Also, I am trying to install wordpress however, I can not get to the directory that it's in. I always receive "Object not found" "Error 404" I've installed wordpress before and their installer really is pretty simple, but I am wondering why I can't get to the point of installation. Obviously if I had a problem with wordpress, I'd take it to their forum BUT, this seems (to my novice mind) that this is a problem before anything wordpress is tossed in the mix.

Also, I saw a tip that sometimes it's better to place the apps(wordpress, PhpBB, SMF, etc...) in the xampp sub-folder in htdocs. This seemed to solve a problem or 2 I had but has not really provided any help this time. Ideas? Is this sub-folder thing even a good idea?

Thank you much!
puttsy
 
Posts: 6
Joined: 24. December 2011 09:21
Operating System: Windows 7 Pro x64

Re: Setting up sub-domains and directories

Postby Sharley » 26. December 2011 08:02

Server errors are best investigated by reading the Apache error.log file and in XAMPP for Windows the logs are in \xampp\apache\logs folder, I have no idea about a MAC or how to configure it.

Best to search and ask Mac questions in the dedicated Mac forum (off topic in this forum).

puttsy wrote:Also, I saw a tip that sometimes it's better to place the apps(wordpress, PhpBB, SMF, etc...) in the xampp sub-folder in htdocs. This seemed to solve a problem or 2 I had but has not really provided any help this time. Ideas? Is this sub-folder thing even a good idea?
That folder is an XAMPP system folder and should not be used to store your own files and folders - all your own files and folders need to be stored in the Apache server's DocumentRoot which is the htdocs folder.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 78 guests