All websites 500 error

Discussion in 'General' started by anthonywang, Jun 9, 2016.

  1. anthonywang

    anthonywang Member

    because for webiste folder permissions reason,i use ssh to add this command:
    Code:
    sudo chown -R www-data /var/www
    
    but after do this,my all website get 500 error,and i can't connect ispconfig backendInternal,it's become Internal Server Error 500 too

    then i tried these command want to restore,but not work
    Code:
    sudo chown -R root /var/www
    
    i don't know what can i do now,this is very important to me,please help,many thanks!

    UPDATE

    when i check the group:
    Code:
    root@server:~# ls -la /var/www
    total 32
    drwxrwxr-x 7 root www-data 4096 Jun 8 22:27 .
    drwxr-xr-x 14 root root 4096 Sep 24 2015 ..
    lrwxrwxrwx 1 root root 31 Dec 18 12:14 mywebsite.com -> /var/www/clients/client0/web35/
    lrwxrwxrwx 1 root root 31 Mar 17 16:04 mywebsite.com -> /var/www/clients/client0/web40/
    drwxr-xr-x 2 root ispapps 4096 Sep 23 2015 apps
    lrwxrwxrwx 1 root root 31 Oct 6 2015 mywebsite.com -> /var/www/clients/client0/web20/
    drwxr-xr-x 5 root root 4096 Oct 1 2015 clients
    drwxr-xr-x 17 root root 4096 Jun 8 20:57 conf
    lrwxrwxrwx 1 root root 31 Oct 25 2015 mywebsite.com -> /var/www/clients/client2/web31/
    lrwxrwxrwx 1 root root 31 Nov 25 2015 mywebsite.com -> /var/www/clients/client2/web34/
    lrwxrwxrwx 1 root root 31 Sep 29 2015 mywebsite.com -> /var/www/clients/client0/web11/
    -rw-r--r-- 1 root root 177 Sep 23 2015 index.html
    lrwxrwxrwx 1 root root 34 Sep 23 2015 ispconfig -> /usr/local/ispconfig/interface/web
    lrwxrwxrwx 1 root root 31 May 28 05:12 mywebsite.com -> /var/www/clients/client0/web44/
    lrwxrwxrwx 1 root root 31 Sep 30 2015 mywebsite.com -> /var/www/clients/client0/web15/
    lrwxrwxrwx 1 root root 31 Oct 6 2015 mywebsite.com -> /var/www/clients/client0/web19/
    drwxr-xr-x 16 root root 4096 Jun 8 22:27 php-fcgi-scripts
    lrwxrwxrwx 1 root root 31 Jun 8 22:27 mywebsite.com -> /var/www/clients/client0/web47/
    lrwxrwxrwx 1 root root 31 Oct 15 2015 mywebsite.com -> /var/www/clients/client0/web23/
    lrwxrwxrwx 1 root root 31 Oct 6 2015 mywebsite.com -> /var/www/clients/client0/web18/
    drwxr-xr-x 2 root root 4096 Jun 8 07:35 webalizer
    
    and when i check apache uses
    Code:
    root@server:~# ps aux | grep apache
    root 2459 0.0 3.4 79232 17992 ? Ss Jun08 0:00 /usr/sbin/apach e2 -k start
    www-data 2468 0.0 0.9 31180 4752 ? S Jun08 0:00 /usr/sbin/apach e2 -k start
    www-data 2500 0.0 2.3 80032 12288 ? S Jun08 0:00 /usr/sbin/apach e2 -k start
    www-data 2501 0.0 2.4 80040 12388 ? S Jun08 0:00 /usr/sbin/apach e2 -k start
    www-data 2502 0.0 2.4 80040 12356 ? S Jun08 0:00 /usr/sbin/apach e2 -k start
    www-data 2503 0.0 2.3 80040 12332 ? S Jun08 0:00 /usr/sbin/apach e2 -k start
    www-data 2504 0.0 2.3 80032 12312 ? S Jun08 0:00 /usr/sbin/apach e2 -k start
    www-data 4338 0.0 2.3 80044 12308 ? S Jun08 0:00 /usr/sbin/apach e2 -k start
    www-data 4846 0.0 2.2 79900 11812 ? S 00:03 0:00 /usr/sbin/apach e2 -k start
    root 5523 0.0 0.1 3556 760 pts/0 S+ 00:28 0:00 grep apache
    
    try again and still not working
    Code:
    root@server:~# sudo chown -R root:root /var/www
    chown: changing ownership of `/var/www/clients/client0/web35': Operation not per mitted
    chown: changing ownership of `/var/www/clients/client0/web20': Operation not per mitted
    chown: changing ownership of `/var/www/clients/client0/web18': Operation not per mitted
    chown: changing ownership of `/var/www/clients/client0/web19': Operation not per mitted
    chown: changing ownership of `/var/www/clients/client0/web47': Operation not per mitted
    chown: changing ownership of `/var/www/clients/client0/web40': Operation not per mitted
    chown: changing ownership of `/var/www/clients/client0/web44': Operation not per mitted
    chown: changing ownership of `/var/www/clients/client0/web15': Operation not per mitted
    chown: changing ownership of `/var/www/clients/client0/web23': Operation not per mitted
    chown: changing ownership of `/var/www/clients/client0/web11': Operation not per mitted
    chown: changing ownership of `/var/www/clients/client2/web34': Operation not per mitted
    chown: changing ownership of `/var/www/clients/client2/web31': Operation not per
    
     
  2. anthonywang

    anthonywang Member

    tried
    Code:
    root@server:~# chattr -ais /var/www
    
    root@server:~# ls -la
    total 52
    drwx------  4 root root  4096 Oct 11  2015 .
    drwxr-xr-x 22 root root  4096 Jun  9 03:49 ..
    drwx------  2 root root  4096 May  3  2013 .aptitude
    -rw-r--r--  1 root root 12045 Jun  9 03:48 .bash_history
    -rw-r--r--  1 root root   570 Jan 31  2010 .bashrc
    -rw-------  1 root root   348 Oct 11  2015 .mysql_history
    -rw-------  1 root root    46 Oct 11  2015 .nano_history
    -rw-r--r--  1 root root   140 Nov 19  2007 .profile
    -rw-------  1 root root  1024 Sep 23  2015 .rnd
    drwx------  2 root root  4096 Sep 23  2015 .ssh
    -rw-------  1 root root   839 Oct 11  2015 .viminfo
    
    
    
    it's owner back to root,but webiste and ispconfig admin panel still get error 500

    I found i can login phpmyadmin by www.domainname.com/phpmyadmin and nothing wrong,but website and ispconfig admin panel still error 500
     
    Last edited: Jun 9, 2016
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    The permissions in /var/www are correct by default, do not alter them. If you want a script to be able to write into the web folder, then just enable the suexec checkbox for the website. Never try to run a chown -r on /var/www as this must break the whole servers. The folders in /var/www are also not owned by root, they are owned by many different users so you can not fix your mistake with a chown to root.

    If you have a backup of /var/www, then the easiest way might be to restore your backup to fix the issue. If you don't have a backup, then you have to fix the websites one by one.

    Example for web35:

    chattr -i /var/www/clients/client0/web35
    chown -R web35:client0 /var/www/clients/client0/web35/cgi-bin
    chown root:root /var/www/clients/client0/web35/log
    chown -R root:root /var/www/clients/client0/web35/ssl
    chown -R web35:client0 /var/www/clients/client0/web35/private
    chown -R web35:client0 /var/www/clients/client0/web35/web
    chown -R web35:client0 /var/www/clients/client0/web35/webdav
    chattr +i /var/www/clients/client0/web35
     
  4. anthonywang

    anthonywang Member

    Hello Tills,
    thanks for quick support,i tried your code every website one by one,then restart apache and mysql,but still get http 500 error,is it possible reinstall ispconfig and no lost website and database?

    chattr -i /var/www/clients/client0/web35
    chown -R web35:client0 /var/www/clients/client0/web35/cgi-bin
    chown root:root /var/www/clients/client0/web35/log
    chown -R root:root /var/www/clients/client0/web35/ssl
    chown -R web35:client0 /var/www/clients/client0/web35/private
    chown -R web35:client0 /var/www/clients/client0/web35/web
    chown -R web35:client0 /var/www/clients/client0/web35/webdav
    chattr +i /var/www/clients/client0/web35
    BLA BLA BLA......
    service apache2 restart
    service mysql restart


    Best Regards.,
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    No. But you can run a update and let the updater reconfigure the services. If you then still get 500 errors, then check the log file for the exact error messages and fix them.
     
  6. anthonywang

    anthonywang Member

    really confuse me,the update stop at backup option,whatever i choice yes or no,it's will stop and nothing happen


    --------------------------------------------------------------------------------
    _____ ___________ _____ __ _ ____
    |_ _/ ___| ___ \ / __ \ / _(_) /__ \
    | | \ `--.| |_/ / | / \/ ___ _ __ | |_ _ __ _ _/ /
    | | `--. \ __/ | | / _ \| '_ \| _| |/ _` | |_ |
    _| |_/\__/ / | | \__/\ (_) | | | | | | | (_| | ___\ \
    \___/\____/\_| \____/\___/|_| |_|_| |_|\__, | \____/
    __/ |
    |___/
    --------------------------------------------------------------------------------


    >> Update

    Operating System: Debian 7.0 (Wheezy/Sid) or compatible

    This application will update ISPConfig 3 on your server.

    Shall the script create a ISPConfig backup in /var/backup/ now? (yes,no) [yes]:
     

Share This Page