serwer wide applications

Discussion in 'Server Operation' started by nenad, Dec 3, 2005.

  1. nenad

    nenad Member

  2. falko

    falko Super Moderator Howtoforge Staff

    Simply create a new web site in ISPConfig and install these applications in the new web site.
  3. nenad

    nenad Member

    OK, but when I install "monitorix" it places html files and cgi files into default directories:
    (/var/www/html and /var/www/cgi).

    Yum or apt-get don't ask me for location to install new applications.
    So, I have to manually move them into
    /var/www/web7/www directories
    (and of course change everything in config files)

    And even after that it won't work.
    CGI part. Internal 500 server error.

    I tested application on another pc (there's no ISPConfig installed) and applicatiopn works good.
    Last edited: Dec 4, 2005
  4. nenad

    nenad Member

  5. themachine

    themachine New Member HowtoForge Supporter

    You need to look in your error logs to see what file it is looking for, and not finding. That will point you in a direction as to where the configuration is jacked.

    What version of Debian are you using? Generally when I install webapps through apt it installs to "/usr/share/<app_name>" and then I will need to add something to the apache configuration to find these files... something like:

    Alias /cacti "/usr/share/cacti/htdocs"
    <Directory "/usr/share/cacti/htdocs">
    [insert standard directory babble here]

    but I haven't installed cacti through apt...
  6. falko

    falko Super Moderator Howtoforge Staff

    Don't use FC4's packages! They will always be installed in default locations which doesn't work for you.
    Use the source packages you can download from the respective web sites, and install them manually.
  7. nenad

    nenad Member

    I am using FC3 on server (and FC4 and Mandriva on other PC's)

    I think that files are found (if I delete them - cgi files - then there is File not found error)

    Anyway, in which logs should I look for log errors for "Internal Server Error 500" ?

    Apache logs? Where?

    (4 days ago I installed this application , and it worked, and now I can't set it up again -- aarrghhh)

    when I do:

    perl -wc monitorix
    it shows me that the script syntax is fine., I guess then that the error is not in perl, and that application works on another PC.
  8. nenad

    nenad Member

    BTW Which package sources are not compatible?
    livna against dag or fresh rpm or...?
  9. falko

    falko Super Moderator Howtoforge Staff

    It doesn't have anything to do with the repositories. It's just that the precompiled packages are installed to default directories like /var/www which isn't suitable for you because your web site is in /var/www/web1/web. Therefore you should use the source packages, e.g. for Monitorix:
  10. nenad

    nenad Member

    Ok, I will use source package, I just remebered that there is some issue with repositories, and I was wondering do you know in between which two of them. The question is not related to monitorix.
    Last edited: Dec 5, 2005
  11. nenad

    nenad Member

    Again the same:

    "Internal 500 server error".files are there where they have to be
    It's not File not found error.

    How to investigate what causes internal 500 error?
  12. nenad

    nenad Member

    When I create sample ---> first.cgi

    (which can be executed on another machine, of course, and put him in same directory where is monitorix.cgi (/var/www/web7/cgi-bin/)

    it is also NOT executing, and the error is the same:
    Internal server error: 500

    It seems that Apache do not won't to execute cgi scripts?
    (In ISPCOnfig , cgi is ENABLED):eek:

    If I try toput that simple script in ANY other web directory -- it's the same: Internal Server Error: 500
    Last edited: Dec 5, 2005
  13. nenad

    nenad Member

    If I do:
    Now, if I delete
    from Hello, world script, then output is the same?

    Does that really means that apache don't call perl for executing the cgi scripts?

    permissions are set to 755 as they should be, user is apache as it should be...
    perl is located in /usr/bin/perl and it is working (if not called from apache)
  14. falko

    falko Super Moderator Howtoforge Staff

    Did you try the test files?

    Have you made you cgi/pl script executable (chmod 755 or chmod 775)?

    Make sure it has Unix linebreaks instead of Windows linebreaks!

    You must put cgi/pl scripts in the cgi-bin directory, no other directory will work!
  15. nenad

    nenad Member

    Yes, I did. Same result. "Premature end of script"

    Yes, I tried both 755 and 775
    No, there are Unix linebreaks (file was created on FC4 os, using putty and joe editor inside of it. There was no even "W" from windows.

    Yes, of course they were in cgi-bin directory. Otherwise there would be "File not found error" instead of "Internal Server Error", and there wouldn't be "premature end of script" in log files.

    I even set up script for "apache user" and "apache group", just in case that suexec directives are set not to execute "root" user group etc.

    It is pretty obious that Apache DO NOT execute scripts in cgi-bin.
    I can put inside any script, at the begening of the file next line:
    "mickey mouse and donald duck are big friends" instead of #!/usr/bin/perl,
    and there will be the same error in httpd log file : "premature end of script"

    when I chechk each perl script with perl -wc syntax is OK.
    when I do perl -w output is displayed
    in my script there was also
    to avoid STDOUT (anyway that's not the case, because there will be a log about STDOUT)

    The interesting part is that PHP script won't execute???
    In /web directory it is executing with no flaws...

    P.S. mod_perl is loaded into apache

    info.php and ssi.shtml work in /web directory
    *.pl scrpits work inside cgi-bin if they are invoked with "./" or "perl -w"
    Last edited: Dec 5, 2005
  16. nenad

    nenad Member

    Help, please?

  17. falko

    falko Super Moderator Howtoforge Staff

    PHP aren't executed in cgi-bin, so that's ok.

    Is Perl in /usr/bin/perl? Please post the output of
    which perl
  18. nenad

    nenad Member

    Last edited: Dec 6, 2005
  19. nenad

    nenad Member

    I found what is problem.
    And I found solution :)
    Informed me that there is:
    So, I chechked who is owner of files (user or group) and I found out that it is root, or apache or some '506' (for test files that I downloaded from this forum.

    I didn't used built-in ISPConfig FTP or any standalone FTP , so probably because of that owbership was not set to web7_nenad & web7 user/group.

    I downloaded files using wget, and I was loged as user 'root' through SSH (putty)
    few days ago I used FTP to download/upload monitorix etc., so that's why there was no this kind of problems.

    And I login using 'root' instead of username (web7_nenad).
    That caused all of the problems becuse of improper file ownership.

    in /var/www/html/ is located monitorix (by default rpm installation)

    files and direcories from /var/www/cgi-bin/ are moved to
    var/www/web7/cgi-bin directory

    for all files and directories in var/www/web7/cgi-bin (monitorix.cgi, monitorix) file owbership are changed from root and apache to web7_nenad and web7 (user& group)

    I lost few days with this issue, but I learned a LOT about apache, suexec, 500 Internal Server Error etc.

    Thanks a lot for your support


    test ssi.shtml is now at:
    test is at:
    test phpinfo.php is at:
    Monitorix is at:
    (there are still some unresolved issues with creating of images for Monitorix, but that's the problem of Monitorix, and I think I am going to resolve that this night).
    update: directory var/www/web7/web/monitorix/imgs also needs to be set as same user/group, in my case: web7_nenad and web7 . So everything works fine now :) :)
    Last edited: Mar 26, 2006
  20. cnlnetworks

    cnlnetworks New Member

    I use this to get it to work for me!

    Install it like normal.

    Copy all cgi and web files to the virt user directory you are useing to access it.

    then edit the cron file like so: ( this is for me you will have to adjust the rsync line to fit your system. )

    vi /etc/cron.d/monitorix

    # @(#) Fibranet NSP, SL
    # Copyright (C) 2005 by Jordi Sanfeliu <[email protected]>

    * * * * * root ps -C --no-headers || /usr/sbin/ update
    * * * * * /usr/bin/rsync -av /var/www/html/monitorix/imgs/ /home/www/
    00 00 * * * root /usr/sbin/ collect
    01 00 1 * * root /usr/sbin/ report

    exit 0


    And so it updates like it wants to and then I rsync the directories.


Share This Page