Installing DokuWiki

DokuWiki – wiki engine, to create documentation.

On the test, I install DokuWiki in Ubuntu Server.

Install the necessary components and activate the module Rewrite:

sudo apt-get install apache2 libapache2-mod-php php-xml
sudo a2enmod rewrite

Download the archive with the latest version of DokuWiki and unpack it:

cd /var/www/html
sudo wget https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz
sudo tar xvf dokuwiki-stable.tgz
sudo mv dokuwiki-*/ dokuwiki

We will expose the right owner for all files (under which Apache2 works):

sudo chown -R www-data:www-data /var/www/html/dokuwiki

Create a test web configuration file:

sudo nano /etc/apache2/sites-available/dokuwiki.conf

Add content to it (we will tailor it to your needs, for DokuWiki you need AllowOverride All):

<VirtualHost *:80>
DocumentRoot /var/www/html/dokuwiki
<Directory /var/www/html/dokuwiki>
Options -Indexes
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>

We activate the web configuration and restart the web server:

sudo a2ensite dokuwiki
sudo service apache2 reload

Open the browser in the install page http: //SERVER/dokuwiki/install.php and follow the directions.

After the successful installation, delete the installation file:

sudo rm /var/www/html/dokuwiki/install.php

If you want to send email messages from the server, you can install Postfix for example:

sudo apt-get install postfix

See also:
Installing and Configuring Postfix
Installing and Configuring the Apache2 Web Server

Solution to the error “Unable to lock the administration directory (/var/lib/dpkg/)”

I noticed some error when executing apt-get install and other commands with apt-get:

Unable to lock the administration directory (/var/lib/dpkg/); is another process using it?

I noticed the error on my virtual test Ubuntu Server, on which I performed various settings via apt-get install and during the execution the power was lost and the installation was not completed.

In my case, after the server was turned on, the installation continued in the background and of course apt-get commands were not accepted, so the best option for solving the error is to wait, the “top” command shows that the installation process is continuing.
Also, if auto-update is enabled, the system can install them, in this case it is advisable to wait.

If there is no time to wait, then you can unlock the directory with the command:

sudo fuser -vki /var/lib/dpkg/lock

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 su

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)