Root Directory Problem

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

Re: Root Directory Problem

Postby mewbie » 22. May 2009 09:38

I post here again as its related to abhijitp 1st post. Maybe I have misunderstood the intention, but my intention when users type in: http://myurl.com < it will bring users to the area I have changed in the httpd.conf file (I didn't need to change index.php as below) and this worked fine, yay! :D

But when I now want to go to my original default bookmark http://localhost/xampp/index.php , it gives me error: 404 Object not found. Same when I enter URL http://localhost/xampp/htdocs/xampp/index.php. Manually opening this file in firefox gives me a 1/2 loaded page in maybe german (lang.tmp still says en).
or select the Admin button on control panel, it gives me my users direct url: http://localhost/ (same as http://myurl.com)

So how to have users go direct to folder/page I want when entering my URL but still I am able to access my admin button?
Would this be related to the part 'symbolic links' ? As I have heard of this and hope to use it, so I don't need to move everything I want users to have access to, to the xampp dir.

Sorry for all the newbie questions! :oops:

*Note all my test on are on my local box, whether it works on another computer I dont know. The only other option I have here at the moment to test is my handphone which gives me error: No web gateway reply.
mewbie
 
Posts: 13
Joined: 21. May 2009 02:43

Re: Root Directory Problem

Postby Sharley » 22. May 2009 10:01

it gives me error: 404 Object not found
Look in the xampp\apache\logs\error.log file for details.

Also give more details of what you have changed in the server's configuration files and why you are changing things from the installation defaults - normally you don't need to change the Apache server's installation default configuration.
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: Root Directory Problem

Postby mewbie » 22. May 2009 10:58

Thank you again Sharley. You are a sweety!! :D

Sorry I wasn't clear. What I would like is when someone visits my website (in my computer) and they type: http://myurl.com they are brought to my home page that I have put in a sub directory called 'mywebsite' with a index.html in there as well.
So from the 1st post I followed the directions and: I edited D:\xampp\apache\confhttpd.conf
It said this: DocumentRoot "D:/xampp/htdocs"
I changed it to:
DocumentRoot "D:/xampp/htdocs/mywebsite"

below that it is: <Directory "D:/xampp/htdocs">
I changed it to:
<Directory "D:/xampp/htdocs/mywebsite">

stop and start apache via control panel button.
Now works when I go to: http://myurl.com < it opens up my index.html home page, so this is working.

But now when I select the admin button on the control panel application it also goes to my home page (not the admin page).
The default bookmark for (admin page) http://localhost/xampp/index.php and also
http://localhost/xampp/htdocs/xampp/index.php now gets the 404 error- not found.

I have pasted the log here so not to spam the post: http://pastebin.com/m45e74870
(which is basically saying: File does not exist: D:/xampp/htdocs/mywebsite/xampp etc etc)

So what I'm trying to do is http://myurl.com will lead to my homepage when users type that in their browser.
mewbie
 
Posts: 13
Joined: 21. May 2009 02:43

Re: Root Directory Problem

Postby Wiedmann » 22. May 2009 11:03

So basically what I'm trying to do is http://myurl.com will lead to my homepage when users type that in their browser.

Just put your files in "D:/xampp/htdocs" and don't touch the default configs.

(You can delete all things in "D:/xampp/htdocs", except of the xampp subdir.)
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Root Directory Problem

Postby Sharley » 22. May 2009 12:05

I thought that we had already established that there is no such folders at
D:\xampp\htdocs\xampp\htdocs\
http://localhost/xampp/htdocs/index.php
This simply does not exist and will give you a 404 error everytime you try and access it - so put this address out of the equation (forget it completely and permanantly).


If you change the DocumentRoot to "D:/xampp/htdocs/mywebsite" and the <Directory> directive to the same location "D:/xampp/htdocs/mywebsite" then http://localhost/index.html will now give you the files from your mywebsite folder which is the DocumentRoot folder.

So in the XAMPP Control Panel when you click on the Admin button you will get your web site because the old Admin button goes to http://localhost which is now your web site as you have designated in the httpd.conf file.

When you type http://localhost/xampp/index.php then you will get a 404 error because you don't have a folder xampp in your mywebsite (DocumentRoot) folder - as pointed out in your error.log file - File does not exist: D:/xampp/htdocs/mywebsite/xampp

So it is still a matter of you not quite getting a handle on what you are doing by changing the httpd.conf file.

Using the method you have used then you have lost the XAMPP Admin pages using the default methods of access.


However if you return the httpd.conf file back to the defaults.

Delete the default XAMPP index files (index.php and index.html) in the D:\xampp\htdocs folder.

Put your website files and it's index.html file in to the D:\xampp\htdocs folder.

You will be able to access your website at http://localhost/index.html

You will also be able to use the Admin button in the XCP to access the XAMPP Welcome Page.

http://localhost/xampp/index.php will also access the XAMPP Welcome Page (Admin).

Using your ISP provided IP will give Internet access to your web site also.

Try the above and you will see that you don't need to change anything in the httpd.cond file.


So basically what I'm trying to do is http://myurl.com will lead to my homepage when users type that in their browser.
Access from the internet using a URI like http://myurl.com will work if myurl.com is a registered domain name and the nameservers at your domain name registrar (GoDaddy for example) for that domain name are pointing to your IP address where the web site is being served and in your case the IP would be your ISP provided IP and the server would be Apache in XAMPP.

An alternative to registering a domain name is to use a service like no-ip.com and other like services - do a Google for more info.
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: Root Directory Problem

Postby IamJim » 22. May 2009 12:11

Sharley, Weidmann and Mewbie..

All excellant contribs/suggestions to problem solving !! My thank's.

Dumb question now (on 2 things so far)

Sharley,

I had run a std. windows cleanup, and also back up to tape.

1) my lang.tmp in which I just looked is "0" bytes w/nothing in it. But, all seems to be working...(so far), but then again I am just getting going also..

?? Do I need to edit it, and add > en and SAVE?

2) Weidman >> re: [b](You can delete all things in "D:/xampp/htdocs", except of the xampp subdir.)[/b}

Wow !! Telling newbies to delete stuff.. Heck Im scared...<laugh>

I am just going to be using XAMPP for local developemnt. I just kind of figured I could create /subdirs inside /htdocs and all would run smooth.

My idiot move of "NOT" using http://localhost/xxxx to access was my problem. I will over time have many http://localhost/xxxx and also when converting and HTML template to PHP I am presently doing this?? > http://localhost/xxxx/php/

One thing I have ran across, is for some reason the CSS is not displaying proper LOCAL, so this stems back to my PATHING...?? After the /htdocs?

Jim
IamJim
 
Posts: 56
Joined: 27. April 2009 03:01

Re: Root Directory Problem

Postby Sharley » 22. May 2009 12:40

IamJim wrote:Sharley,

I had run a std. windows cleanup, and also back up to tape.

1) my lang.tmp in which I just looked is "0" bytes w/nothing in it. But, all seems to be working...(so far), but then again I am just getting going also..

?? Do I need to edit it, and add > en and SAVE?
The next time you access the XAMPP Welcome Page you will be asked to select your language again if the lang.tmp file is blank - but unless you change back the httpd.conf file to the defaults then you may never access the XAMPP Welcome Page (Admin) again, which is why you believe "all seems to be working".

If you type in en, if that is your preferred language, then you will not be asked to select your language when or if you access the Welcome Page.

Just make sure that if you do a disk cleanup that the xampp folder and all it's sub folders are not included or at some stage down the track you will have issues.
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: Root Directory Problem

Postby IamJim » 22. May 2009 13:06

Ahhh!! > http://localhost/xampp/splash.php

Well, this is where I said...(OK all is fine) I also did not realize I should have related back to the tutorial...and SELECT again, as I took it for granted all was installed and fine.

?? Possibly on the SLASH page...maybe a suggestion to SELECT Language?

?? Better yet, maybe a routine added to "check and say Hey DUMMY" it was working, but your disk cleanup...screwed things up!!

Not sure, if this is in the DOCS? Maybe, it's just that I got it going...and quite reading...(like most would do)

a: My language file is now "2" bytes :D

b: Status http://localhost/xampp/index.php = All activated.

(laugh)

c: (CRY) I am still having an issue? And not sure why?

Seems to be CSS and possibly pathing to deep? (If that makes sense)

I will send links in PM, if you don't mind...as I must for now keep my guys site, from public view.
IamJim
 
Posts: 56
Joined: 27. April 2009 03:01

Re: Root Directory Problem

Postby mewbie » 22. May 2009 14:54

Thank you very much Wiedmann for your reply. Sorry slow on reply; I had guest here and thought I hit the reply button while sneaking in to fix this :P And now I see Sharley has also replied. Thank you :D
Ok I have
-set everything back to how it was originally.
-Then I removed all in htdocs folder except xampp folder.
Results:
When I go to http://myurl.com works opening my index.html = very good
When I go to default bookmark it works, opens admin page up. http://localhost/xampp/index.php = very good
When I select the 'Apache Admin button' on the control panel application it goes to my homepage 'index.html' =not good

If I put back into the htdocs folder the 'index.php' the Apache Admin button works again to open admin page, but
http://myurl.com is not opening my website page, it's opening the admin page.

So I guess my question at this point would be how to have all working, if possible?? All would be:
1.) 'http://myurl.com' opens my website home page (and not having to type 'http://myurl.com/index.html')
2. ) I'm still able to access default index.php via bookmark browser
3.) " " " " via Control Panel Application.

Or maybe it just shouldn't work like this and I'm clinging on to something I think I broke :p

Thank you again

PS: I have a free dyndns name that works very well for me. I just type myurl.com here to replace it for public posting.
mewbie
 
Posts: 13
Joined: 21. May 2009 02:43

Re: Root Directory Problem

Postby Wiedmann » 22. May 2009 16:50

When I select the 'Apache Admin button' on the control panel application it goes to my homepage 'index.html' =not good

In my opinion, that's more a bug in the current CP.
--> The XAMPP demopage (~ admin) is located in "/xampp/" and not in "/", which the CP is using.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Root Directory Problem

Postby mewbie » 22. May 2009 17:08

OK and thank you again Wiedmann . I will just access it from bookmark :D
mewbie
 
Posts: 13
Joined: 21. May 2009 02:43

Previous

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 37 guests