WebFaction
Community site: login faq
0
1

Could this be done, by entering multiple sites in the "Extra Info" box when creating the app? Is there another way to do this manually? Sure would be nice not to have to make another awstats app for every site.

asked 28 Jul '11, 09:42

swiharta
38159
accept rate: 33%


Manual instructions from the old forum -- Copied here:


It's possible, but it's not pretty :)

Here's how you can do it.

Assumptions:

  • You've got a website record named 'site1' served on 'domain1.com'

  • You've got a second website record named 'site2' served on 'domain2.com'

  • You're going to serve the stats app on domain1.com/stats and domain2.com/stats

1.) Set up your initial AWStats app as directed by the instructions in the control panel. In this example, we'll name that app 'stats' and we'll set it up for site1.

2.) SSH into your server and cd to ~/webapps/stats

3.) Edit update.py and duplicate the two 'system' commands for the second site.

You'll end up with something like this:

#!/usr/local/bin/python2.5

from os import getcwd, system

system('cd %s/tools/;./logresolvemerge.pl ~/logs/apache/access_site1.log ~/logs/apache/access_site1.log.1 > ../data/access_site1.log' % getcwd())
system('cd %s/cgi-bin/;./awstats.pl -config=domain1.com -u' % getcwd())

system('cd %s/tools/;./logresolvemerge.pl ~/logs/apache/access_site2.log ~/logs/apache/access_site2.log.1 > ../data/access_site2.log' % getcwd())
system('cd %s/cgi-bin/;./awstats.pl -config=domain2.com -u' % getcwd())

4.) Repeat step 3 for update_all.py

5.) Copy ~/webapps/stats/cgi-bin/awstats.domain1.com.conf to ~/webapps/stats/cgi-bin/awstats.domain2.com.conf

6.) Edit ~/webapps/stats/cgi-bin/awstats.domain2.com.conf and make the following changes:

...

LogFile="../data/access_site2.log"

...

SiteDomain="domain2.com"

...

7.) Edit ~/webapps/stats/.htaccess so that it looks like this:

AddHandler cgi-script .pl

RewriteEngine On
RewriteRule ^$ %{REQUEST_URI}cgi-bin/awstats.pl [R]

8.) Run ./update_all.py

9.) Go to your website records in the control panel and add the 'stats' app on URL path '/stats' to the site records for site1 and site2

That's it - you're done!


The only snag was making the final update_awstats script happy by creating some empty log files like this:

touch ~/webapps/awstats/data/site1.log
touch ~/webapps/awstats/data/site2.log
touch ~/webapps/awstats/data/site3.log
touch ~/webapps/awstats/data/site4.log

Hopefully in less than an hour I'll see my stats for each site, I'll report back.

Update: Yep, it's working great.

permanent link

answered 28 Jul '11, 10:35

swiharta
38159
accept rate: 33%

edited 06 Feb '13, 19:09

ryans ♦♦
5.0k103960

You can only enter one site in the "Extra Info" field, and there is no way to do this manually. You will need to create a separate AWStats application for each site.

permanent link

answered 28 Jul '11, 09:46

maryh
1.3k7
accept rate: 35%

I just found this manual method:

http://forum.webfaction.com/viewtopic.php?pid=7646

I'll give it a try and report back.

I just don't like the idea of duplicating an app that does nothing different. Same goes for multiple static apps for serving static content for different sites. Webfaction's Control Panel is obviously a huge step up from something like cPanel, but the seemingly redundant app duplication like this is a niggling issue for me.

(28 Jul '11, 09:54) swiharta

My apologies - I was unaware of that forum post.

(28 Jul '11, 10:03) maryh
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×18

question asked: 28 Jul '11, 09:42

question was seen: 68,094 times

last updated: 06 Feb '13, 19:09

                              
WEBFACTION
REACH US
SUPPORT
LEGAL
© COPYRIGHT 2003-2021 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM