Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 12th July 2009, 11:59
X-admin X-admin is offline
Member
 
Join Date: Jun 2009
Posts: 31
Thanks: 8
Thanked 0 Times in 0 Posts
Default 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????
Reply With Quote
Sponsored Links
  #2  
Old 13th July 2009, 00:11
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 34,647
Thanks: 794
Thanked 5,003 Times in 3,912 Posts
Default

This is no ISPConfig bug.

1) Which ISPConfig version?
2) Where exactly did you upload the files?
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
X-admin (13th July 2009)
  #3  
Old 13th July 2009, 04:27
X-admin X-admin is offline
Member
 
Join Date: Jun 2009
Posts: 31
Thanks: 8
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by till View Post
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?
Reply With Quote
  #4  
Old 13th July 2009, 08:28
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 34,647
Thanks: 794
Thanked 5,003 Times in 3,912 Posts
Default

Which permissions do the files hae. Please post a "ls -la" output for the php and the jpeg file.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 13th July 2009, 08:47
X-admin X-admin is offline
Member
 
Join Date: Jun 2009
Posts: 31
Thanks: 8
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by till View Post
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
Reply With Quote
  #6  
Old 13th July 2009, 15:25
_X_ _X_ is offline
Senior Member
 
Join Date: Oct 2008
Posts: 247
Thanks: 8
Thanked 37 Times in 35 Posts
Default

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

Last edited by _X_; 13th July 2009 at 15:28.
Reply With Quote
  #7  
Old 13th July 2009, 15:29
_X_ _X_ is offline
Senior Member
 
Join Date: Oct 2008
Posts: 247
Thanks: 8
Thanked 37 Times in 35 Posts
Default

Quote:
Originally Posted by X-admin View Post
-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"?
Reply With Quote
The Following User Says Thank You to _X_ For This Useful Post:
X-admin (13th July 2009)
  #8  
Old 13th July 2009, 16:44
X-admin X-admin is offline
Member
 
Join Date: Jun 2009
Posts: 31
Thanks: 8
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by _X_ View Post
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.....
Thanks X very much
Reply With Quote
  #9  
Old 13th July 2009, 17:04
X-admin X-admin is offline
Member
 
Join Date: Jun 2009
Posts: 31
Thanks: 8
Thanked 0 Times in 0 Posts
Unhappy

Quote:
Originally Posted by _X_ View Post
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?
Reply With Quote
  #10  
Old 13th July 2009, 20:48
_X_ _X_ is offline
Senior Member
 
Join Date: Oct 2008
Posts: 247
Thanks: 8
Thanked 37 Times in 35 Posts
 
Default

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.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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

Forum Jump


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


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