Super easy Apache question (newbie)

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
filthyj
Forum Newbie
Posts: 4
Joined: Sat Jun 04, 2005 7:09 pm

Super easy Apache question (newbie)

Post by filthyj »

Where do I put the HTML files I want to view on the server (http://localhost)? For some reason, I'm having a much harder time figuring this out than it seems like I should be.

Thanks,
Jason
User avatar
Skara
Forum Regular
Posts: 703
Joined: Sat Mar 12, 2005 7:13 pm
Location: US

Post by Skara »

It should say where in your httpd.conf. It's usually /var/www/html.
Find in httpd.conf these lines (the quoted might be different):
DocumentRoot "/var/www/html"
and
<Directory "/var/www/html">

That's where you put it. Or you can change both of those if you like.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

or on a windows system:

c:\Program Files\Apache Group\Apache\htdocs
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

I store the websites on a different harddisk/partition...
DocumentRoot still defaults to c:\program files\apache2\whatever

Code: Select all

NameVirtualhost *:80

<VirtualHost *:80>
  ServerName localhost
  DocumentRoot &quote;F:/websites/localhost&quote;
  <Directory &quote;F:/websites/localhost&quote;>
    AllowOverride All
    Options All
  </Directory>
</Virtualhost>

<VirtualHost *:80>
  ServerName test
  DocumentRoot &quote;F:/websites/test&quote;
  <Directory &quote;F:/websites/test&quote;>
    AllowOverride All
    Options All
  </Directory>
</Virtualhost>
User avatar
filthyj
Forum Newbie
Posts: 4
Joined: Sat Jun 04, 2005 7:09 pm

Post by filthyj »

Skara wrote:It should say where in your httpd.conf. It's usually /var/www/html.
Find in httpd.conf these lines (the quoted might be different):
DocumentRoot "/var/www/html"
and
<Directory "/var/www/html">

That's where you put it. Or you can change both of those if you like.
This is what I found:

DocumentRoot "@exp_htdocsdir@"

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

What do the @ symbols mean? What does any of this stuff mean?

Thanks,
Jason
User avatar
Skara
Forum Regular
Posts: 703
Joined: Sat Mar 12, 2005 7:13 pm
Location: US

Post by Skara »

Hmm. Don't know about that. I think it may be something relative. Be warned, there are many <Directory> tags, though. The one you posted isn't the one I'm talking about. Scroll down a bit and you should see '<Directory "@exp_htdocsdir@">.' ;)
User avatar
filthyj
Forum Newbie
Posts: 4
Joined: Sat Jun 04, 2005 7:09 pm

Still doesn't work

Post by filthyj »

I found the one you were talking about and changed it to "/home". I put a file called index.html in my "home" directory. It still didn't work. Here's what happens every time instead:

I go to http://localhost
It has a directory listing consisting of just one directory (apache2-default) which apparently does not exist on my computer.
When I click on the directory name, a page comes up that says something like "Seeing this instead of the page you expected? bla bla bla"

So what am I still doing wrong?
User avatar
Skara
Forum Regular
Posts: 703
Joined: Sat Mar 12, 2005 7:13 pm
Location: US

Post by Skara »

First, I wouldn't use /home. Bad idea. Make a /home/web if that's where you want it.
Second, you have to change both the DocumentRoot and the <Directory> tag. (they have to match.) ;)
Post Reply