Solution of the error “Please run this cronjob as user amavis”

After installing updates on Ubuntu 14.04.1 LTS, an error with the text began to appear daily:

/etc/cron.daily/amavisd-new:
Please run this cronjob as user amavis
run-parts: /etc/cron.daily/amavisd-new exited with return code 1

The reason was the update of amavis and the migration when updating the configuration file /etc/cron.daily/amavisd-new in /etc/cron.d/amavisd-new, and for some reason the old file was not deleted.

As a result, the solution to this problem – make sure that the configuration file /etc/cron.d/amavisd-new is present and delete the old file /etc/cron.daily/amavisd-new.

Troubleshooting “Recipient address rejected: Intentional policy rejection, please try again later”

I once told alibaba.com the email of one of the servers with iRedMail, but the letters for some reason did not come.
In the logs /var/log/mail.log saw the following message:

Continue reading “Troubleshooting “Recipient address rejected: Intentional policy rejection, please try again later””

Automatically installing Mikbill in Debian 7

For the test, I will perform the automatic installation of Mikbill in Debian 7 and describe the process.

See also my article – How to make a bootable USB flash drive with Debian

Switch directly to the root user:

su -

Download the archive from Mikbill and unpack it:

wget http://www.mikbill.ru/mikbill.tar.gz
tar xzvf mikbill.tar.gz

Run the installation script in Debian 7:

cd DISTR/Debian7x
./install_debian7x

During the installation process, we answer the questions, the IP address of the billing page (where it will be opened), the billing domain, MySQL passwords.

After installing the billing did not open in the browser, there was an error:

502 bad gateway

To solve it, in the text editor opened the configuration:

nano /etc/php5/fpm/pool.d/www.conf

Found the string:

listen = /var/run/php5-fpm.sock

And replaced it with:

listen = /var/run/php-worker-socket

After rebooting the system, everything worked.

Check if Mikbill and radius are working with commands:

netstat -anp|grep 0.0.0.0:2007
netstat -anp|grep 0.0.0.0:1812
netstat -anp|grep 0.0.0.0:1813

The standard login and password to admin panel is admin/admin.
You also need to set the time zone in the system by typing:

dpkg-reconfigure tzdata

And the time zone in billing and /etc/php5/.

Remote Wake-up of the computer (Wake On LAN)

To remotely turn on the computer, you need to have an ATX power supply, a motherboard with Wake On LAN and BIOS enabled, a Wake On LAN network adapter.

When Wake On LAN is supported, the shut down computer powers the AC adapter that is in low power mode and listens to all packets going to its MAC address without answering them. If a Magic Packet comes, the network adapter sends a signal to turn on the power of the computer.

View active network adapters:

ifconfig

You will need the ethtool package, if it is not installed on the system, you must perform the installation:

sudo apt-get install ethtool

Check for WOL support:

sudo ethtool eth0 | grep Wake

The result of the command if the network card is working with WOL and it is enabled:

Supports Wake-on: g
Wake-on: g

The result of the command when WOL is off:

Wake-on:d

Possible result letters (taken from man ethtool information):

p Wake on PHY activity
u Wake on unicast messages
m Wake on multicast messages
b Wake on broadcast messages
a Wake on ARP
g Wake on MagicPacket™
s Enable SecureOn™ password for MagicPacket™
d Disable (wake on nothing). This option clears all previous options.

To turn on WOL:

sudo ethtool -s интерфейс wol g

Turning on the computer:

apt-get install wakeonlan
wakeonlan -p 50000 00:01:02:03:04:05

-p indicates the UDP port number.

On the Internet, there are also many sites and applications for phones that allow you to send a package to a remote computer.

See also:
Using ethtool

Using ethtool

ethtool – a utility for configuring network interfaces in Linux.

You can install ethtool in Ubuntu / Debian using the command:

sudo apt-get install ethtool

Let’s look at the names of network interfaces:

ifconfig -a

Switch to root, as some commands require elevated privileges:

sudo -i

Example of viewing eth0 settings:

ethtool eth0

Example of viewing information about the network interface driver:

ethtool -i eth0

Viewing Network Interface Statistics:

ethtool -S eth0

View auto-negotiation settings:

ethtool -a eth0

The LED blinks for 3 seconds on the specified network interface:

ethtool -p eth0 3

Network Interface Test:

ethtool -t eth0 online/offline

View the current and maximum size of TX and RX buffers:

ethtool -g eth0

Manual speed setting of 100 Mb Full Duplex on the specified network interface (the specified parameters will be reset after the system restart):

ethtool -s eth0 speed 100 duplex full

Viewing help about ethtool:

ethtool -h

See also:
Configuring the Network in Linux
Changing TX and RX network interface buffers in Linux
Remote Wake-up of the computer (Wake On LAN)

IPTables rules for MySQL

If iptables locks all incoming connections (INPUT DROP) and to add external access to MySQL, you need to add rules:

iptables -A INPUT -p tcp -m tcp --dport 3306 -j ACCEPT

To access only a particular network, for example 10.0.0.0/24:

iptables -A INPUT -s 10.0.0.0/24 -p tcp -m tcp --dport 3306 -j ACCEPT

To remove a rule, we’ll specify the same command, replacing -A with -D, for example:

iptables -D INPUT -p tcp -m tcp --dport 3306 -j ACCEPT

To view the list of rules, use the command:

sudo iptables -nvL

I note that in order to open external access, you also need to comment out the line “bind-address = 127.0.0.1” in the my.cnf configuration file.

If by default INPUT ACCEPT, we first specify which IPs are allowed access, and only the last rule is blocked by all the others:

/sbin/iptables -A INPUT -s 127.0.0.1 -p tcp --destination-port 3306 -j ACCEPT
/sbin/iptables -A INPUT -s 192.168.1.5 -p tcp --destination-port 3306 -j ACCEPT
/sbin/iptables -A INPUT -p tcp --dport 3306 -j DROP

For example, using nmap, you can check locally and externally whether the access is filtered:

nmap -p 3306 localhost
nmap -p 3306 192.168.1.5

See also:
Configuring IPTables
Other my articles about MySQL