Current time: 11-15-2024, 10:04 PM Hello There, Guest! (LoginRegister)


Post Reply 
How to have stats accessible for a subdomain - subdomain.domain.tld/stats instead?
Author Message
gilbert Offline
Junior Member
*

Posts: 45
Joined: May 2007
Reputation: 0
Post: #1
How to have stats accessible for a subdomain - subdomain.domain.tld/stats instead?
Hi,

I host a site subdomain.domain.tld but I do not host domain.tld

The site works fine.

The stats would normally be under http://www.domain.tld/stats but since I don't host http://www.domain.tld is there another way to have the user access the stats associated with subdomain.domain.tld ?

Thanks,
Gilbert.
(This post was last modified: 04-27-2009 08:29 PM by gilbert.)
04-18-2009 02:50 AM
Find all posts by this user Quote this message in a reply
Knut Offline
Member
***

Posts: 736
Joined: Nov 2006
Reputation: 10
Post: #2
RE: how to access stats for subdomain when domain is not hosted on ispcp server
I think http://aaa.bbb.com/stats

Knut
04-18-2009 02:54 AM
Find all posts by this user Quote this message in a reply
gilbert Offline
Junior Member
*

Posts: 45
Joined: May 2007
Reputation: 0
Post: #3
RE: how to access stats for subdomain when domain is not hosted on ispcp server
When I go to http://aaa.bbb.com/stats

I get

Error 404!

/stats/
File Not Found!
04-18-2009 02:57 AM
Find all posts by this user Quote this message in a reply
Knut Offline
Member
***

Posts: 736
Joined: Nov 2006
Reputation: 10
Post: #4
RE: how to access stats for subdomain when domain is not hosted on ispcp server
OK, we need more Info about your System.

For instance at ispCP 1.0 wie dynamic awstats the virtualhost looks like this:
(I'm only work with dynamic awstats)

Code:
# httpd [aaa.bbb.de] dmn entry BEGIN.
<VirtualHost 78.47.01.254:80>

    <IfModule suexec_module>
           SuexecUserGroup vu2004 vu2004
    </IfModule>

    ServerAdmin     webmaster@aaa.bbb.de
    DocumentRoot    /var/www/virtual/aaa.bbb.de/htdocs

    ServerName      aaa.bbb.de
    ServerAlias     www.aaa.bbb.de aaa.bbb.de

    Alias /errors   /var/www/virtual/aaa.bbb.de/errors/

    RedirectMatch permanent ^/ftp([\/]?)                http://xxx.yyy.de/ftp/
    RedirectMatch permanent ^/pma([\/]?)                http://xxx.yyy.de/pma/
    RedirectMatch permanent ^/webmail([\/]?)    http://xxx.yyy.de/webmail/

    ErrorDocument 401 /errors/401.html
    ErrorDocument 403 /errors/403.html
    ErrorDocument 404 /errors/404.html
    ErrorDocument 500 /errors/500.html
    ErrorDocument 503 /errors/503.html

    <IfModule mod_cband.c>
        CBandUser aaa.bbb.de
    </IfModule>

    # httpd awstats support BEGIN.

   ProxyRequests Off

   <Proxy *>
      Order deny,allow
      Allow from all
   </Proxy>

   ProxyPass                    /stats  http://localhost/stats/aaa.bbb.de
   ProxyPassReverse             /stats  http://localhost/stats/aaa.bbb.de

    <Location /stats>
        <IfModule mod_rewrite.c>
            RewriteEngine on
            RewriteRule ^(.+)\?config=([^\?\&]+)(.*) $1\?config=aaa.bbb.de&$3 [NC,L]
        </IfModule>
        AuthType Basic
        AuthName "Statistics for domain aaa.bbb.de"
        AuthUserFile /var/www/virtual/aaa.bbb.de/.htpasswd
        AuthGroupFile /var/www/virtual/aaa.bbb.de/.htgroup
        Require group statistics
    </Location>
...
04-18-2009 03:07 AM
Find all posts by this user Quote this message in a reply
gilbert Offline
Junior Member
*

Posts: 45
Joined: May 2007
Reputation: 0
Post: #5
RE: how to access stats for subdomain when domain is not hosted on ispcp server
I'm not using 1.0 yet.
Here is the snippet from my ispcp.conf file in /etc/apache2/sites-enabled

Code:
# httpd [domain.tld] dmn group entry BEGIN.

<IfModule mod_cband.c>
    <CBandUser domain.tld>
         CBandUserLimit 3000Mi
         CBandUserScoreboard /var/www/scoreboards/domain.tld
         CBandUserPeriod 4W
         CBandUserPeriodSlice 1W
         CBandUserExceededURL http://xxx.yyy.com/errors/bw_exceeded.html
    </CBandUser>
</IfModule>


# httpd [aaa.domain.tld] sub entry BEGIN.
<VirtualHost *:80>

    #
    #User vu2205
    #Group vu2205
    #

    <IfModule suexec_module>
           SuexecUserGroup vu2205 vu2205
    </IfModule>

    ServerAdmin     webmaster@domain.tld
    DocumentRoot    /var/www/virtual/domain.tld/aaa/htdocs

    ServerName      aaa.domain.tld
    ServerAlias     www.aaa.domain.tld aaa.domain.tld *.aaa.domain.tld

    Alias /errors /var/www/virtual/domain.tld/errors/

    ErrorDocument 401 /errors/401.html
    ErrorDocument 403 /errors/403.html
    ErrorDocument 404 /errors/404.html
    ErrorDocument 500 /errors/500.html
    ErrorDocument 503 /errors/503.html

    <IfModule mod_cband.c>
        CBandUser domain.tld
    </IfModule>

    # httpd sub entry cgi support BEGIN.
    ScriptAlias /cgi-bin/ /var/www/virtual/domain.tld/aaa/cgi-bin/
    <Directory /var/www/virtual/domain.tld/aaa/cgi-bin>
        AllowOverride AuthConfig
        #Options ExecCGI
        Order allow,deny
        Allow from all
    </Directory>
    # httpd sub entry cgi support END.

    <Directory /var/www/virtual/domain.tld/aaa/htdocs>
        # httpd sub entry PHP support BEGIN.
        # httpd sub entry PHP support END.
        Options -Indexes Includes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>

    # httpd sub entry PHP2 support BEGIN.
    <IfModule mod_php5.c>
        php_admin_value open_basedir "/var/www/virtual/domain.tld/:/var/www/virtual/domain.tld/phptmp/:/usr/share/php/"
        php_admin_value upload_tmp_dir "/var/www/virtual/domain.tld/phptmp/"
        php_admin_value session.save_path "/var/www/virtual/domain.tld/phptmp/"
        php_admin_value sendmail_path '/usr/sbin/sendmail -f vu2205 -t -i'
    </IfModule>
    <IfModule mod_fastcgi.c>
        ScriptAlias /php5/ /var/www/fcgi/domain.tld/
        <Directory "/var/www/fcgi/domain.tld">
            AllowOverride None
            Options +ExecCGI -MultiViews -Indexes
            Order allow,deny
            Allow from all
        </Directory>
    </IfModule>
    <IfModule mod_fcgid.c>
        <Directory /var/www/virtual/domain.tld/aaa/htdocs>
            FCGIWrapper /var/www/fcgi/domain.tld/php5-fcgi-starter .php
            Options +ExecCGI
        </Directory>
        <Directory "/var/www/fcgi/domain.tld">
            AllowOverride None
            Options +ExecCGI MultiViews -Indexes
            Order allow,deny
            Allow from all
        </Directory>
    </IfModule>
    # httpd sub entry PHP2 support END.

    Include /etc/apache2/ispcp/aaa.domain.tld.conf

</VirtualHost>
# httpd [aaa.domain.tld] sub entry END.

# httpd [{SUB_NAME}] sub entry BEGIN.
# httpd [{SUB_NAME}] sub entry END.

# httpd [domain.tld] dmn entry BEGIN.
<VirtualHost *:80>

    <IfModule suexec_module>
           SuexecUserGroup vu2205 vu2205
    </IfModule>

    ServerAdmin     webmaster@domain.tld
    DocumentRoot    /var/www/virtual/domain.tld/htdocs

    ServerName      domain.tld
    ServerAlias     www.domain.tld domain.tld *.domain.tld

    Alias /errors   /var/www/virtual/domain.tld/errors/

    RedirectMatch permanent ^/ftp([\/]?)        http://xxx.yyy.com/ftp/
    RedirectMatch permanent ^/pma([\/]?)        http://xxx.yyy.com/pma/
    RedirectMatch permanent ^/webmail([\/]?)    http://xxx.yyy.com/webmail/

    ErrorDocument 401 /errors/401.html
    ErrorDocument 403 /errors/403.html
    ErrorDocument 404 /errors/404.html
    ErrorDocument 500 /errors/500.html
    ErrorDocument 503 /errors/503.html

    <IfModule mod_cband.c>
        CBandUser domain.tld
    </IfModule>

    # httpd awstats support BEGIN.

   ProxyRequests Off

   <Proxy *>
      Order deny,allow
      Allow from all
   </Proxy>

   ProxyPass            /stats    http://localhost/stats/domain.tld
   ProxyPassReverse        /stats    http://localhost/stats/domain.tld

    <Location /stats>
        AuthType Basic
        AuthName "Statistics for domain domain.tld"
        AuthUserFile /var/www/virtual/domain.tld/.htpasswd
        AuthGroupFile /var/www/virtual/domain.tld/.htgroup
        Require group statistics
    </Location>

   # httpd awstats support END.

    # httpd dmn entry cgi support BEGIN.
    ScriptAlias /cgi-bin/ /var/www/virtual/domain.tld/cgi-bin/
    <Directory /var/www/virtual/domain.tld/cgi-bin>
        AllowOverride AuthConfig
        #Options ExecCGI
        Order allow,deny
        Allow from all
    </Directory>
    # httpd dmn entry cgi support END.

    <Directory /var/www/virtual/domain.tld/htdocs>
        # httpd dmn entry PHP support BEGIN.
        # httpd dmn entry PHP support END.
        Options -Indexes Includes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>

    # httpd dmn entry PHP2 support BEGIN.
    <IfModule mod_php5.c>
        php_admin_value open_basedir "/var/www/virtual/domain.tld/:/var/www/virtual/domain.tld/phptmp/:/usr/share/php/"
        php_admin_value upload_tmp_dir "/var/www/virtual/domain.tld/phptmp/"
        php_admin_value session.save_path "/var/www/virtual/domain.tld/phptmp/"
        php_admin_value sendmail_path '/usr/sbin/sendmail -f vu2205 -t -i'
    </IfModule>
    <IfModule mod_fastcgi.c>
        ScriptAlias /php5/ /var/www/fcgi/domain.tld/
        <Directory "/var/www/fcgi/domain.tld">
            AllowOverride None
            Options +ExecCGI -MultiViews -Indexes
            Order allow,deny
            Allow from all
        </Directory>
    </IfModule>
    <IfModule mod_fcgid.c>
        <Directory /var/www/virtual/domain.tld/htdocs>
            FCGIWrapper /var/www/fcgi/domain.tld/php5-fcgi-starter .php
            Options +ExecCGI
        </Directory>
        <Directory "/var/www/fcgi/domain.tld">
            AllowOverride None
            Options +ExecCGI MultiViews -Indexes
            Order allow,deny
            Allow from all
        </Directory>
    </IfModule>
    # httpd dmn entry PHP2 support END.

    Include /etc/apache2/ispcp/domain.tld.conf

</VirtualHost>
# httpd [domain.tld] dmn entry END.

# httpd [domain.tld] dmn group entry END.
(This post was last modified: 04-27-2009 08:35 PM by gilbert.)
04-18-2009 03:34 AM
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #6
RE: How to have stats accessible for a subdomain - subdomain.domain.tld/stats instead?
Hi

So - you configured the domain.tld as normal customer and then inserted a subdomain. Right?

Since you don't have domain.tld running, you'd need to add some apache directives to get /stats - have a look at the other "normal" domain entries:
Quote: # httpd awstats support BEGIN.

ProxyRequests Off

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

ProxyPass /stats http://localhost/stats/domain.tld
ProxyPassReverse /stats http://localhost/stats/domain.tld
# httpd awstats support END.

maybe you can add this to the subdomain section.

OTHERWISE:
I'd rather setup "sub.domain.tld" as customer - then you don't have to hazzle around (of course this only works if you only host sub.domain.tld (incl. email)).

/J
04-28-2009 09:42 PM
Visit this user's website Find all posts by this user Quote this message in a reply
gilbert Offline
Junior Member
*

Posts: 45
Joined: May 2007
Reputation: 0
Post: #7
RE: How to have stats accessible for a subdomain - subdomain.domain.tld/stats instead?
(04-28-2009 09:42 PM)joximu Wrote:  Hi

So - you configured the domain.tld as normal customer and then inserted a subdomain. Right?

Since you don't have domain.tld running, you'd need to add some apache directives to get /stats - have a look at the other "normal" domain entries:
Quote: # httpd awstats support BEGIN.

ProxyRequests Off

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

ProxyPass /stats http://localhost/stats/domain.tld
ProxyPassReverse /stats http://localhost/stats/domain.tld
# httpd awstats support END.

maybe you can add this to the subdomain section.

OTHERWISE:
I'd rather setup "sub.domain.tld" as customer - then you don't have to hazzle around (of course this only works if you only host sub.domain.tld (incl. email)).

/J

Is there a way to transfer my normal customer domain.tld to customer sub.domain.tld?

I don't want to delete it as it will cause lots of support issues.

I think this is the best idea, I don't know why I created the domain.tld in the first place if I could have done it as sub.domain.tld.

If transferring is not possible can should I put these conf options in a /etc/apache2/ispcp/domain.tld.conf file ?
04-28-2009 11:07 PM
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #8
RE: How to have stats accessible for a subdomain - subdomain.domain.tld/stats instead?
First: you also don't have mail accounts on @domain.tld - do you?

I assume ispCP will refuse a new customer sub.domain.tld if domain.tld is already installed.

But you can makle a backup of the whole folder /var/www/virtual/domain.tld and maybe the databases... - then delete the domain.tld and install a new one.


The other solution (apache) may be easier... (but not as elegant and clean...).

I think the file is /etc/apache2/ispcp/sub.domain.tld.conf ...

/J
04-28-2009 11:44 PM
Visit this user's website Find all posts by this user Quote this message in a reply
gilbert Offline
Junior Member
*

Posts: 45
Joined: May 2007
Reputation: 0
Post: #9
RE: How to have stats accessible for a subdomain - subdomain.domain.tld/stats instead?
(04-28-2009 11:44 PM)joximu Wrote:  First: you also don't have mail accounts on @domain.tld - do you?

I assume ispCP will refuse a new customer sub.domain.tld if domain.tld is already installed.

But you can makle a backup of the whole folder /var/www/virtual/domain.tld and maybe the databases... - then delete the domain.tld and install a new one.


The other solution (apache) may be easier... (but not as elegant and clean...).

I think the file is /etc/apache2/ispcp/sub.domain.tld.conf ...

/J

So I created the file
/etc/apache2/ispcp/sub.domain.tld.conf

but now when I go to http://sub.domain.tld/stats/

I get

Error: SiteDomain parameter not defined in your config/domain file. You must edit it for using this version of AWStats.

Setup ('/etc/awstats/awstats.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).
04-29-2009 12:09 AM
Find all posts by this user Quote this message in a reply
gilbert Offline
Junior Member
*

Posts: 45
Joined: May 2007
Reputation: 0
Post: #10
RE: How to have stats accessible for a subdomain - subdomain.domain.tld/stats instead?
(04-29-2009 12:09 AM)gilbert Wrote:  
(04-28-2009 11:44 PM)joximu Wrote:  First: you also don't have mail accounts on @domain.tld - do you?

I assume ispCP will refuse a new customer sub.domain.tld if domain.tld is already installed.

But you can makle a backup of the whole folder /var/www/virtual/domain.tld and maybe the databases... - then delete the domain.tld and install a new one.


The other solution (apache) may be easier... (but not as elegant and clean...).

I think the file is /etc/apache2/ispcp/sub.domain.tld.conf ...

/J

So I created the file
/etc/apache2/ispcp/sub.domain.tld.conf

but now when I go to http://sub.domain.tld/stats/

I get

Error: SiteDomain parameter not defined in your config/domain file. You must edit it for using this version of AWStats.

Setup ('/etc/awstats/awstats.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).

Ooops I forgot to answer your first question, no there are no mail accounts.
04-29-2009 05:45 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)