Results 1 to 10 of 19
Thread: apache var/www permissions
|
Enjoy an ad free experience by logging in. Not a member yet? Register.
|
|
-
04-29-2011 #1
- Join Date
- Apr 2011
- Posts
- 10
apache var/www permissions
not sure where to put this as it is a ditro wide issue, but just so we know what one i have, i posted it here
i do a lot of php programing so of course the first thing i wanted to do was get apache and php installed
worked great! got the WORKS page when running local host and php info showed up as it is supposed to.
now the problem is that
/etc/httpd folder does not exist???
and when i open my editor - the other thing i wnated to do was copy my projects over to the /var/www folder. that gives me a permission error.
so
1. where could the /etc/httpd fold have been placed? and how can i retrieve/ move it etc..
2. how do i fix the permissions? i currently set the var folder to 755
this is one thing i remembered fromdays old about linux, very "permission" oriented, so am nost used to it. /sigh
thank you for any help
-
04-29-2011 #2
You'll have to look around in /etc if its not in /etc/httpd/. Could be /etc/apache or /etc/apache2 or something similar.
Regarding the permissions, 755 should be fine for /var but you're trying to get to /var/www. What are the permissions on that directory?
-
04-29-2011 #3
- Join Date
- Apr 2011
- Posts
- 10
hi thanks for the quick response
all i am trying to do is work in www so just need to be able to save files and create folders as needed (w/o being constantly being a root users)
ps
how do you check the permissions? in windows you just do attr or dir.. if i do "ls" it just gets a list of whats there
-
04-29-2011 #4
- Join Date
- Apr 2011
- Posts
- 10
ok first found the apache2 folder.
puzzle: doesnt look anything like my windows apache, my httpd.conf file is emply there is no conf folder. is this a bar bones
ref.
howtoforge.com/ubuntu_lamp_for_newbies
-
04-29-2011 #5
To check permissions on /var/www you'd issue:
Code:ls -ld /var/www/
-
04-29-2011 #6
I think it will require an httpd.conf to start correctly but I've never experimented with that.
What user are you trying to view the directory as?
I find it unlikely that apache would start without any httpd.conf. How did you install apache? From source, or from a dpkg/rpm?
-
04-29-2011 #7
- Join Date
- Apr 2011
- Posts
- 10
-
04-29-2011 #8
- Join Date
- Apr 2011
- Posts
- 10
-
04-29-2011 #9
- Join Date
- Apr 2011
- Posts
- 10
here is an option i tried but it is not working so not sure if i am missing something. i
mkdir ~/public_html
sudo ln -s ~public_html /var/www/$USER
then made a test.php in public_html.
did not work..so is the $USER a var that i should fill in my name?
i figure this way i can edit files and create folders w/o having to be root
EDIT:
the link worked the $USER = equals my username
Code:localhost/klyxmaster/test.php
and i can edit
but still any info you can give on the permission would great for future referenceLast edited by klyxmaster; 04-29-2011 at 04:38 PM.
-
04-29-2011 #10
$USER is the username. If youre logged in as root is will be root.
Try:
Code:whoami
To write files to /var/www as a user other than root, the permissions are missing.
Do you want a user to write files there or root? If a user, you have a few options:
1. Add the user to a group (called www for example), change the group owner of the directory to www (or whatever) and set the permissions to 775 on /var/www.
a. This is done by:
Code:groupadd www chown -R :www /var/www chmod -R 775 /var/www
Code:chmod -R 777 /var/www/
Is this a box that will be used for development or are you using this also for production or actually serving up the PHP scripts?