AWStats on Ubuntu 10.04 Server
Yesterday I finalized moving my websites to my new Linode. With all the base configuration done, it is time to start installing some monitoring and stats tools. AWStats in particular is one of my favorite tools for analyzing web traffic.
This guide assumes you are using Apache2, Ubuntu 10.04(though I would assume to process would be similar for Ubuntu 9.xx), and have root access to your box. Also I assume you have Apache properly setup with a working access.log file.
Installing AWStats
Ubuntu 10.04 has AWStats available in their repositories:
apt-get install awstats
The Ubuntu Repo. does not have the newest version of AWStats. The repo has 6.9 while the newest, stable, version is 6.95. The 6.9 install that Ubuntu provides should be enough for most people. If you wish, you can install the newest version manually and continue following afterwards.
Configuring AWStats
AWStats does offer some sort of automated configuration process. I have never used or tested this function. If you are not comfortable with manual configuration you may want to look up the automated configuration option.
I have multiple domains I wish to track. I needed to make a copy of the default awstats.conf file for each domain. I used the format awstats.mydomain.ext.conf for my configuration file name. In my case, mydomain.ext is kastang.com. You will have to create a copy of awstats.conf for each domain you want to monitor.
cp /etc/awstats/awstats.conf /etc/awstats/awstats.yourdomain.ext.conf
Open awstats.yourdomain.ext.conf, find and modify the following fields:
#Path to access.log for your domain LogFile="/var/log/apache2/access.log" #I recommend '1' for more detailed information LogFormat=1 SiteDomain="yourdomain.ext" HostAliases="localhost 127.0.0.1 yourdomain.ext"
Now we can generate the initial stats for AWStats based off of your existing access.log file. You need to run this command for every domain you have configured.
/usr/lib/cgi-bin/awstats.pl -config=yourdomain.ext -update
Check the output for any errors. If it successfully Finds/Parses your access.log file you should be good to continue. If you have any errors, double check your configuration file and make sure the path to the access.log is correct.
Configuring Apache
After configuring AWStats, we need to tell Apache where to point when the AWStats address is accessed.
Navigate to /etc/apache2/sites-available/. If you have no VirtualHosts setup, you will want to place the following code in 'default'. If you have VirtualHosts setup, add this code inside the VirtualHost tag for each domain you want to monitor.
Alias /awstatsclasses "/usr/share/awstats/lib/" Alias /awstats-icon/ "/usr/share/awstats/icon/" Alias /awstatscss "/usr/share/doc/awstats/examples/css" ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ ScriptAlias /awstats/ /usr/lib/cgi-bin/ Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Reload the Apache configuration:
/etc/init.d/apache2 reload
Check to make sure you do not have and errors or warnings. Depending how you originally setup your Apache config, the /cgi-bin/ ScriptAlias may already be implemented. In this case, just remove that line from the configuration file. (Don't forget to reload the configuration after all changes).
You should now be able to navigate to http://yourdomain.ext/awstats/awstats.pl and see the existing webstats from your access.log file.
Automating AWStats updates
AWStats will not automatically update by default. I cuggest using Cron to automate the process:
Add this to crontab and it will update stats once every three hours. You can adjust the timing to suit your needs. I have seen AWStats update on a weekly basis, daily basis, and even sometimes every couple minutes. You will need to add a separate crontab line for each domain AWStat is monitoring.
0 */3 * * * root /usr/lib/cgi-bin/awstats.pl -config=yourdomain.ext -update >/dev/null
Securing AWStats
If you are at this step, you should have a working AWStats. One issue is AWStats does not come secured by default. They do offer to enable Authentication in the configuration, but I think it is just easier to generate a simple .htaccess file. This method is a quick and dirty method for securing AWStats. If you require a more sophisticated method of securing AWStats, please consult the official documentation.
Navigate to /usr/lib/cgi-bin/ this is where awstats.pl is located.
Create a new .htpasswd file:
htpasswd -cb /path/to/.htpasswd username password
Create a new .htaccess file with the following inside:
AuthName "AWStats Authentication" AuthType Basic AuthUserFile /path/to/.htpasswd Require valid-user
Now if all goes well, when you refresh your browser you will be prompted to enter a username and password to access AWStats.
This should get you to a point where AWStats is usable and (reasonably) secure. From here you can add Plugins or further configure AWStats to fit your individual needs.
World of Warcraft Account Security
Recently there has been discussions in my Guild regarding World of Warcraft account security. I believe this is a perfect opportunity to give my opinion on measures that I believe must be taken to ensure increased general security of your computer along with your World of Warcraft account.
One thing I must make clear is there is no such thing as a completely secure networked computer. The suggestions listed below are simply extra precautions that must be taken to minimize the chance of your computer being compromised.
* - Applies to World of Warcraft only.
Get an Authenticator*
Having an Authenticator will virtually eliminate the chance of your account being compromised. The Blizzard Authenticator costs $6.50 from the Blizzard Store. If you are an iPhone/iTouch user, you can download the Mobile Authenticator for free. Having an Authenticator is no excuse not to do the remaining suggestions.
Web Browser
Use a secure browser. For the sake of speaking, that pretty much means anything besides Internet Explorer. My personal recommendation is Google Chrome or Firefox. For each, I highly recommend the WOT plugin.
WOT’s safe browsing tool warns you about risky sites that can’t be trusted: Online shops that cheat customers; download sites that deliver malware; sites that send spam; and those with inappropriate content for kids.
Web of Trust provides an additional layer of security when visiting websites. WOT is community managed, meaning if someone spots a phishing website, they can report it. The report is upload to WOT servers, if you try to access the website that has received a poor rating, WOT will block you from going to the website without your express permission. If you use Firefox, in addition to WOT, I also highly suggest NoScript. Currently, Google Chrome does not have a NoScript extension available.
Passwords
Your World of Warcraft password should be entirely different from any other service you use. Generally speaking, a password should be at least 8 characters long with upper/lower case letters, numbers, and symbols. Your World of Warcraft password (along with other sensitive passwords) should be changed at least once a month. It takes 2 minutes to do, don't be lazy. An example of a good password would be 'I3n&$VW49*'.
Anti-Virus, etc.
Windows users - Having AV software is not full proof. Consider it just another way to decrease the chances of having malicious software installed on your computer (for a long period of time). I personally recommend Avira or NOD32. Along with AV software, I also recommend Spybot and Malwarebytes (Free Edition is fine). Malwarebytes is specifically targeted to Malware, harmful software that is generally not picked up by AV software. AV software should be set to automatically update and run daily (Both NOD32 and Avira provide this option, as do many other AV's such as AVG and Avast). I would recommend running anti-malware software at minimum once a week.
For Mac(OSX)/Linux users, The options for security software is rather slim. I can recommend ClamXav(Mac) and Clamav(Linux) for virus scanning. I also recommend rkhunter for OSX/Linux systems. Generally speaking, there is not much more that can be done for OSX systems in terms of AV software. Sadly, Apple has spread false information on commercials by suggesting OSX is immune to viruses, until OSX suffers a mass attack, it is unlikely much further production of AV software will occur. As for Linux systems, there are other precautions that can be taken, but I will assume if you use Linux, you should know how to properly secure your system.
Note: Debian based distrobutions can run the follow command to download rkhunter and clamav:
sudo apt-get install clamav rkhunter #rkhunter -c to run #clamscan -r in '/' directory to run
Updates
Windows users - Automatic Updates should be turned on. Keep your system updated at all times. Microsoft is constantly releasing security patches to fix potential vulnerabilities in your system. If you are still using XP (or anything older) update to Windows 7 as soon as possible. When updates for your system become available, do not postpone restarting your computer to take effect, do it immediately when it asks.
OSX users - By Default, OSX will check for System Updates once a week (This setting can be changed in System Preferences -> Software Update). Install updates whenever they are available.
Linux users - If you are using a Debian based system, the following commands can be executed from a Terminal:
sudo apt-get update sudo apt-get upgrade
Other non-Debian based Distributions should consult the proper documentation.
Common Sense
Be smart when you use your computer.
- One precaution that should be taken is when reading email. Never click on links masked by anchor tags (HTML), especially World of Warcraft related emails. If you receive an email from Blizzard asking you to log in to your account, or a beta key, it is most likely a scam.
- When using your laptop on a public network, be very careful to use SSL connections while logging in/reading email or any other services. If you are on a public network, you should always assume that someone is watching and logging everything you do (this includes cleartext logins). For maximum security, I recommend always using hardwired connection wherever possible (this includes on a home network also).
- If at any point you find your computer acting strange, immediately stop what you are doing, update and run your protection software.
- If your World of Warcraft account is compromised, and virus scans show up nothing on your computer. Do not assume one is not there. Change the password for your email and WoW account on a different computer, then work on finding out what caused the security breach on your WoW computer.
Conclusion
Everything above may seem like a lot to take in at first, especially if you have little to no protection on your computer to begin with. The hour or two it will take to setup will be well worth it if your World of Warcraft account becomes compromised. Not only will following my suggestions increase the overall security of your system, it will also save you from possible embarrassment if your account becomes compromised. Once you get everything setup, it should not take more then a half hour of manual work per week to keep your system up to date and secure. I will repeat again, having this security software in place will not make your computer full proof against attack. The above software will only minimize the chances of your system becoming compromised.
WoW on Linux
Several months ago I switched to Ubuntu as my primary OS. The main reason I continued to use Windows at all was World of Warcraft. After much trial and error I have World of Warcraft running at a very acceptable performance rate on my system. Well enough to delete my Windows partition entirely from my hard drive. I recently posted on /r/wow on Reddit about playing World of Warcraft. Quite a few questions were asked. I will cover some of the more common ones in greater detail.
- Will my old AddOns work?
Short Answer: Yes.
Long Answer: Yes. Wine runs World of Warcraft. Essentially AddOns add to the existing functionality of WoW. WoW AddOns cannot communicate outside of World of Warcraft. Therefore there should be no compatibility issues. The people over at WoWMatrix even have a native Linux client available. The WoWMatrix client makes updating AddOns as easy as clicking a button. Windows based WoW AddOn clients such as the Curse Client may also work using Wine, I have not tested though. - Should I install WoW using CD, Installer, or Copy?
If you have an existing WoW install on another partition, hard drive, or computer I would highly recommend directly copying the entire WoW folder over to your Linux partition. It is by far the fastest way. My second recommendation would be to use the WoW universal installer. The universal installer downloaded the entire game over the internet, eliminating the need for CDs. Depending on your internet connection speed, expect this to take at least several hours. Installing from the CDs should be a final resort. WoW installation over CDs can sometimes be very tricky and time consuming. The extra effort is not worth the extra time the universal installer will take. If you must go this route, and if you have issues with installing from the disks, try copying all data from each disk to one folder on your hard drive and run the installer from that folder. This is a work around for a common problem while installing via the CD. - Hardware
Hardware selection is very important, especially while using Linux to play WoW. Generally speaking 4GB of RAM and a dual core processor is a minimum. The graphics card is especially important. Currently a NVidia card will perform better then a comparable ATI card under Linux. This is because ATIs Linux drivers just aren't that good. There has certainly been improvements in the past year, though they have not quite caught up to NVidias Linux drivers quite yet. Do not be scared away if you have an ATI card though. I personally use an ATI Radeon 4870 1GB card. I play on ultra settings and I get 60+FPS while questing/doing dailies. ~40FPS doing BGs other then WG. The biggest downfall of this card is when raiding in >15 groups. Often in large groups I will get between 20-30FPS, sometimes lower. I usually lower my Video settings to medium while doing these activities. Often it is not noticeable, in such a large group it is difficult to determine FPS.My Hardware: 4GB RAM, AMD Phenom II x4 940(4 x 3.0GHz), ATI Radeon 4870.
Something else worth mentioning is the lack of a hardware cursor with OpenGL. This means that the mouse will become sluggish if FPS drop below 30FPS. There is a patch for Wine available that will use the systems hardware cursor. Some functionality is lost though, such as hovering over tooltips. My primary character is a Warlock. I have most my keys bound, making the mouse issue trivial at best. The mouse issue should not be an issue for anyone besides healers or anyone who is a clicker.
- Stablilty
Stability is the same as would be expected using Windows. I rarely ever have WoW/Wine freeze while playing. If you have issues, I would recommend looking for other possibilities such as bad ram, or AddOns conflicting. I would also recommend running a repair on WoW. I have not run into a Wine specific bug for several months. - Tips?
I have a few tips that hopefully will ease the tension of switching from Windows to Linux for World of Warcraft. Most importantly, make sure you have the latest GPU driver available for your card. Drivers are always improving, often fixing issues, and increasing performance. Also make sure all desktop effects are off while running WoW. If you are using Ubuntu/Gnome - Goto: System > Preferences > Appearance ---> Click on Visual Effects, and select None to turn off all effects. This is important, more times then not, WoW/Wine will not run at all with any desktop effects enabled, if it does - expect less then desirable performance. I would also suggest using another desktop manager other then GNOME or KDE. Both of these are heavy on resources, when playing WoW every resource is vital. My personal recommendation would either be to use just a Window Manager (OpenBox, FluxBox, etc) or a lightweight desktop environment such as XFCE.
The journey to World of Warcraft on Linux will most likely be difficult in the beginning. Don't expect everything to work flawlessly the first time around. Don't give up, the effort will be well worth it. I hope the answered questions above will help to determine if WoW/Linux is right for your system. There are already many great installation guides floating around the internet, I would recommend the installation guide on WoWWiki.
Mangler – A native Linux Ventrilo Client!
Mangler is an open source VOIP client capable of connecting to Ventrilo 3.x servers. It is capable of performing almost all standard user functionality found in a Windows Ventrilo client. Mangler is developed and maintained by Eric Kilfoil and Daniel Sloof. -mangler.org
In my experience, using Ventrilo on Linux (using Wine) has always been troublesome at best. Often I would have to resort to using hacked patches, or giving up some functionality just so I could use Ventrilo while raiding. Some newer versions would completely break functionality on Wine. This problem has all come to an end with the release of a fantastic new software called Mangler. It was released a month ago. It is a native Ventrilo client for Linux systems. I have used this software flawlessly for a few weeks now. I personally use this software while playing World of Warcraft on Wine. The interface is clean, and supports PTT functionality (both keyboard and mouse options). Mangler also claims to support both GSM and Speex codecs, thought I have only tested it with Speex. Mangler also supports individual user volume control. This is quite a list of functionality for a version 1.0. I consider this a must have piece of software if you need Ventrilo on a Linux system.
Adjust ATI Fan Speed in Ubuntu
I found this post hovering in my Drafts folder today, the blog post is old but the information still applies.
Currently ATI drivers do not have the ability to modify fan speeds from their GUI. Here is a quick and easy way to manually adjust fan speeds via Terminal. The commands below work with my ATI Radeon 4870 card, I would assume they will also work with any ATI card with a fan though. Note: ATI drivers from ATI website are required.
To check the temperature of your card:
aticonfig --adapter=0 --od-gettemperature
To change the fan speed:
aticonfig --pplib-cmd "set fanspeed 0 XX"
(Where the XX is replace it with the fan speed percentage)
