LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 06-02-2003, 01:09 AM   #1
gfx
LQ Newbie
 
Registered: May 2003
Posts: 6

Rep: Reputation: 0
Managing website and Apache2


I finally got Apache2, PHP and mySQL installed on my computer for testing webpages I created.

having the documentroot at /var/www/html
What I found was that I can't write to this directory unless I'm root. I suppose I can always create my stuff, save them in my user directory, then move everything by su to root everytime.

But there's gotta be a better way!

I did a symlink from /home/mydirectory/web to /var/ww/html, but
I always receive a 403 error whenever I call anything from
localhost/web, even if all my files and the directory are set to
755.

any suggestions?
 
Old 06-02-2003, 08:34 AM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
By default, root will own these files and directories.

Change your permissions of the files and directories with the chmod command. And you could create a group that has write access to the files and directories, adding your user to that group.

Some helpful commands to know:

chmod
chown
chgrp
useradd
groupadd

Type man and then the command for man pages or you can view them here at http://man.linuxquestions.org

Some files to understand:

/etc/passwd
/etc/group
 
Old 06-02-2003, 08:37 AM   #3
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
I'm surprised you didn't recommend setting up sudo for this task. Any reason why? I know you and I have had the age old discussion of sudo vs. wheel group. Just want your opinion.
 
Old 06-02-2003, 11:10 AM   #4
cli_man
Member
 
Registered: Apr 2002
Location: New York, USA
Distribution: Redhat 7.2, 9.0 Slackware 9.1
Posts: 428

Rep: Reputation: 30
I would just do a "chown -R you.you /var/www/html and replace you with your username you are logged in as.

I take it from your first post this is not a production server as what I have just told you to do may not be the most secure but it will be the easyest way of doing it, I wouldn't mess with the symlink to it.
 
Old 06-02-2003, 11:20 AM   #5
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
Quote:
Originally posted by Crashed_Again
I'm surprised you didn't recommend setting up sudo for this task. Any reason why? I know you and I have had the age old discussion of sudo vs. wheel group. Just want your opinion.
I'm not sure if your directing this to me but one reason I wouldn't setup sudo for a task like this is usually when it comes to using web editing for your server, I prefer the setup your own user and group that has ownership over these files. Though you could setup sudo, but why bother if you have a user who already has these privileges to edit the content on the webserver.
Like my webserver, I have my own specific user and group they belong to for access to edit the content of my site. This way it doesn't mess with sudo and any extra steps to do simple tasks, etc.
I setup sudo when I want to give a user access to commands that maybe only root has, but not wanting to give out root access.. etc.
 
Old 06-02-2003, 11:50 AM   #6
cli_man
Member
 
Registered: Apr 2002
Location: New York, USA
Distribution: Redhat 7.2, 9.0 Slackware 9.1
Posts: 428

Rep: Reputation: 30
I know this is off topic but, since this thread seems to be going to sudo, how big are the security problems with this? I Have a script I would like to call from my webserver and it needs to be run as the qmail user. Could I make sudo be able to just run that script and nothing else and be called from the user nobody?

When I was looking at that it seemed to be to insecure for me. I opted to have the script be called from cron to pull the data from my mysql database so that the user nobody isn't really involved
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache2: LAN machines cannot access website Akhran Linux - Newbie 1 10-13-2005 05:39 AM
Apache2 apache2-common WebDav timgerr Linux - Networking 1 08-25-2005 09:41 PM
Managing a Website - Uploading Files BionicJoe Linux - Software 1 02-11-2005 02:37 AM
Managing FTP trough Website Emzer Linux - Software 2 10-23-2004 02:28 PM
how to uninstall apache2 which is installed by emerge apache2 flybirdlong Linux - Software 1 07-17-2004 11:46 AM


All times are GMT -5. The time now is 03:36 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration