Pages

Showing posts with label error. Show all posts
Showing posts with label error. Show all posts

Wednesday, May 13, 2020

DHCP server listen on alias interface (eth0:1)

Linux server with more than one IP address on the same interface.

eth0 - 192.168.0.1/24
eth0:1 - 10.1.42.1/24

We want DHCP server to serve IP addresses only from 10.1.42.0/24 . If we do this in config file like this:

 subnet 10.1.42.0 netmask 255.255.255.0 {
                range 10.1.42.30 10.1.42.90;
                option broadcast-address 10.1.42.255;
                option routers 10.1.42.1;
        }

it will fail to start and produce the following error:

dhcpd: No subnet declaration for eth0 (192.168.0.1).

The correct configuration is to use shared-network parameter and define all the networks of the physical interface inside it.

shared-network horizon9net {
        subnet 192.168.0.0 netmask 255.255.255.0 {
        }

        subnet 10.1.42.0 netmask 255.255.255.0 {
                range 10.1.42.30 10.1.42.90;
                option broadcast-address 10.1.42.255;
                option routers 10.1.42.1;
        }
}

Wednesday, May 13, 2015

Qmail on OpenBSD 5.7 qmail-queue problem.

OpenBSD 5.7 default install with netqmail-1.06 installation.

The problem: When you try to send mail the qmail server returns the following error:
geroy@newsrv:~$ telnet localhost 25
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
220 mx1.polycomp.bg ESMTP
helo
250 mx1.polycomp.bg
mail from: test@mail.bg
250 ok
rcpt to: testovacc@gmail.com
250 ok
data
354 go ahead
test test 1 2 3
.
451 qq trouble creating files in queue (#4.3.0)
The solution: Default installation of OpenBSD 5.7 makes /var directory mounted with nosuid option. Remove it from /etc/fstab and then reboot.
# cat /etc/fstab
f292a8d8eba5b8dc.b none swap sw
f292a8d8eba5b8dc.a / ffs rw 1 1
f292a8d8eba5b8dc.k /home ffs rw,nodev,nosuid 1 2
f292a8d8eba5b8dc.d /tmp ffs rw,nodev,nosuid 1 2
f292a8d8eba5b8dc.f /usr ffs rw,nodev 1 2
f292a8d8eba5b8dc.g /usr/X11R6 ffs rw,nodev 1 2
f292a8d8eba5b8dc.h /usr/local ffs rw,nodev 1 2
f292a8d8eba5b8dc.j /usr/obj ffs rw,nodev,nosuid 1 2
f292a8d8eba5b8dc.i /usr/src ffs rw,nodev,nosuid 1 2
f292a8d8eba5b8dc.e /var ffs rw,nodev,nosuid 1 2
remove nosuid to look like this:
f292a8d8eba5b8dc.e /var ffs rw,nodev 1 2
Save and reboot.

Monday, April 28, 2014

MRTG error on Debian Squeeze

The error:
rogue:~# mrtg /etc/mrtg.cfg
2014-04-28 16:32:17: WARNING: Can not determine ifNumber for public@127.0.0.1:     ref: 'Name'     key: 'eth0'
2014-04-28 16:32:17: WARNING: Can not determine ifNumber for public@127.0.0.1:     ref: 'Name'     key: 'eth1'
2014-04-28 16:32:17: ERROR: Target[127.0.0.1_eth0][_IN_] ' $target->[0]{$mode} ' did not eval into defined data
2014-04-28 16:32:17: ERROR: Target[127.0.0.1_eth0][_OUT_] ' $target->[0]{$mode} ' did not eval into defined data
2014-04-28 16:32:17: ERROR: Target[127.0.0.1_eth1][_IN_] ' $target->[1]{$mode} ' did not eval into defined data
2014-04-28 16:32:17: ERROR: Target[127.0.0.1_eth1][_OUT_] ' $target->[1]{$mode} ' did not eval into defined data
How to fix it:

# cd /var/lib/mrtg
# mv _etc_mrtg.cfg _etc_mrtg.cfg.old

Now run again mrtg /etc/mrtg.cfg - the error is gone.

Wednesday, September 18, 2013

Qmail starting error "alert: cannot start: unable to open mutex"

If you are getting this error message when you try to start qmail-send - most probably you are moving qmail from old installation to a new server.

The problem comes from missing diretories (and files) which are on most distributions links and when you archive it the real directories will not be trasfered.

Directory is /var/qmail/queue and as you can see from the example bellow it is just a symlink to another directory (example is from NetBSD qmail package):

 # ls -la /var/qmail      
drwxr-xr-x   2 root  wheel  512 Sep 18 15:25 .
drwxr-xr-x  26 root  wheel  512 Aug 24 22:11 ..
lrwxr-xr-x   1 root  wheel   24 Jul 16 04:36 alias -> /usr/pkg/etc/qmail/alias
lrwxr-xr-x   1 root  wheel   12 Jul 16 04:36 bin -> /usr/pkg/bin
lrwxr-xr-x   1 root  wheel   34 Jul 16 04:36 boot -> /usr/pkg/share/examples/qmail/boot
lrwxr-xr-x   1 root  wheel   26 Jul 16 04:36 control -> /usr/pkg/etc/qmail/control
lrwxr-xr-x   1 root  wheel   24 Jul 16 04:36 doc -> /usr/pkg/share/doc/qmail
lrwxr-xr-x   1 root  wheel   12 Jul 16 04:36 man -> /usr/pkg/man
lrwxr-xr-x   1 root  wheel   16 Jul 16 04:36 queue -> /var/spool/qmail
lrwxr-xr-x   1 root  wheel   24 Jul 16 04:36 users -> /usr/pkg/etc/qmail/users

So the real directory is "queue -> /var/spool/qmail" and here is the listing of subdirs:

# ls -la
drwxr-xr-x  11 qmailq  qmail  512 Sep 18 15:34 .
drwxr-xr-x   8 root    wheel  512 Jul 16 04:36 ..
drwx------   2 qmails  qmail  512 Sep  9 15:11 bounce
drwx------  25 qmails  qmail  512 Jan 19  2008 info
drwx------   2 qmailq  qmail  512 Sep 18 13:55 intd
drwx------  25 qmails  qmail  512 Jan 19  2008 local
drwxr-x---   2 qmailq  qmail  512 Jan 19  2008 lock
drwxr-x---  25 qmailq  qmail  512 Jan 19  2008 mess
drwx------   2 qmailq  qmail  512 Sep 18 13:55 pid
drwx------  25 qmails  qmail  512 Jan 19  2008 remote
drwxr-x---   2 qmailq  qmail  512 Sep 18 13:55 todo


Make sure to transfer this directory to the new server and also chown the dirs with correct permissions.

The actual error is caused by missing file sendmutex which resides in /var/spool/qmail/lock/ directory

# ls -la /var/spool/qmail/lock
total 12
drwxr-x---   2 qmailq  qmail   512 Jan 19  2008 .
drwxr-xr-x  11 qmailq  qmail   512 Sep 18 15:34 ..
-rw-------   1 qmails  qmail     0 Jan 19  2008 sendmutex
-rw-r--r--   1 qmailr  qmail  1024 Sep 16 09:39 tcpto


If this file does not exist just create it with the following command (make sure also to change the file owner):
# touch /var/qmail/queue/lock/sendmutex
# chown qmails:qmail /var/qmail/queue/lock/sendmutex


Wednesday, January 9, 2013

Joomla FTP Layer - permissions and solution

When using commercial hosting with CPanel interface with Joomla you can be stuck by problem with file permissions. Errors like these are common:
Warning: Failed to move file!
The problem occurs  when uploading and installing modules/templates in Joomla admin interface. There are a lot of advises out there that suggest you to do "chmod 777 somedir" to resolve this problem. This is BAD solution and should never be used. Here is explanation why is this happening and how can you fix it without changing permissions.

When you buy hosting you get username/password for CPanel and ftp account which are identical. Installing Joomla on such hosting is not a problem but when trying to install template/module in Joomla admin panel you can see the above error message.

When uploading and installing files from Joomla admin panel, uploaded file is set to different owner than your username for the hosting. Uploaded file is owned by user started the apache web server. On most linux distributions it is www, www-data, http and so on. So when uploaded with different user the file can't even be deleted by your account and you need to contact hosting administrator to delete it for you. What you need to do is to make Joomla upload file with your hosting username/password. This is done by enabling FTP layer in Joomla global configuration tab and filling it with the right data (user/pass/ftp root). This can be done on installation process of Joomla but it is disabled by default. If you don't do this the final process of writing configuration.php will fail and you need to save and upload it manually.

How to enable it manually. Lets assume that your Joomla installation at address http://yousite.com/joomla. If you login in CPanel you will see that your home directory is something like "/home/username/". Document root of the web server is /home/username/public_html and Joomla is installed in /home/username/public_html/joomla. Here is configuration.php for ftp layer:

public $ftp_host = '127.0.0.1'; // change ftp ip address here
public $ftp_port = '21';
public $ftp_user = 'username';
public $ftp_pass = 'password';
public $ftp_root = 'public_html/joomla/';
public $ftp_enable = '1';

This should solve the problem with user mismatch when uploading modules/templates.
Other is hosting provider to support suPHP which is better solution to this problem.

Wednesday, November 21, 2012

Outlook 2010 reported error (0x800CCC0F) : Outlook cannot synchronize subscribed folders"

Outlook 2010 reported error (0x800CCC0F) : Outlook cannot synchronize subscribed folders"

С новият MS Office 2010 пакет идват и нови проблеми. При upgrade на Outlook до 2010 и използване на IMAP акаунт се получава следната грешка:

Outlook reported error (0x800CCC0F) : Outlook cannot synchronize subscribed folders"

Оказва се че Outlook 2010 при изтриване на съобщение при IMAP акаунт емейла се маркира като изтрит, но освен това се опитва да го премести в папка за изтрити съобщения. Старата версия на Outlook просто ги маркираше като изтрити без да ги мести никъде (и при purge се изтриваха).

Оказва се че по подразбиране на Outlook 2010 не е указана папката в която да се местят при изтриване съобщенията и при всеки опит да се провери пощата, Outlook се опитва да премести всички изтрити съобщения (които не са purged) в несъществуваща папка.

За да оправим този проблем е нужно следното, отиваме в Account Settings -> Advanced Account Settings след което избираме tab-a "Deleted Items". Избираме опцията "Mark items to delete but not move them", цъкаме на ок и всичко е наред.