Problem with 403 error and 404 error

Discussion in 'General' started by X-admin, Jul 12, 2009.

  1. X-admin

    X-admin New Member

    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????
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    This is no ISPConfig bug.

    1) Which ISPConfig version?
    2) Where exactly did you upload the files?
     
  3. X-admin

    X-admin New Member

    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?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

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

    X-admin New Member

    -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
     
  6. _X_

    _X_ New Member

    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: Jul 13, 2009
  7. _X_

    _X_ New Member

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

    X-admin New Member

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

    X-admin New Member

    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?
     
  10. _X_

    _X_ New Member

    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.
     
  11. _X_

    _X_ New Member

  12. _X_

    _X_ New Member

    although I have made additional changes to my Joomla directives so it looks something like this:

    <Directory "/var/www/webXXX/web">
    Options FollowSymLinks
    php_admin_flag register_globals Off
    php_admin_value disable_functions "show_source system shell_exec passthru exec phpinfo popen proc_open"
    php_admin_flag allow_url_fopen Off
    php_admin_flag magic_quotes_gpc On
    php_admin_value session.save_path "/var/www/webXXX/phptmp"
    php_admin_value open_basedir "/var/www/webXXX/"
    php_admin_value memory_limit 24M
    </Directory>

    change webXXX to your values. also if needed more memory by Joomla increase 24M to 30M.
     
  13. X-admin

    X-admin New Member

    Specially thanks _X_. I understand much more
     

Share This Page