LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-25-2004, 07:39 PM   #1
nivek7
Member
 
Registered: Mar 2004
Distribution: Slackware 9.1
Posts: 69

Rep: Reputation: 15
Letting normal user change apache directory


I want to fool around with making websites but i dont want to have to log into root to change the files in /var/www/htdocs. is there a way of letting a normal user to change etc. the stuff in there? im running slackware 9.1 btw
 
Old 03-25-2004, 07:56 PM   #2
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
The easiest - and safest - way is probably to user userdirs. With this setup a user can create a directory called public_html in his home directory and access it through http://yourhostname/~username. It usually works very well - check your Apache setup, the userdir might be set to something else than the standard ~/public_html.

If you absolutely must use the global html directory you can create a new group, change the ownership of the html directory and all subdirectories and files to this new group and then add users who should have access to this group.


Håkan
 
Old 03-25-2004, 10:50 PM   #3
nivek7
Member
 
Registered: Mar 2004
Distribution: Slackware 9.1
Posts: 69

Original Poster
Rep: Reputation: 15
sorry for being a noob, but how do you set up userdir?
 
Old 03-26-2004, 01:06 AM   #4
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
It might already been setup by default installation of apache (I think debian is like that, don't know about SuSE though). Try what hw-tph said and see if that worked or not. If it didn't, you need to have a play at your apache conf file (httpd.conf).

-twantrd
 
Old 03-26-2004, 06:56 PM   #5
nivek7
Member
 
Registered: Mar 2004
Distribution: Slackware 9.1
Posts: 69

Original Poster
Rep: Reputation: 15
is there a script i can use to redirect all traffic from my http://blehbleh.bleh to http://blehbleh.bleh/~bleh?
 
Old 03-26-2004, 07:18 PM   #6
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
Sure, put an index.html in your webserver's document root with a Javascript refresh that takes the visitor to the other location. Examples are all over the web - start looking at the web design sites and tutorials. You don't have to do any fancy redirections by reconfiguring the server.


Håkan
 
Old 03-27-2004, 07:40 PM   #7
nivek7
Member
 
Registered: Mar 2004
Distribution: Slackware 9.1
Posts: 69

Original Poster
Rep: Reputation: 15
one more thing, how do i make it so that http://blehbleh/~user goes to http://blehbleh/~user/index.php instead of giving me a forbidden error?
 
Old 03-27-2004, 07:50 PM   #8
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
Hi,

1. If you are getting a 'forbidden' error that means you have permission problems. You need to change your permissions to allow access.

2.
Quote:
how do i make it so that http://blehbleh/~user goes to http://blehbleh/~user/index.php
First off, you do have php support built in apache right? Ok, assuming you do so, it should automatically pick up the index.php from "http://blehbleh/~user" as long as you placed index.php in your Directory Index (and that you do not have 'index.html' in that same folder).


-twantrd
 
Old 03-27-2004, 07:54 PM   #9
nivek7
Member
 
Registered: Mar 2004
Distribution: Slackware 9.1
Posts: 69

Original Poster
Rep: Reputation: 15
when i go to http://blehbleh/~user/index.php it works fine, its just when i go to http://blehbleh/~user/ it gives me this:
403 Forbidden
You don't have permission to access /~user/ on this server.

oh, and when i go to http://blehbleh it goes to index.html

Last edited by nivek7; 03-27-2004 at 07:56 PM.
 
Old 05-04-2004, 06:58 PM   #10
SerfurJ
Member
 
Registered: May 2003
Posts: 80

Rep: Reputation: 15
in your apache config file:

Code:
<IfModule mod_dir.c>
    DirectoryIndex index.html index.php
</IfModule>
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Suse 10 not letting user login raxxal SUSE / openSUSE 59 05-23-2006 05:24 PM
How can change user profile directory reply2vinay Linux - Security 3 09-02-2005 08:33 AM
How to change MAC without letting eth0 down? htlin Programming 3 07-05-2005 12:42 PM
Running jsps in user home directory doesn't work (Apache Tomcat and mod_userdir) jimieee Linux - Networking 0 03-23-2005 10:12 AM
Apache user directory permissions AMMullan Linux - Software 11 12-23-2004 01:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:40 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