403 error - template file

Discussion in 'Installation/Configuration' started by Stelios, Nov 12, 2020.

Tags:
  1. Stelios

    Stelios Active Member HowtoForge Supporter

    Hi,
    May I ask please where can I find the template file for the 403 error page of ISPconfig?
    I want to display the same text/layout for all sites that are hosted across multiple servers.
    Which file do I need to modify?

    Thanks
     
  2. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    The original files are in /usr/local/ispconfig/server/conf/error/en
    (or if you use a different language for the people, for example french, /usr/local/ispconfig/server/conf-custom/error/fr)
    You can copy these to /usr/local/ispconfig/server/conf-custom/error/en so they aren't overwritten when updating ISPConfig.
     
  3. Stelios

    Stelios Active Member HowtoForge Supporter

    Thanks Thom.
     
    Th0m likes this.
  4. Stelios

    Stelios Active Member HowtoForge Supporter

    Thom what do I need to run after the change to make it work as I've uploaded the documents to the conf-custom but it still shows the old files.
     
  5. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Run Tools | Sync Tools | Resync?
    If that does not help, then force reconfigure services?
     
  6. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    You have to run a resync indeed, as the files are copied when creating the web. That should copy them. If not, copy them manually.
     
  7. Stelios

    Stelios Active Member HowtoForge Supporter

    I'm sorry but is not clear to me. What to rsync?
    I copied all files under the /usr/local/ispconfig/server/conf-custom/error/en in all web servers (4 total).
    When I go to Tools | Sync Tools | Resync what should I check from the list?
     
  8. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Tools -> Resync -> Websites

    Though I'm not sure if it will copy the new files, there is a good possibility that it only regenerates the vhost file.

    If that doesn't work, you have to copy them manually:
    Code:
    cp /usr/local/ispconfig/server/conf-custom/error/en/* /var/www/clients/*/*/web/error/
    For all new websites, the conf-custom error files will be used.
     
  9. Stelios

    Stelios Active Member HowtoForge Supporter

    I just did it but it doesn't sync to the existing sites which is what I need it to be honest.
     
  10. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Use the command I posted before.
     
  11. Stelios

    Stelios Active Member HowtoForge Supporter

    It doesn't work.
    I throws:
    cp: -r not specified; omitting directory '/var/www/clients/client1/web21/web/error/'
    and doesn't ovewrite/copy the files.
     
  12. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Try
    Code:
    cp /usr/local/ispconfig/server/conf-custom/error/en/* /var/www/clients/*/*/web/error/*
     
  13. Stelios

    Stelios Active Member HowtoForge Supporter

    Doesn't work either:
    cp: warning: source file '/var/www/clients/client6/web33/web/error/400.html' specified more than once
    etc
     
  14. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Can you share the command you run + error instead of only the error?
     
  15. Stelios

    Stelios Active Member HowtoForge Supporter

    Code:
    cp /usr/local/ispconfig/server/conf-custom/error/en/* /var/www/clients/*/*/web/error/*
    cp: warning: source file '/var/www/clients/client6/web34/web/error/405.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web34/web/error/500.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web34/web/error/502.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web34/web/error/503.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web35/web/error/400.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web35/web/error/401.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web35/web/error/403.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web35/web/error/404.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web35/web/error/405.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web35/web/error/500.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web35/web/error/502.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web35/web/error/503.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web36/web/error/400.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web36/web/error/401.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web36/web/error/403.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web36/web/error/404.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web36/web/error/405.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web36/web/error/500.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web36/web/error/502.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web36/web/error/503.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web38/web/error/400.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web38/web/error/401.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web38/web/error/403.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web38/web/error/404.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web38/web/error/405.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web38/web/error/500.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web38/web/error/502.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web38/web/error/503.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web39/web/error/400.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web39/web/error/401.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web39/web/error/403.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web39/web/error/404.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web39/web/error/405.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web39/web/error/500.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web39/web/error/502.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web39/web/error/503.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web40/web/error/400.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web40/web/error/401.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web40/web/error/403.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web40/web/error/404.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web40/web/error/405.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web40/web/error/500.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web40/web/error/502.html' specified more than once
    cp: warning: source file '/var/www/clients/client6/web40/web/error/503.html' specified more than once
    
     
  16. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Weird, it works fine for me. Can you share the content of your conf-custom and web/error folder?
    Code:
    ls -l /usr/local/ispconfig/server/conf-custom/error/en/
    ls -l /var/www/clients/client6/web40/web/error/
     
  17. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Code:
    cp /usr/local/ispconfig/server/conf-custom/error/en/* /var/www/clients/*/*/web/error/*
    I think that can not work as desired here. Those wildcards expand to several filenames. The command cp when given several parameters needs the last one to be a directory and the previous parameters are copied to that.
    Like it says in the error message: source file specified more than once, that is cp considers /var/www/clients/client6/web34/web/error/405.html to be a source file, that is file to be copied to target.
    This can not be done in one cp command, something like this should work (not tested, use with caution):
    Code:
    for target in /var/www/clients/*/*/web/error/* ; do
      cp /usr/local/ispconfig/server/conf-custom/error/en/* $target
    done
    
     
  18. Stelios

    Stelios Active Member HowtoForge Supporter

    None of the above solutions worked. The following code worked fine:
    Code:
    for target in /var/www/clients/*/*/web/error/ ; do
      cp "/usr/local/ispconfig/server/conf-custom/error/en//400.html" "$target"
      cp "/usr/local/ispconfig/server/conf-custom/error/en//401.html" "$target"
      cp "/usr/local/ispconfig/server/conf-custom/error/en//403.html" "$target"
      cp "/usr/local/ispconfig/server/conf-custom/error/en//404.html" "$target"
      cp "/usr/local/ispconfig/server/conf-custom/error/en//405.html" "$target"
      cp "/usr/local/ispconfig/server/conf-custom/error/en//500.html" "$target"
      cp "/usr/local/ispconfig/server/conf-custom/error/en//502.html" "$target"
      cp "/usr/local/ispconfig/server/conf-custom/error/en//503.html" "$target"
    done
    Thanks
     

Share This Page