New Application Directory

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

New Application Directory

Postby Tom McIntyre » 13. August 2009 03:51

I created a new directory under xampp on my server. It is at the same level as phpmyadmin and a copy of vBulletin I use for testing. I will be using it to learn more about php and apache. However, when I write the first simple program and put it in the directory, it returns the error "Object not found" when I address it in the browser address line. I know this must be incredibly simple, but this is my first try at setting up a directory from scratch. I had thought I would just need to locate it under c:/xampp/ like everything else seems to be.

Code: Select all
http://localhost/Hamilton/showinfo.php

Object not found!

The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

If you think this is a server error, please contact the webmaster.
Error 404
localhost
08/12/09 22:47:21
Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i mod_autoindex_color PHP/5.2.8
Tom McIntyre
 
Posts: 3
Joined: 13. August 2009 03:40

Re: New Application Directory

Postby Izzy » 13. August 2009 04:46

You will need to add your Hamilton folder to the Apache server's default DocumentRoot which is C:\xampp\htdocs in a default installation - as defined in the C:\xampp\apache\conf\httpd.conf file which by the way is worth reading the comments in this file by simply dragging it into an open text editor.

Note - Don't change anything in this configuration file until you are very familiar with it and definitely not before making a backup copy, so that if things go pear shaped after editing you can always revert to a known good conf file.

Apache looks for folders and files in this htdocs folder only, for simplicity of this explanation, all other files and folders outside this htdocs folder will generate the error you received when requesting a URI in your browser, as you now have found out.

http://localhost = C:\xampp\htdocs the default DocumentRoot

http://localhost/hamilton/showinfo.php = C:\xampp\htdocs\Hamilton\showinfo.php

Remember that Hamilton is not the same as hamilton (case sensitive in Apache).


The C:\xampp\readme_en.txt file and the XAMPP for Windows home page plus the FAQ have lots of useful reading that may help to get you familiar with how XAMPP is constructed.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: New Application Directory

Postby Tom McIntyre » 13. August 2009 05:52

Thank you for the help.

I had already read the httpd.conf file and realized that doc root was in the default htdocs directory.

What confused me and still confuses me is that none of the other applications distributed with xampp are located there. Phpmyadmin, my forum directory for vBulletin and all the other applications have their own directories somewhere else. The only directories and applications under htdocs are the ones for the experimental single sign on. The index.html and index.php files that are located there are just dummies. There are applications in /xampp/htdocs/xampp but nothing for phpmyadmin or for my vBulletin install which are in /xampp/phpmyadmin and /xampp/forum respectively.

I would have thought it all some kind of background magic except I cannot see how the vBulletin application that I just installed today would be working correctly. I presume it must have registered itself somehow.

I don't see an .htaccess file in htdocs to do any url rewriting.

I will move my application in htdocs if I need to, but I am curious how the others manage to not be there.
Tom McIntyre
 
Posts: 3
Joined: 13. August 2009 03:40

Re: New Application Directory

Postby Izzy » 13. August 2009 06:54

Tom McIntyre wrote:What confused me and still confuses me is that none of the other applications distributed with xampp are located there.
Everything in XAMPP is usually tied to either a configuration *.conf file or an initialization *.ini file which would require you to investigate the XAMPP configuration file locations and read the contents, as you seem to have done with the httpd.conf file but reading and understanding the file's contents are 2 distinct differences.

PhpMyAdmin's location is Aliased in \xampp\apache\conf\extra\httpd-xampp.conf file as is the Security folder, Webalizer Stats etc. and the Apache documentation will explain the Alias directive as well as the multitude of other directives found in the configuration files.

Your forum folder for vBulletin location \xampp\forum\ if called from a URI in your browser http://localhost/forum/index.php will also be denied access because in the httpd.conf file this section will cause it to fail:
Code: Select all
#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features. 
#
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>
So how are you calling the forum's index file in your browser?

Anything that goes through your installed and running web server requires a URI in your browser to access the files and folders.

The applications in /xampp/htdocs/xampp/ are covered because they are in the DocumentRoot tree as would be your /xampp/htdocs/Hamilton folder.

...I would have thought it all some kind of background magic except I cannot see how the vBulletin application that I just installed today would be working correctly. I presume it must have registered itself somehow.
Not possible unless you ran an installer script that had permissions to change (edit) or created an Alias in the httpd.conf file or create a vhost entry in \xampp\apache\conf\extra\httpd-vhosts.conf file etc. - which again I believe would be impossible if installing via a web browser through the server, as most forums, blogs and CMS etc. do.


So in summing up, you can place your files in folders anywhere you like on your PC as long as the server knows where they are and what to do with them via directives in the server's configuration files, as mentioned previously the Apache documentation has all you need to achieve this aim along with the many examples contained in the many configuration files in XAMPP.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: New Application Directory

Postby Tom McIntyre » 13. August 2009 15:17

Izzy wrote:PhpMyAdmin's location is Aliased in \xampp\apache\conf\extra\httpd-xampp.conf file as is the Security folder, Webalizer Stats etc. and the Apache documentation will explain the Alias directive as well as the multitude of other directives found in the configuration files.


Thanks again. That was the piece of information I was looking for.

vBulletin uses an install script and had placed its alias in httpd-xampp.conf. I will need to do a bit more reading about why and how one does that but I can manually create an entry there for my Hamilton directory if I like.
Tom McIntyre
 
Posts: 3
Joined: 13. August 2009 03:40


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 128 guests