Page 1 of 1
Super easy Apache question (newbie)
Posted: Sun Jun 05, 2005 5:04 pm
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
Posted: Sun Jun 05, 2005 5:07 pm
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.
Posted: Sun Jun 05, 2005 5:09 pm
by Burrito
or on a windows system:
c:\Program Files\Apache Group\Apache\htdocs
Posted: Sun Jun 05, 2005 5:27 pm
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 "e;F:/websites/localhost"e;
<Directory "e;F:/websites/localhost"e;>
AllowOverride All
Options All
</Directory>
</Virtualhost>
<VirtualHost *:80>
ServerName test
DocumentRoot "e;F:/websites/test"e;
<Directory "e;F:/websites/test"e;>
AllowOverride All
Options All
</Directory>
</Virtualhost>
Posted: Sun Jun 05, 2005 5:29 pm
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
Posted: Sun Jun 05, 2005 7:06 pm
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@">.'

Still doesn't work
Posted: Sun Jun 05, 2005 7:37 pm
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?
Posted: Mon Jun 06, 2005 11:24 am
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.)
