logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Cannot get past the default page
Author
Matternor



Joined: 29 May 2006
Posts: 19
Location: Chicago

PostPosted: Mon 29 May '06 23:42    Post subject: Cannot get past the default page Reply with quote

I'm an Apache newb, and I have a problem (which I have found the Oreilly book to be less than helpful for a windows user).

I downloaded Apache 2.0 on my computer that is running Windows XP, and I received the 'index.html' page that displays when I type in 'http://localhost' on my browser. The problem is that I not been able to find anyway to change it so that either a directory or a webpage of my choosing displays; just the now very irritating webpage that informs me that I know how to click on install.

I do not have PhP nor any other web oriented program installed (unless you count Perl), just the Apache 2.0 install. I know that the solution is probably very simple, but I'm a newb. I'd love to get Apache running, but I need to know how to get Apache to display what I want it to display on load.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Tue 30 May '06 18:53    Post subject: Reply with quote

look for the htdocs folder. Plase read the manual http://httpd.apache.org/docs/2.2/
Back to top
Matternor



Joined: 29 May 2006
Posts: 19
Location: Chicago

PostPosted: Wed 31 May '06 7:25    Post subject: Reply with quote

I've read the manual, and I still cannot figure out how to get past the default page. Sorry if I'm asking to be spoonfed, but I am absolutely stuck here.

I've tried changing the documentroot with no luck. changing the directoryindex appears to do nothing. I've spent hours trying to fix this problem, with no luck at all. I'm using the httpd.conf file that Apache set up on install, and my ip address as the servername (I'll register a domain name if I can ever get this running).
Back to top
Matternor



Joined: 29 May 2006
Posts: 19
Location: Chicago

PostPosted: Wed 31 May '06 8:29    Post subject: Reply with quote

Would adjusting the UserDir directive be the key? I messed around with it. And instead of getting the default page, I am now getting the 'error 404' message. Hopefully I am getting closer, and didn't just break something else.
Back to top
pnllan



Joined: 05 Dec 2005
Posts: 221

PostPosted: Wed 31 May '06 9:12    Post subject: Reply with quote

I believe that James is trying to get you to find something like C:\Program Files\Apache....\...\htdocs in the HTTPD.CONF.

In the DEFAULT configuration, you should find the above path in at least two places. The first is the DocumentRoot directive, and the second will be a Directory directive within a few lines (if I remember the default config file organization).

Change your DocumentRoot path to: "X:/thefolderyouwanttouse"

Where X: is the drive that contains the folder you want to use (Could be C:, D:, or whatever drive you want to use).

The second directive as I said will be a Directory directive - change it to whatever path you use for DocumentRoot directive.

REMEMBER:
1. Apache uses foreslashes ( / ) in path statements instead of backslashes ( \ ).
2. With Apache on Windows, you must quote paths:

example
correct ----- "x:/root/subroot"
incorrect --- x:/root/subroot - no quotes
incorrect --- x:\root\subroot - no quotes and backslashes

Another thing that could be causing you problems is that Apache has to be RESTARTED ( or STOP then START) for configuration changes to take effect.

Also, some browsers need a little help, as in clearing its' cache and then refreshing.
..
.
Back to top
Matternor



Joined: 29 May 2006
Posts: 19
Location: Chicago

PostPosted: Wed 31 May '06 9:43    Post subject: Reply with quote

Thanks for your help. I use firefox as my browser, so I think that I might have been hit by a caching issue. I have now set caching to 0, and clear out the browser along with restarting Apache when I need to check for changes.

On the good side of trying to figure out how to fix this problem, I discovered alot of cool things about Apache that makes me even more anxious to get it up and running. On the bad side, I broke something else.

I changed the UserDir directive from its default 'My Documents/My Website', to something else. Even after changing it back to what it was before, I still get the 'Error 404' message (I restarted and emptied the browser cache). From what I am reading, UserDir sets the home directory for a user. Is the function of UserDir to redirect certain users to different directories, and to allow or disallow people access? Anyways, UserDir requires an argument in order for Apache to work. What argument should I give it?
Back to top
pnllan



Joined: 05 Dec 2005
Posts: 221

PostPosted: Wed 31 May '06 17:07    Post subject: Reply with quote

You never said, but I am supposing that you are trying to use the Apache install (a MSI file) from ASF (Apache Software Foundation). Also, that you are trying to use Apache 2.0.xx versus Apache 2.2.2. If this is the case, you might as well un-install. Clean up any residuals, and then re-install. Keeping in mind what you have already learned about DocumentRoot and the Directory directives.

Otherwise, here is a snippet from the CONF file BEFORE it's installed:

NOTE: that "@@ServerRoot@@/htdocs" is the path to where you want your web root folder. By default, it under the ServerRoot in a folder named HTDOCS (where you installed Apache to e.g. - C:/Program Files/Apache.../.../htdocs)

Also, NOTE the two places where you have @@ServerRoot@@/htdocs"


Code:
DocumentRoot "@@ServerRoot@@/htdocs"

#
# 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
</Directory>

#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#

#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "@@ServerRoot@@/htdocs">

  Options Indexes FollowSymLinks

  AllowOverride None

  Order allow,deny
  Allow from all

</Directory>



Finally, DocumentRoot can be in just about any folder you want. It's up to you. If you want to run 'as is' after the install - just put your files and folders in the HTDOCS folder.
..
.
Back to top
Matternor



Joined: 29 May 2006
Posts: 19
Location: Chicago

PostPosted: Thu 01 Jun '06 4:29    Post subject: Reply with quote

I uninstalled Apache and then reinstalled it. I kept the documentroot and directory the same at htdocs. I made a small page titled index.html, and ended up solving my problem. Many f-bombs were dropped in joy.

Thanks for the help. In retrospect, it seems like something easy to fix now (hindsight being what it is). this brings me to the next question since I couldn't find anything about this in the manual. Is the first page that Apache serves always going to be index.html, or is there a way to set it so that I can make the first page that Apache serves be someting like somethingelse.html?

I'm pretty much fiddling with it now discovering more things that I want to play with that I am actually able to do. Thanks again. Very Happy
Back to top
pnllan



Joined: 05 Dec 2005
Posts: 221

PostPosted: Thu 01 Jun '06 7:55    Post subject: Reply with quote

.
Good to hear you got it going.

Actually, what you want is in the manual. One of the best things to do is understand how to use the manual (at least the way Apache organizes theirs). Read your HTTPD.CONF, each time you come to a directive you do not understand - read the manual (Reference Manual - Directive Quick Reference)...and related subjects. Within a matter of a week you'll be surprised how much you can pick up.

Anyway, FIND the DirectoryIndex directive your HTTPD.CONF. Essentially, it works like so:

Code:
DirectoryIndex ThePageIwant.htm index.htm index.html index.php index.pl


In this example, when someone request the root (without specifying a page [local URL] ex.: http://localhost versus http://localhost/afile.html) on your server the first file that will be served is ThePageIwant.htm. If this file does not exists, then index.htm will be served. Then, if index.htm does not exist index.html will be served up. So on and so forth.

In your fiddling, read a section in the manual under User's Guide called Configuration Sections. I think you will find that Apache is a extremely versatile Web Server, and not that difficult to learn.
..
.
Back to top
Matternor



Joined: 29 May 2006
Posts: 19
Location: Chicago

PostPosted: Thu 01 Jun '06 21:18    Post subject: Reply with quote

Thanks again for all your help. It feels great to have Apache up and running the way that I want it so far.

I've been reading the manual alot, but I think the key is to figuring out how it is organized. Once I get that, I'm going to have alot of fun. I think my biggest problem starting out though was that I didn't empty the browser cache and restart Apache every time I edited the httpd.conf file. Its a newb mistake, and I spent enough hours trying to figure it out that I am positive not to repeat it.
Cool
Back to top


Reply to topic   Topic: Cannot get past the default page View previous topic :: View next topic
Post new topic   Forum Index -> Apache