mod-perl in ISPConfig 3

Discussion in 'Installation/Configuration' started by edi00, Jul 8, 2015.

  1. edi00

    edi00 Member

    I have updated my server from 12.04 where ISPConfig 3 worked a OK to Ubuntu 14.04; ISPC 3.0.5.4p8; Apache version 2.4.7.
    I have noticed that you have added the "Perl" box in websites.
    Unfortunately, unless I am missing something, it gives totally illogical data in /usr/local/ispconfig/server/conf/vhost.conf.master
    Code:
    <tmpl_if name='perl' op='==' value='y'>
            <IfModule mod_perl.c>
                PerlModule ModPerl::Registry
                PerlModule Apache2::Reload
                <Directory {tmpl_var name='web_document_root_www'}>
                    PerlResponseHandler ModPerl::Registry
                    PerlOptions +ParseHeaders
                    Options +ExecCGI
                </Directory>
                <Directory {tmpl_var name='web_document_root'}>
                    PerlResponseHandler ModPerl::Registry
                    PerlOptions +ParseHeaders
                    Options +ExecCGI
                </Directory>
                <Files *.pl>
                    SetHandler perl-script
                </Files>
            </IfModule>
    </tmpl_if>
    
    Please notice that it points to 'web_document_root' instead of 'document_root'
    Where is <IfModule mod_perl.c> now? It shows that it is not installed by Apache 2.4.x
    Code:
    CONTEXT_DOCUMENT_ROOT: /var/www/clients/client1/web2/cgi-bin/
    CONTEXT_PREFIX: /cgi-bin/
    DOCUMENT_ROOT: /var/www/x.com/web
    GATEWAY_INTERFACE: CGI/1.1
    HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    HTTP_ACCEPT_ENCODING: gzip, deflate
    HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.5
    HTTP_CONNECTION: keep-alive
    HTTP_COOKIE: remote=0457835643
    HTTP_HOST: x.com
    HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 6.1; rv:36.0) Gecko/20100101 Firefox/36.0 SeaMonkey/2.33.1
    PATH: /usr/local/bin:/usr/bin:/bin
    QUERY_STRING:
    REMOTE_ADDR: xxxx:306:xxxx:670:xxxx:511:xxx:1d19
    REMOTE_PORT: 49268
    REQUEST_METHOD: GET
    REQUEST_SCHEME: http
    REQUEST_URI: /cgi-bin/x.pl
    SCRIPT_FILENAME: /var/www/clients/client1/web2/cgi-bin/x.pl
    SCRIPT_NAME: /cgi-bin/x.pl
    SERVER_ADDR: xxxx:dd80:xx::70c
    SERVER_ADMIN: webmaster@x.com
    SERVER_NAME: x.com
    SERVER_PORT: 80
    SERVER_PROTOCOL: HTTP/1.1
    SERVER_SIGNATURE:
    Apache/2.4.7 (Ubuntu) Server at x.com Port 80
    
    SERVER_SOFTWARE: Apache/2.4.7 (Ubuntu) 
     
    Last edited: Jul 8, 2015
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The above config is ok. As you might know, ispconfig uses two paths
    web_document_root_www and
    web_document_root where one is a symlink to the other, which path is used by the vhost depends on various settings of the site and the baove code enables perl for both paths and this ensures that the setup is compatible with all others ettings of that site.
     
  3. edi00

    edi00 Member

    Unfortunately all Perl scripts should be in the website folder as shown above same structure as is /cgi-bin/
    SCRIPT_FILENAME: /var/www/clients/client1/web2/cgi-bin/x.pl = http://x.com/cgi-bin/x.pl
    SCRIPT_FILENAME: /var/www/clients/client1/web2/perl/x.pl = http://x.com/perl/x.pl (this does not work under your theory)
    Please show me an example.
    When I create new website your ISPConfig 3 creates also folder structure. i.e. cgi-bin.
    Where is the perl folder under your theory?
     
    Last edited: Jul 8, 2015
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    mod_perl enables parsing of .pl files in the web folder, similar to mod_php. So mod_perl is not the same then cgi perl. If you want to run cgi scripts in perl or another language, then enable just cgi in the website and put your scripts into the cgi-bin folder of the website (which is in the web root and not inside the web folder).

    Like I explained above, web_document_root_www and web_document_root point both to the web folder, one is just a symlink to the other one. So a path like the one above makes no sense and is not used by ispconfig.

    This means that the module is not installed n your server. It is possible that it does no excist anymore for apache 2.4. In any case, the module is not related to running cgi scripts in cgi-bin with perl.
     
  5. edi00

    edi00 Member

    Hi till, You have just started to support the mod_perl recently while there is a long established protocol to put mod_perl scripts into the /perl/ folder and perl scripts into the /cgi-bin/. It is your program so you can do what ever you want but your updates will not work with the existing websites. The user must manually change vhost.conf or move all mod-perl scripts into the web folder. The purpose of the vhost.conf is to define parsing there and not in the file structure. The mod-perl does not care where you put the script as long as you point to it.
    That is why updates never work because no one supports established conventions. The updating MAC is totally seamless, Windows partially seamless and Linux is total mess. It will take me weeks of fixing the otherwise trivial task to upgrade to Ubuntu to 14.04 from 12.04.

    So why do you use directive <IfModule mod_perl.c> if you do not know if it exists in 2.4.x?
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    mod_perl support exists in ISPConfig for quite some time, it has not been added recently. The implementation was made years ago when apache 2.2 was the major apache version and mod_perl is available for apache 2.2. If mod_perl has dropped support for apache 2.4, then we will remove it from ISPConfig.

    Files that shall be accessible from the web are inside the web folder on a ISPConfig server, except of cgi scripts that have their own folder. Thats a definition of the ISPConfig controlpanel and thats why mod_perl is configured to comply with the folder layout of ISPConfig. If some other panels use a perl folder, then they are free to do that but this does not mean that we will remove the consistence from our folder layout that we use for more then 10 years to match another panel.

    The vhost conf defines the complete vhost incl. structure where files are located, define the parsing of file extensions is just a small part of it. ISPConfig allows easy modifications of this file, so just edit it to match your requirements and store your modified copy in the conf-custom folder.

    I updated a ISPConfig perfect server setup with about 80 live websites last week, took me about an hour, not a single website was broken. If a system is updatable or not depends on the setup and how much you modified it because, the ISPConfig setup is compatible with all Ubuntu versions of the past 8 - 10 years so as long as you dont d heavy modifcations of the ispconfig setup, you dont have troble with updates.
     
  7. edi00

    edi00 Member

    OK til, Prior to this version I had ISPConfig 3.0.4.3 and it did not supported mod-perl so I used manual modification of the vhost.conf.
    I have about 15 websites on my server and many various modules written in /perl/ directory so to be compatible with my current ISPC 3.0.5.4p8 (don't know even if that is correct one) it wouldn't be prudent for me to do so. As I said, it is your panel.
    After I upgraded my remote Ubuntu 12.04 server to the 14.04 it took me 1 day to fix my VNC connection (a Bug) by using work around which I found on the web.
    Obviously all third party software was disabled including ISPConfig 3.0.4.3 so after upgrade I must use work around for mod-perl.
    Perhaps you can help me with Squirrel Mail because the var/www/webmail link disappeared.
    Should I reinstall Squirrel as shown here? https://www.howtoforge.com/perfect-...hp-mysql-pureftpd-bind-dovecot-ispconfig-3-p6
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    All you have to do is to change two lines in the vhost master config file and your current setup and ispconfig are fully compatible. Thats why ispconfig supports custom templates.

    This link is not used by squirrelmail anyway, squirrelmail uses an alias. in the squirrelmail.conf file. Take a lok at the perfect server setup guide for Ubuntu 14.04 on how to configure squirrelmail.
     
  9. edi00

    edi00 Member

    Thanks, till
    During testing, I have deleted website hoping that I am deleting only vhost data and did not realized that I am also deleting the var/www/ files.:(
    Is there any trash/backup folder to recover these files?
    I see some backup folders in var/www/

    I have figured out the squirrelmail issue - it works a OK.:)
    I have also figured out mod-perl under Apache 2.4.x config issue :)
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    If you have website backups enabled then you might find a backup in /var/backup. Otherwise you wil have to restore the site from your system backup (which you hopefully have).
     
  11. edi00

    edi00 Member

    It looks like I can't recover.
    However, strange issue is that the websites' folders are lock and I can't open new folder at /var/www/clients/client1/web15 but can at
    /var/www/clients/client1/web15/web but can;
    I can't even set permissions on /web15/
    Is this something the ISPConfig is controlling?
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    The root folder is protected with the immutable bit. You can remove it wit chattr command, add your perl folder snd set it again afterwards.
     
  13. edi00

    edi00 Member

    Thanks till,
    When I execute, in the browser, my server name or its IP I get the following message:
    It works! at /var/www
    This is the default web page for this server.
    The web server software is running but no content has been added, yet.

    However, that is not true because I can't execute /var/www/webalizer; /var/www/testing.php; /var/www/index.html; (I have modified the text and it does not show)
    i.e. x.xxxxx.com/webalizer
    It use to worked.
     
    Last edited: Jul 13, 2015
  14. edi00

    edi00 Member

    Hi till,
    It would be good idea to add to the vhost.conf.master ssi enabled the DirectoryIndex index.shtm; and DirectoryIndex index.html index.htm to the /web directory.
    It would made it more user friendly.
    Any idea about the It works! at /var/www as shown above?
     
  15. edi00

    edi00 Member

    ......... Hmmmmmm
    Interesting!
    I guess you were not waiting for Till answer about where the actual var/www/ resides because it is redirected somewhere which only he knows where. So lets make your customers waste their time searching for it. It is a good PR.
     
    Last edited: Jul 15, 2015
  16. till

    till Super Moderator Staff Member ISPConfig Developer

    The www directory is easy to find, it is the default of the Linux distribution that you use. On Debian, Ubuntu and Centos this is /var/www and on OpenSuSE this is /srv/www. So nothing ispconfig specific here.

    I'am sorry that I did not notice that you are one of our customers as our customers are contacting our support normally here http://support.projektfarm.com and not trough the howtforge forum which is for the community only. All ISPConfig users that are customers of our company have a support contract with our company, please send me a PM with your support contract number or last invoice number so that I can make a note in our crm that the howtoforge username edi00 belongs to a support contract of our company.
     
  17. edi00

    edi00 Member

    Thanks, but you have not answer my question.
    The problem is that when I execute, in the browser, my server name or its IP I get the following message:

    It works! at /var/www
    This is the default web page for this server.
    The web server software is running but no content has been added, yet.

    However, that is not true because I can't execute /var/www/webalizer; /var/www/testing.php; /var/www/index.html; (I have modified the text and it does not show)
    i.e. x.xxxxx.com/index.html;
    So, what I need to know is, from which file this message is cumming from?....... where is it located?....... please give me exact link.
     
  18. till

    till Super Moderator Staff Member ISPConfig Developer

    This is not a message from ispconfig, thats from the default vhost of your linux system. Take a look into the default vhost configuration file of your os, in the vhost line you can see a directory and this directory is the root of the system default vhost of the OS and there you can find the file that shows this message.
     
  19. edi00

    edi00 Member

    That was the first place I have looked Till but, I do not have default.vhost.
    The both directories /etc/apache2/sites-available/000-default.conf; and /etc/apache2/sites-enabled/000-default.conf are empty containing # vim: syntax=apache ts=4 sw=4 sts=4 sr noet.
    That is why I am confused.
    However, in the apache2.conf file I have
    Code:
    <Directory /var/www/>
    Options FollowSymLinks Indexes
    AllowOverride None
        Require all granted
    </Directory>
    
    RESOLVED!
     
    Last edited: Jul 15, 2015

Share This Page