# sudo addgroup <groupname>
To add a new user to a existing group:
# sudo adduser <username> groupname
Articles, notes and random thoughts on Software Development and Technology
# sudo addgroup <groupname>
To add a new user to a existing group:
# sudo adduser <username> groupname
sudo apt-get upgrade
This will download and install all available updates to your existing system.
Good RAID FAQ on Linux here.
Walkthrough on setting up a software RAID array here
Check RAID status:
<code>/sbin/mdadm --detail /dev/md0</code>
Or check with this:
<code>sudo cat /proc/mdstat</code>
This is what a good status will look like:
<code> Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] md1 : active raid1 sdb5[0] sdc5[1] 1485888 blocks [2/2] [UU] md0 : active raid1 sdb1[0] sdc1[1] 242709888 blocks [2/2] [UU] unused devices: <none>
The [UU] (I think) indicates the status of both drives in the array, and both are Up
Removing drives: sudo mdadm /dev/md0 -r /dev/sdb1
Adding drives back to the array: sudo mdadm /dev/md0 -a /dev/sdb1
I only just realized recently that my apache2 config was outputting logs for my main domain into access.log, and all other virtual hosts into other_vhosts_access.log. As a result, awstats was not picking up hits to the majority of my sites.
To set up awstats to produce stats for each of my stats was relatively easy:
<code><br />
<VirtualHost *:80><br />
ServerAdmin example@example.com<br />
DocumentRoot /var/www/html/example<br />
ServerName www.example.com<br />
DirectoryIndex index.jsp index.html<br />
CustomLog /var/log/apache2/access_example.log combined<br />
</VirtualHost><br />
</code></p>
<li>Copy your /etc/awstats/awstats.conf to awstats_example.conf – one per each domain where example is the domain name
<li>Edit each awstats.conf and change the log entry to point to the log file you added in the apache2.conf above, change the DataDir to be /var/awstats/example, and SiteDomain to e.g. example.com
<li>Create new subdirs for each DataDir in /var/awstats
<li>Run the stats collection manually to check working:
<pre><code>
sudo /usr/bin/perl /usr/lib/cgi-bin/awstats.pl -update -config=example.com
</code>
<code> 0,30 * * * * www-data [ -x /usr/lib/cgi-bin/awstats.pl -a -f /etc/awstats/awstats_example.com.conf -a -r /var/log/apache/access_example.log ] && /usr/lib/cgi-bin/awstats.pl -config=example.com -update >/dev/null </code>
To access the stats for each of the domains, use the awstats config name passes as a param in the URL:
<code> http://www.example.com/awstats/awstats.pl?config=example.com </code>