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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
06-02-2003, 01:09 AM
|
#1
|
LQ Newbie
Registered: May 2003
Posts: 6
Rep:
|
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?
|
|
|
06-02-2003, 08:34 AM
|
#2
|
LQ Guru
Registered: Jan 2001
Posts: 24,149
|
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
|
|
|
06-02-2003, 08:37 AM
|
#3
|
Senior Member
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503
Rep:
|
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.
|
|
|
06-02-2003, 11:10 AM
|
#4
|
Member
Registered: Apr 2002
Location: New York, USA
Distribution: Redhat 7.2, 9.0 Slackware 9.1
Posts: 428
Rep:
|
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.
|
|
|
06-02-2003, 11:20 AM
|
#5
|
LQ Guru
Registered: Jan 2001
Posts: 24,149
|
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.
|
|
|
06-02-2003, 11:50 AM
|
#6
|
Member
Registered: Apr 2002
Location: New York, USA
Distribution: Redhat 7.2, 9.0 Slackware 9.1
Posts: 428
Rep:
|
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
|
|
|
All times are GMT -5. The time now is 02:50 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|