Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's 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.
04-01-2011, 08:34 AM
#1
LQ Newbie
Registered: Mar 2004
Posts: 27
Rep:
apache permission?.Cant write jpg file on my localhost :(
Hello everybody.
I am using ubuntu 9.10 and i installed apache php mysql.I cant acces my project and getting the error message
403 forbidden .
Anyway i used this command
sudo chmod -R 755 /var/www and openned my page but my php script contains write images my drectory and getting this error
Warning: imagejpeg() [function.imagejpeg]: Unable to open './gallery/pm2_thumb.jpg' for writing: Permission denied in /var/www/gallery5/index.php on line 61
Note:
1.phpmyadmin and phpinfo() works.
2.Apache error logs:
[Fri Apr 01 12:24:49 2011] [notice] Apache/2.2.12 (Ubuntu) configured -- resuming normal operations
[Fri Apr 01 12:26:39 2011] [notice] caught SIGTERM, shutting down
[Fri Apr 01 12:27:23 2011] [notice] Apache/2.2.12 (Ubuntu) configured -- resuming normal operations
[Fri Apr 01 12:28:31 2011] [error] [client ::1] File does not exist: /var/www/favicon.ico
[Fri Apr 01 12:28:34 2011] [error] [client ::1] File does not exist: /var/www/favicon.ico
[Fri Apr 01 12:29:21 2011] [notice] caught SIGTERM, shutting down
[Fri Apr 01 12:29:27 2011] [notice] Apache/2.2.12 (Ubuntu) configured -- resuming normal operations
[Fri Apr 01 12:29:28 2011] [notice] Graceful restart requested, doing restart
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Fri Apr 01 12:29:28 2011] [notice] Apache/2.2.12 (Ubuntu) configured -- resuming normal operations
[Fri Apr 01 12:29:44 2011] [notice] caught SIGTERM, shutting down
[Fri Apr 01 12:29:45 2011] [notice] Apache/2.2.12 (Ubuntu) PHP/5.2.10-2ubuntu6.7 with Suhosin-Patch configured -- resuming normal operations
[Fri Apr 01 12:32:03 2011] [notice] caught SIGTERM, shutting down
[Fri Apr 01 12:32:05 2011] [notice] Apache/2.2.12 (Ubuntu) PHP/5.2.10-2ubuntu6.7 with Suhosin-Patch configured -- resuming normal operations
[Fri Apr 01 12:33:01 2011] [notice] caught SIGTERM, shutting down
[Fri Apr 01 12:33:02 2011] [notice] Apache/2.2.12 (Ubuntu) PHP/5.2.10-2ubuntu6.7 with Suhosin-Patch configured -- resuming normal operations
[Fri Apr 01 12:33:04 2011] [notice] Graceful restart requested, doing restart
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Fri Apr 01 12:33:05 2011] [notice] Apache/2.2.12 (Ubuntu) PHP/5.2.10-2ubuntu6.7 with Suhosin-Patch configured -- resuming normal operations
[Fri Apr 01 12:34:07 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.html denied
[Fri Apr 01 12:34:07 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.cgi denied
[Fri Apr 01 12:34:07 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.pl denied
[Fri Apr 01 12:34:07 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.php denied
[Fri Apr 01 12:34:07 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.xhtml denied
[Fri Apr 01 12:34:07 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.htm denied
[Fri Apr 01 12:34:50 2011] [notice] caught SIGTERM, shutting down
[Fri Apr 01 14:29:08 2011] [notice] Apache/2.2.12 (Ubuntu) PHP/5.2.10-2ubuntu6.7 with Suhosin-Patch configured -- resuming normal operations
[Fri Apr 01 14:29:35 2011] [error] [client ::1] File does not exist: /var/www/favicon.ico
[Fri Apr 01 14:29:35 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.html denied
[Fri Apr 01 14:29:35 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.cgi denied
[Fri Apr 01 14:29:35 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.pl denied
[Fri Apr 01 14:29:35 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.php denied
[Fri Apr 01 14:29:35 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.xhtml denied
[Fri Apr 01 14:29:35 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.htm denied
[Fri Apr 01 15:17:26 2011] [notice] caught SIGTERM, shutting down
[Fri Apr 01 15:19:03 2011] [notice] Apache/2.2.12 (Ubuntu) PHP/5.2.10-2ubuntu6.7 with Suhosin-Patch configured -- resuming normal operations
[Fri Apr 01 15:22:39 2011] [notice] caught SIGTERM, shutting down
[Fri Apr 01 15:22:40 2011] [notice] Apache/2.2.12 (Ubuntu) PHP/5.2.10-2ubuntu6.7 with Suhosin-Patch configured -- resuming normal operations
[Fri Apr 01 15:22:57 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.html denied
[Fri Apr 01 15:22:57 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.cgi denied
[Fri Apr 01 15:22:57 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.pl denied
[Fri Apr 01 15:22:57 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.php denied
[Fri Apr 01 15:22:57 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.xhtml denied
[Fri Apr 01 15:22:57 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.htm denied
[Fri Apr 01 15:23:12 2011] [notice] caught SIGTERM, shutting down
[Fri Apr 01 15:23:13 2011] [notice] Apache/2.2.12 (Ubuntu) PHP/5.2.10-2ubuntu6.7 with Suhosin-Patch configured -- resuming normal operations
[Fri Apr 01 15:33:38 2011] [notice] caught SIGTERM, shutting down
[Fri Apr 01 15:33:39 2011] [notice] Apache/2.2.12 (Ubuntu) PHP/5.2.10-2ubuntu6.7 with Suhosin-Patch configured -- resuming normal operations
[Fri Apr 01 15:33:43 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.html denied
[Fri Apr 01 15:33:43 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.cgi denied
[Fri Apr 01 15:33:43 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.pl denied
[Fri Apr 01 15:33:43 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.php denied
[Fri Apr 01 15:33:43 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.xhtml denied
[Fri Apr 01 15:33:43 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.htm denied
[Fri Apr 01 15:33:44 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.html denied
[Fri Apr 01 15:33:44 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.cgi denied
[Fri Apr 01 15:33:44 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.pl denied
[Fri Apr 01 15:33:44 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.php denied
[Fri Apr 01 15:33:44 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.xhtml denied
[Fri Apr 01 15:33:44 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.htm denied
[Fri Apr 01 15:33:47 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.html denied
[Fri Apr 01 15:33:47 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.cgi denied
[Fri Apr 01 15:33:47 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.pl denied
[Fri Apr 01 15:33:47 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.php denied
[Fri Apr 01 15:33:47 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.xhtml denied
[Fri Apr 01 15:33:47 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.htm denied
[Fri Apr 01 15:33:48 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.html denied
[Fri Apr 01 15:33:48 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.cgi denied
[Fri Apr 01 15:33:48 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.pl denied
[Fri Apr 01 15:33:48 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.php denied
[Fri Apr 01 15:33:48 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.xhtml denied
[Fri Apr 01 15:33:48 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.htm denied
[Fri Apr 01 15:35:09 2011] [notice] caught SIGTERM, shutting down
[Fri Apr 01 15:35:10 2011] [notice] Apache/2.2.12 (Ubuntu) PHP/5.2.10-2ubuntu6.7 with Suhosin-Patch configured -- resuming normal operations
[Fri Apr 01 15:35:13 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.html denied
[Fri Apr 01 15:35:13 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.cgi denied
[Fri Apr 01 15:35:13 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.pl denied
[Fri Apr 01 15:35:13 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.php denied
[Fri Apr 01 15:35:13 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.xhtml denied
[Fri Apr 01 15:35:13 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.htm denied
[Fri Apr 01 15:35:14 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.html denied
[Fri Apr 01 15:35:14 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.cgi denied
[Fri Apr 01 15:35:14 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.pl denied
[Fri Apr 01 15:35:14 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.php denied
[Fri Apr 01 15:35:14 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.xhtml denied
[Fri Apr 01 15:35:14 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.htm denied
[Fri Apr 01 15:35:14 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.html denied
[Fri Apr 01 15:35:14 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.cgi denied
[Fri Apr 01 15:35:14 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.pl denied
[Fri Apr 01 15:35:14 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.php denied
[Fri Apr 01 15:35:14 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.xhtml denied
[Fri Apr 01 15:35:14 2011] [error] [client ::1] (13)Permission denied: access to /gallery08Ben/index.htm denied
[Fri Apr 01 15:37:56 2011] [notice] caught SIGTERM, shutting down
[Fri Apr 01 15:37:57 2011] [notice] Apache/2.2.12 (Ubuntu) PHP/5.2.10-2ubuntu6.7 with Suhosin-Patch configured -- resuming normal operations
[Fri Apr 01 15:38:01 2011] [crit] [client ::1] (13)Permission denied: /var/www/gallery08Ben/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Fri Apr 01 15:38:01 2011] [crit] [client ::1] (13)Permission denied: /var/www/gallery08Ben/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Fri Apr 01 15:38:15 2011] [notice] Graceful restart requested, doing restart
[Fri Apr 01 15:38:16 2011] [notice] Apache/2.2.12 (Ubuntu) PHP/5.2.10-2ubuntu6.7 with Suhosin-Patch configured -- resuming normal operations
[Fri Apr 01 15:38:20 2011] [crit] [client ::1] (13)Permission denied: /var/www/gallery08Ben/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Fri Apr 01 15:40:26 2011] [crit] [client ::1] (13)Permission denied: /var/www/gallery08Ben/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Fri Apr 01 16:28:44 2011] [crit] [client ::1] (13)Permission denied: /var/www/gallery5/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Fri Apr 01 16:28:50 2011] [crit] [client ::1] (13)Permission denied: /var/www/gallery5/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Fri Apr 01 16:30:16 2011] [error] [client ::1] File does not exist: /var/www/gallery5/gallery/pm2_thumb.jpg, referer: http://localhost/gallery5/
Then i used this command again
sudo chmod -R 755 /var/www and nothing changed. Please help
04-01-2011, 08:50 AM
#2
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Hi,
The directory /var/www/gallery must be writable by the apache user. If I'm not wrong in ubuntu it's www-data, so you have to run:
Code:
chown -R www-data:www-data /var/www/gallery
Regards
04-01-2011, 09:09 AM
#3
LQ Newbie
Registered: Mar 2004
Posts: 27
Original Poster
Rep:
Quote:
Originally Posted by
bathory
Hi,
The directory /var/www/gallery must be writable by the apache user. If I'm not wrong in ubuntu it's www-data, so you have to run:
Code:
chown -R www-data:www-data /var/www/gallery
Regards
Thank you very much bathory, now my code is work.
but i don't understand
www-data:www-data .What is the mainilng?
Last edited by emrkar; 04-01-2011 at 09:20 AM .
04-01-2011, 10:30 AM
#4
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Glad to see it worked.
Apache runs as a not privileged user for security reasons. In ubuntu this user is www-data and belongs to group www-data. So if you want a script that is going to be run through apache to write in a directory, then the apache user must have write permissions in that directory. That's what the chown command does.
Since your question is answered, you can mark this thread "Solved" from "Thread tools" on top of the page.
Regards
04-01-2011, 10:34 AM
#5
LQ Newbie
Registered: Mar 2004
Posts: 27
Original Poster
Rep:
Quote:
Originally Posted by
bathory
Glad to see it worked.
Apache runs as a not privileged user for security reasons. In ubuntu this user is www-data and belongs to group www-data. So if you want a script that is going to be run through apache to write in a directory, then the apache user must have write permissions in that directory. That's what the chown command does.
Since your question is answered, you can mark this thread "Solved" from "Thread tools" on top of the page.
Regards
Thank you bathory.
All times are GMT -5. The time now is 10:19 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