darold / sendmailanalyzer

Sendmail log Analyzer is a tool to monitor sendmail usage and generate HTML and graph reports. It reports all you ever wanted to know about email trafic on your network. You can also use it in ISP environment with per domain and per mailbox report.
http://sendmailanalyzer.darold.net/
GNU General Public License v3.0
76 stars 13 forks source link

Cannot see UI page #47

Closed kennoosh closed 7 years ago

kennoosh commented 7 years ago

Hi I installed the sendmailanalyzer following the instruction, but when I open the page: https://xx.xx.xx.xx/sareport/; it doesn't give me any UI page, it only show all perl scripts; please review the attached file; do you know why is that?

sareport.txt

Thanks

kennoosh commented 7 years ago

the OS is ubuntu 14; perl is v5.22.1, and I have installed " MIME::Base64"

darold commented 7 years ago

The problem is not related to the perl script but to your Apache configuration. See INSTALLATION in the documentation (README file) and especially the "Post install" chapter and the configuration sample:

            Alias /sareport /usr/local/sendmailanalyzer/www
            <Directory /usr/local/sendmailanalyzer/www>
                    Options ExecCGI
                    AddHandler cgi-script .cgi
                    DirectoryIndex sa_report.cgi
                    Order deny,allow
                    Deny from all
                    Allow from 127.0.0.1
                    Allow from ::1
                    # Allow from .example.com
            </Directory>
kennoosh commented 7 years ago

I added that setting in the apache, but I got 403 forbidden issue: Alias /sareport /usr/local/sendmailanalyzer/www <Directory /usr/local/sendmailanalyzer/www> Options ExecCGI AddHandler cgi-script .cgi DirectoryIndex sa_report.cgi Order deny,allow Allow from all

Allow from .example.com

            </Directory> 

I googled it and someone suggested to use "Require all granted" instead of "Order deny,allow"; so I changed it as:
Alias /sareport /usr/local/sendmailanalyzer/www <Directory /usr/local/sendmailanalyzer/www> Options ExecCGI AddHandler cgi-script .cgi DirectoryIndex sa_report.cgi Require all granted

Allow from .example.com

            </Directory>

The I can access it but the response is not UI page, it just show all perl scripts;

darold commented 7 years ago

What is your version of Apache httpd server (output of apache2 -v ) and the version of your operating system?

darold commented 7 years ago

Sorry, I just seen your note above: OS is ubuntu 14, I have the same on my laptop and my configuration is:

        Alias /sareport /usr/local/sendmailanalyzer/www/
        <Directory /usr/local/sendmailanalyzer/www/>
            Options All +ExecCGI
            Require all granted
            AddHandler cgi-script .cgi
            DirectoryIndex sa_report.cgi
        </Directory>

into /etc/apache2/sites-enabled/000-default.conf default virtual host.

kennoosh commented 7 years ago

Does it work for you ? my apache version is 2.4, and I added it in /etc/apache2/sites-enabled/default-ssl.conf because we disabled the HTTP request; all http request will automatically be rewritten to HTTPS;

darold commented 7 years ago

Yes it works great for me, perhaps you have to enable the cgi module too.

sudo a2enmod cgi
sudo service apache2 reload
kennoosh commented 7 years ago

yeah, it works, thank you very much