Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie! did i set up my httpd.conf file correctly? 1

Status
Not open for further replies.

Gumby001

Programmer
Jan 24, 2007
21
US
Hi i downloaded, installed Apache 2.2.4 everything worked. Went to and it said It Works!. I believe this is correct up until this point. I then went to change my directory and root this is what i have.

locations.
#
#DocumentRoot "C:\Program Files\Apache Software Foundation\Apache2.2.2\htdocs"
DocumentRoot "C:\gumby"

#
# Each directory to which Apache has access can be
####################################################
# This should be
#
#<Directory "C:\Program Files\Apache Software Foundation\Apache2.2.2\htdocs">
<Directory "C:\gumby">
#
# Possible
#####################################################

I restarted apache and everything went well.
I went to open up again and it still said It Works.
I put a sound file in "C:\gumby" but it did not show up on the page but nothing showed. Please assist would be much appreciated... Very new to apache
 
I'm guessing that you expected to see a directory listing that contains your sound file. Depending on the rest of the configuration files, directory listing is probably disabled by default. This is actually a good thing, and shouldn't be changed unless there's a good reason to.

Copy the code below into notepad or your favorite text editor. Change the filename_here.ext to match your audio file. And save it in the C:\gumby directory as index.html. Then try again (apache restart not required).

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml"[/URL] lang="en-us">
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="content-type" />
  <title>Welcome to my site</title>
  <meta content="Steve Hebert" name="author" />
</head>
<body style="direction: ltr;">
<h1>This too now works</h1>
<br />
<a href="filename_here.ext">My audio file</a>
</body>
</html>
 
Thank you... Partially works... When i type Still says It Works!. But when i double click the index.html i made from your base, I renamed the filename_here.ext to "Testing" and when it opens up there is a hyperlink. but when i click the hyper link it says file not found. but the file is in the C:\gumby folder. thank you very much for your time
 
Okay i see... I put in C:\gumby\Testing in for filename_here.ext, But it says Firefox does not know how to open this address. because the protocol isnt associated with any program any idea's?
 
You need to change filename_here.ext to whatever the actual filename & extension is for the 'audio file' that you mentioned earlier.

Wait a second, when your browse to you're seeing a directory listing that shows the index.html file? It should serve that as a web page automatically.
 
No i dont even see index.html i just see It Works!... index.html doesnt come up. And the audio file is named Testing... and this is how i put it in

<a href="C:\gumby\Testing">My audio file</a>

 
Even without apache, your audio file probably won't work with that name. At the very least, there should be some extension - Testing.mp3, Testing.wav, Testing.mid, etc.

So, you put that index.html file in your DocumentRoot directory, but you still get the original 'It works' page? Is the file index.html, or is it index.html.txt (if you used notepad)? When you browse to that folder in Windows Explorer, is the icon an IE icon or a notepad icon?
 
I am using Firefox at the moment... but even when i look at it is a Firefox symbol and says HTML file underneath the Title... and when i go back to my configure file for Apache... in the conf folder it says text file even after i save as a .conf file and i meant to put in .wav after that but still says the protocol isnt associated with any program.
 
OK, index.html should be an HTML file with a FF icon. The httpd.conf file is a text file, so that's fine. Does the .wav file work correctly if you just use windows explorer to double click on the file (without using apache & FF)?

Ignoring the .wav file issue for the moment, when you use FireFox to browse to are you seeing the original 'it works' page or the 'Welcome to my site / This too now works' page that you made before?
 
it is a HTML file with a FF icon... It shows the original it works page... even though in httpd.conf file says DocumentRoot "C:\gumby" and same for Directory
 
I'm missing something that hopefully someone else can see. With:
DocumentRoot "C:\gumby"

you should see whatever index.html file is in that directory. The original 'it works' page should only be displayed when there's no index.html in a particular directory. Does your httpd.conf file contain any <VirtualHost> directives? Alternatively, what happens if you call it directly using ?
 
When i click the link you provided it goes to the page that says "This now works too" and a hyperlink to what should be a .mp3 file and there is no VirtualHost... at least i did not add any. Sorry i am really new to this
 
OK, so it's reading the correct directory. Does your httpd.conf have a DirectoryIndex directive like:
DirectoryIndex index.htm index.html index.html.var index.php
 
I see

<IfModule dir_module>
DirectoryIndex index.html
</IfModule>

I see this after about 15 lines from "AllowOveride All
 
That looks ok. (limited, but ok for our testing). Do you also have a corresponding:
LoadModule dir_module modules/mod_dir.so

Just for experimentation, you could try commenting out the If's:
#<IfModule dir_module>
DirectoryIndex index.html
#</IfModule>

Then restart apache & test again. Sorry, but I'm out of ideas. It seems to be working right, just not serving the default index file. You should be able to put other HTML files in that directory & access them directly.
 
There is a LoadModule dir_module modules/mod_dir.so. Do you want me to delete the If's in every line i see them in or just these here because i see a bunch of them
 
Well i tried deleting all the If's and that didnt work but i do have the loadmodule in there
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top