LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-09-2004, 07:19 AM   #1
msegedy
LQ Newbie
 
Registered: Jul 2004
Posts: 5

Rep: Reputation: 0
Yes, but I need more information.


I'm trying to get my website working on my Apache server. I read a reply on moving a website from the var/www/html directory to another directory. The message read that the httpd.conf needed to be modified to show the new path. The advice for Apache server was: "You need to change the DocumentRoot which defines the physical path on your machine where files are served from. Right now it's probably set for /var/www/html, but you can change this to whatever you want.
In my case, I'm doing it with /home/username/www/html."

I modified the httpd.conf and the httpd-perl-conf files according to the above, but when I try to access my site it still pulls up the old site located at var/www/html. Are there other conf files that need modified?
 
Old 07-09-2004, 12:26 PM   #2
Peacedog
LQ Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,296

Rep: Reputation: 168Reputation: 168
hi msegedy, welcome to lq. i don't know if this will help at all, but have you tried clearing your cache from the browser your trying to access the site with.
 
Old 07-09-2004, 02:33 PM   #3
charon79m
Member
 
Registered: Oct 2003
Distribution: Just about anything... so long as it is Debain based.
Posts: 297

Rep: Reputation: 30
Other things to try are to reload apache:

/etc/init.d/httpd restart

or:
/etc/init.d/apache restart

Also, inside the httpd.conf there is another line below the document root line that needs altered. Here is the way it looks in a default httpd.conf:
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/var/www/html"

#
# 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 "/var/www/html">


Again, once the changes are made you will NEED to reload Apache to make the changes go into affect.

Cheers!

MrKnisely
 
Old 07-10-2004, 09:37 AM   #4
msegedy
LQ Newbie
 
Registered: Jul 2004
Posts: 5

Original Poster
Rep: Reputation: 0
Problem modifying httpd.conf

MrKnisely,

Thanks for taking the time to lead a newbee. I tried your suggestions but had a few problems. First, the modification of the lines for the Directory can not be done within the httpd.conf. These lines and instructions are included in a file called commonhttpd.conf.

Also, in this file the code reads:
#</Directory>

#Restricted set of options
<Directory />
Options -All -Multiviews
AllowOverride None
<IfModule mod_access.c>
Order deny, allow
Deny from all
</IfModule>
</Directory>

# Note that..."

#UserDir: The name of the directory which is appended onto a user's home
"commonhttpd.conf" 1016L, 32346C


Above is the entire information in the commonhttpd.conf file.

When you suggest "This should be changed to whatever you set DocumentRoot to.
#
<Directory "/var/www/html">" how do I write this in? I notice that there is no "/" before directory and that there are also quotation marks around the url. I tried writing it both ways, and no luck.

Please keep in mind, I'm new to this, so if I appear real stupid, please make an allowance.

Cheers


When
 
Old 07-10-2004, 08:05 PM   #5
msegedy
LQ Newbie
 
Registered: Jul 2004
Posts: 5

Original Poster
Rep: Reputation: 0
I reconfigured directory root in a file called httpd2.conf and now the server tries to call up the web files where I want it to, but now when I go to pull up pages I get "Forbidden. You don't have permission to access " " on this server. Now where do I go? Help!
 
Old 07-10-2004, 11:26 PM   #6
charon79m
Member
 
Registered: Oct 2003
Distribution: Just about anything... so long as it is Debain based.
Posts: 297

Rep: Reputation: 30
Permissions... the short of it (Post if you need more...)

If I had to guess the user that Apache is running as does not have read access to that directory.

Do you know who Apache is running as? On some systems it is apache, othes it's web, some it's www-data.

On my RedHat box it is apache. What you will need to do is give the user that is running apache rights to that directory. If you need help with determing who Apache is running as, or how to change file permissions, just let me know or do a quick search on LinuxQuestions and man chmod... I'm sure this has been covered.

Cheers!

MrKnisely
 
Old 07-11-2004, 11:28 AM   #7
msegedy
LQ Newbie
 
Registered: Jul 2004
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks MrKnisely for your quick reply. I'm new at Linux- just a couple weeks into it. So, I get eaasily lost. I've located the website in "home/michael/html" Michael is the user of course. If I change the url of the directory back to var/www/html and use the website that I left there, the pages can be accessed overt he web. The way it stands now in home/michael/html, I don't have permission to view the pages. I'm using Mandrake and when I look at the properties thorugh the GUI of Home/Michael/User the privileges are open to user, group and other- so right now wide open. I can't remember how to pull up the privileges for a directory in the terminal window. I remember chmod and then an ls -1 but it doesn't seem to work- so I'm stuck back with the Gui of Mandrake. Though I can't pull up my pages in home/michael/html, the ftp works fine. ANy help you can give me I'd appreciate. I'm just trying to get the server set likeI need it before leaving Peru for Taipei in a week. I'm going to teach a 3D class at the American School there and just wanted to have and operate my own server for the materials I'll be using and to post student work.

who Apache is running as, or how to change file permissions, just let me know
 
Old 07-11-2004, 11:37 AM   #8
msegedy
LQ Newbie
 
Registered: Jul 2004
Posts: 5

Original Poster
Rep: Reputation: 0
MrKnisely, one other small question maybe you can help me with. I was playing with creating users and want to delete the old users directories in home but though I have removed them through KDE's GUI, they still come up in the terminal window and rmdir won't let me remove the entire directories until the sub-directories are removed. Then I can't remove the Trash directory- I keep getting not empty. Is there some way to remove the directories (force it) and all the subs? In the first posting I meant to say that I was using KDE as the GUI not Mandrake. Shows how much of a newbee I am!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Just for information jayakrishnan Linux - General 3 05-26-2007 08:06 PM
Help me, Please... i want information. mork_Thai Slackware 4 09-23-2005 12:10 PM
Need some information ahsan_94 Linux - Newbie 4 06-27-2004 02:34 AM
little information for the q joesbox Linux - General 13 04-25-2003 12:06 PM
More Information gutter007 Linux - General 2 01-31-2001 07:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration