HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   General (http://www.howtoforge.com/forums/forumdisplay.php?f=15)
-   -   Problem with 403 error and 404 error (http://www.howtoforge.com/forums/showthread.php?t=37372)

X-admin 12th July 2009 11:59

Problem with 403 error and 404 error
 
After uploading web data, my joomla web run normally. But when i upload a .php file (shell.php) from Web-FTP in ISP Panel, and browse in Firefox: http://mysite/shell.php it show 404 error: The requested URL was not found on this server.
Agian, I upload a new .jpeg file like that, browses and get 403 error: You are not permitted to access the requested URL
Login server, i see those file have been chowned. Unluckily, when browses they are unvailable
Who know the problem i encounter?? Is this ISPConfig bug????

till 13th July 2009 00:11

This is no ISPConfig bug.

1) Which ISPConfig version?
2) Where exactly did you upload the files?

X-admin 13th July 2009 04:27

Quote:

Originally Posted by till (Post 198047)
This is no ISPConfig bug.

1) Which ISPConfig version?
2) Where exactly did you upload the files?

Thanks till for Reply
My ISPConfig version is 2.2.32
I upload these files to /web directory from ftp-web.
Have you got any idea?

till 13th July 2009 08:28

Which permissions do the files hae. Please post a "ls -la" output for the php and the jpeg file.

X-admin 13th July 2009 08:47

Quote:

Originally Posted by till (Post 198058)
Which permissions do the files hae. Please post a "ls -la" output for the php and the jpeg file.

-rwxrwx--- 1 web1_ftp web1 9090 Jul 12 16:47 slax1.jpeg
and
-rwxrwxr-x 1 web2_ftp web2 105540 Jul 12 16:15 shell.php

So, i have no ideas

_X_ 13th July 2009 15:25

well
slax1.jpeg has no public read rights.
-rwxrwx--- should be -rwxrwxr-- but buch better -rw-r--r--
as far as i can see

shell.php:
-rwxrwxr-x should be 644 or -rw-r--r--
no php script should be set like this as far as i know. at least when it comes to joomla.

when it comes to joomla:
all files should be 644 or -rw-r--r--
all folders should be 755 or (d)rwxr-xr-x

also almost all folders and files should be owned by www-data:www-data (user:group) so only apache can access those files. only some folders in images folder should be own by web1_ftp:web1 so images can be uploaded by ftp user.

to correct ownership of files type in console (SSH):
cd /var/www/web1
chown -R -v -f www-data:www-data/*

to set ownership of files and folders in images folder:
cd /var/www/web1/images
chown -R -v -f web1_ftp-web1:web1_ftp-web1/*

this should be done from root account in SSH. in case of Ubuntu you should add "sudo" in front of every command line. for example:
sudo cd /var/www/web1/images
sudo chown -R -v -f web1_ftp-web1:web1_ftp-web1/*

to change all folders to 755 (also as root user):
cd /var/www/web1
find * -type d | while read var1; do chmod 755 "$var1"; done

to change all files to 644 (also as root user):
cd /var/www/web1
find * -type f | while read var1; do chmod 644 "$var1"; done

if i typed it correctly :)

_X_ 13th July 2009 15:29

Quote:

Originally Posted by X-admin (Post 198063)
-rwxrwx--- 1 web1_ftp web1 9090 Jul 12 16:47 slax1.jpeg
and
-rwxrwxr-x 1 web2_ftp web2 105540 Jul 12 16:15 shell.php

So, i have no ideas

also shell.php is owned by web2 user and slax.jpeg by web1 user. those are users from two different "sites"?

X-admin 13th July 2009 16:44

Quote:

Originally Posted by _X_ (Post 198086)
also shell.php is owned by web2 user and slax.jpeg by web1 user. those are users from two different "sites"?

Oh, wonderful. I understand. These rules i have never care so.....:confused:
Thanks X very much

X-admin 13th July 2009 17:04

Quote:

Originally Posted by _X_ (Post 198085)
also almost all folders and files should be owned by www-data:www-data (user:group) so only apache can access those files. only some folders in images folder should be own by web1_ftp:web1 so images can be uploaded by ftp user.

to correct ownership of files type in console (SSH):
cd /var/www/web1
chown -R -v -f www-data:www-data/*

to set ownership of files and folders in images folder:
cd /var/www/web1/images
chown -R -v -f web1_ftp-web1:web1_ftp-web1/*

Dear _X_!
i don't know about this quote. who www-data:www-data any else? I think there is only a user:group is web1_ftp:web1 for each directory and file in /web
apache user is in group web1?

_X_ 13th July 2009 20:48

No www-data:www-data is user:group that Apache/SuExec uses to access file system - if I explained it correctly.

Bottom line is:
If you want to install modules/components/extensions in Joomla you should have all your folders and files chown-ed to www-data:www-data.
Except images folder where you will upload pictures - this folder can be web1_ftp-web1:web1_ftp-web1

If installation from zip files doesn’t work you can unpack desired extension in some folder and go with install from directory procedure.
This depends what Joomla are you using and what Linux distribution have you installed.


All times are GMT +2. The time now is 11:54.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.