ZhangHuangbin wrote:Do you want to restrict access for Awstats? Then do it the way same as phpMyAdmin, just add one more <Directory> directive. If it doesn't work, show us what you did (full config file).
 Yes, i do the same way as phpmyadmin:
=> nano /etc/apache2/sites-available/default-ssl
IfModule mod_ssl.c>
<VirtualHost _default_:443>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
# Restrict awstats access
        <Directory /usr/share/awstats/icon/>
                Order Deny,Allow
                Deny from all
                Allow from 127.0.0.1            # local
                Allow from 192.168.1.0/24      # localnetwork
        </Directory>
        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>
        ErrorLog ${APACHE_LOG_DIR}/error.log
        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined
        Alias /doc/ "/usr/share/doc/"
        <Directory "/usr/share/doc/">
                Options Indexes MultiViews FollowSymLinks
                AllowOverride None
                Order deny,allow
                Deny from all
                Allow from 127.0.0.0/255.0.0.0 ::1/128
        </Directory>
        SSLEngine on
        SSLCertificateFile /etc/ssl/certs/iRedMail_CA.pem
        SSLCertificateKeyFile /etc/ssl/private/iRedMail.key
        <FilesMatch "\.(cgi|shtml|phtml|php)$">
                SSLOptions +StdEnvVars
        </FilesMatch>
        <Directory /usr/lib/cgi-bin>
                SSLOptions +StdEnvVars
        </Directory>
        BrowserMatch "MSIE [2-6]" \
                nokeepalive ssl-unclean-shutdown \
                downgrade-1.0 force-response-1.0
        BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
Alias /cluebringer "/usr/share/postfix-cluebringer-webui/webui/"
Alias /iredadmin/static "/usr/share/apache2/iredadmin/static/"
WSGIScriptAlias /iredadmin "/usr/share/apache2/iredadmin/iredadmin.py/"
Alias /awstats/icon "/usr/share/awstats/icon/"
Alias /awstatsicon "/usr/share/awstats/icon/"
ScriptAlias /awstats "/usr/lib/cgi-bin/"
Alias /mail "/usr/share/apache2/roundcubemail/"
Alias /phpldapadmin "/usr/share/phpldapadmin/"
Alias /ldap "/usr/share/phpldapadmin/"
Alias /phpmyadmin "/usr/share/phpmyadmin/"
</VirtualHost>
</IfModule>
=> service apache2 reload
=> service apache2 restart
But for:
        - https://mail.mysite.com/awstats/awstats.pl
        - https://mail.mysite.com/awstats/awstats.pl?config=web
        - https://mail.mysite.com/awstats/awstats.pl?config=smtp
I can identify and enter statistics with a internet access.
I'm not an experienced user liux.
Maybe this is the normal operation of cgi?
I just wanted to see statistics only from the local network because I think in my case (self-hosting), it is unnecessary to let the access from internet
Maybe this is too difficult to change this part? In this case, it does not matter.
Thank you for your patience and availability