My surviving in debian (blog)

dwm

Verified User
Joined
Dec 4, 2007
Messages
65
Location
Netherlands
I just installed Debian on my new Dell 860 server and i am willing to share all my problems, and the solutions i found for it. I hope more people will come with solutions so that this Debian section will grow some bigger :)

Installed version (basic installation without webserver):
http://cdimage.debian.org/debian-cd/4.0_r1/i386/iso-cd/debian-40r1-i386-netinst.iso

After installation you will probably start with downloading directadmin, which is not a good thing. It will crash because several parts are missing and/or not in debian OS.

This is my current `version` output (after installing most required packages):
Code:
Linux version 2.6.18-5-686 (Debian 2.6.18.dfsg.1-13etch4) ([email protected]) (gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)) #1 SMP Wed Oct 3 00:12:50 UTC 2007

I will discuss below my experiences :)
 
Preparing your basic installation with additional software:
Adding nameservers (DNS) for resolving website names to ipadresses. Ask your hosting company for the companies nameserver.

pico /etc/resolv.conf
add (as much nameservers as you have, one per line):
Code:
nameserver 1.2.3.4

Adding ip addresses (because you need two for dns, 1 for shared-ip hosting):
For each extra ip address use this template. Add it to the end of the file. Ip addresses and netmask are different for every network. Ask your hosting company for this. If you make mistakes with adding ipaddresses your system will block you out. So BE CAREFUL!

# pico /etc/network/interfaces
Code:
auto eth0:1
iface eth0:1 inet static
        address 1.2.3.3
        netmask 255.255.255.255

auto eth0:2
iface eth0:2 inet static
        address 1.2.3.4
        netmask 255.255.255.255
# /etc/init.d/networking restart

Now your ips are working you need to install several updates for your system to work properly. First do an overall update:

Code:
apt-get update

Now new packages will be installed with the latest version. Now you need to install several packages of software needed for installing directadmin, and compiling other programs:

Code:
wget http://files.directadmin.com/services/debian_4.0/wget -O /usr/bin/wget
apt-get install cron
apt-get install gcc
apt-get install g++
apt-get install make
apt-get install daemon

# install sort of chkconfig tool. [color=red]I will make a conversion script for it later[/color].
# chkconfig --del <service name> (will in debian be:) update-rc.d -f script_name remove
apt-get install sysv-rc-conf

# now symlink the init.d folder used in Redhat to the Debian location:
mkdir /etc/rc.d/; cd /etc/rc.d/; ln -s /etc/init.d/ init.d

Do not install up2date. The directadmin installer will say something about it, but you do not need it. For installing software use:

Code:
# search
apt-cache search name_of_the_software

# install
apt-get install name_of_your_software

# update
apt-get update name_of_your_software

Installing DirectAdmin:

Code:
cd /home/
wget http://www.directadmin.com/setup.sh
chmod 755 setup.sh
./setup.sh

Now enter your received licensee codes and install directadmin.

Probably your output will be something like this:
Code:
Cannot find /etc/sysconfig/rhn/up2date... up2date may break things.
*** You have /var partition.  The databases, emails and logs will use this partition. *MAKE SURE* its adequately large (6 gig or larger)
Press ctrl-c in the next 3 seconds if you need to stop
All Checks have passed, continuing with install...
./install.sh: line 61: /sbin/chkconfig: No such file or directory
./install.sh: line 62: /sbin/chkconfig: No such file or directory
Checking quotas...
done
done
./install.sh: line 220: ./directadmin: cannot execute binary file
./install.sh: line 223: ./directadmin: cannot execute binary file

You can normally start directadmin now with:
Code:
/etc/init.d/directadmin start

Starting DirectAdmin: daemon: fatal: refusing to execute unsafe program: /usr/local/directadmin/directadmin (/usr/local is group writable)

touch: cannot touch `/var/lock/subsys/directadmin': No such file or directory

but it will give errors. I am currently busy on editing the directadmin file. I only commented the line which includes the functions to get this output(line 14).
 
Last edited:
Fixing the chkconfig problem

I have made the workaround script for adding and deleting services. I dont know why it doesnt work if i uncomment the delete part, but i get some newline errors or something??

cd /usr/sbin/
touch chkconfig
chmod 755 chkconfig
pico chkconfig
Code:
See post below!
Press CTRL+O to save. Ready for usage.
 
Last edited:
Hello,

Just a followup, the /usr/local directory was chmod to 744, which didn't work. I've changed it to 755 so that the diradmin user could actually see it's own files.

John
 
That's correct. It is working now. But i am first going to do a global check before i start using the server for customers. I have some missing packages on my system, which i will try to locate since directadmin uses them.

killproc - in the directadmin (re)start script

Workaround:
cd /usr/bin
ln -s /usr/bin/killall killproc

# /etc/init.d/directadmin stop
Stopping DirectAdmin: 3145 3146 3147 3148 3149 3150 3166

# /etc/init.d/directadmin start
Starting DirectAdmin:

# /etc/init.d/directadmin reload
Reloading DirectAdmin config file: 3145 3146 3147 3148 3149 3150 3175

# /etc/init.d/directadmin restart
Stopping DirectAdmin: 3138
Starting DirectAdmin:
 
Last edited:
Starting the backup system on debian

For creating complete backups you need a directory created in the systemroot. I have partitions and the most of my space is in the /home/ partition, and not in the / partition. So i have made a folder called 'backup' in the /home/ and added a shortcut in the /

Code:
# ln -s /home/backup/ /backup
# ls -al  /
total 108
drwxr-xr-x 22 root root  4096 2007-12-07 02:48 .
drwxr-xr-x 22 root root  4096 2007-12-07 02:48 ..
-rw-------  1 root root  6144 2007-12-07 01:39 aquota.group
-rw-------  1 root root  8192 2007-12-06 17:57 aquota.user
lrwxrwxrwx  1 root root    13 2007-12-07 02:48 backup -> /home/backup/
etc.
 
Using NTP for correct time display

You really need to set your time correct for your timezone, else your backups will run at day instead of at night.

Code:
# apt-get install ntp

For editing the defaults use:
Code:
# pico /etc/ntp.conf

Also edit the /root/.bashrc file:
Code:
# pico /root/.bashrc

and uncomment all lines which are not comments, and save the file with CTRL+O

Code:
# ~/.bashrc: executed by bash(1) for non-login shells.

export PS1='\h:\w\$ '
umask 022

# You may uncomment the following lines if you want `ls' to be colorized:
 export LS_OPTIONS='--color=auto'
 eval "`dircolors`"
 alias ls='ls $LS_OPTIONS'
 alias ll='ls $LS_OPTIONS -la'
 alias l='ls $LS_OPTIONS -lA'

# Some more alias to avoid making mistakes:
 alias rm='rm -i'
 alias cp='cp -i'
 alias mv='mv -i'
 
Debian DirectAdmin: Apache is functioning normally

I configured my apache correct. Is was the first and clean install, so i didnt understand why it didnt work as i configured in DirectAdmin. I did get as response 'Apache is functioning normally' for every domainname.

John has fixed this by email. I quoted the problem and solution here:
http://www.directadmin.com/forum/showthread.php?t=22882
 
I have seen that not all software installed with the ./build tool are services yet. Use my chkconfig script for adding those to the system services:

chkconfig --add named
chkconfig --add vm-pop3d
chkconfig --add httpd
 
In meantime i have fixed lots of problems with apache 2. I posted those in new threads:

http://www.directadmin.com/forum/showthread.php?t=22968
http://www.directadmin.com/forum/showthread.php?t=22931
http://www.directadmin.com/forum/showthread.php?t=22932
http://www.directadmin.com/forum/showthread.php?t=22984
http://www.directadmin.com/forum/showthread.php?t=22990

It was a pity finding out how to install suphp working. The only way is to compile it as CGI. That is exactly what i have done. First delete the installed php CLI version.

updatedb
whereis php

Now delete all php entries you find! In my situation this were:
rm -rf /usr/local/lib/php/
rm -f /usr/local/bin/php
rm -f /usr/local/bin/phpize
rm -f /usr/local/bin/php-config

After that i changed the options.conf for compiling the new php:
cd /usr/local/directadmin/custombuild/
pico options.conf

Now while editing make the php part of your config look like this:
#PHP settings. default_php possible values - 4 or 5
default_php=5
php4_cli=no
php4_cgi=no
php5_cli=no
php5_cgi=yes
zend=yes

And your apache should be:
apache_ver=2.0

And:
#Custombuild options
clean=yes

Save and exit the options.conf. Now first we clean the build directory:

./build clean
./build update

And build php CGI:

./build php5-cgi

I think that rebuilding all modules is needed since you go from CLI to CGI. But i do not know the technique behind this build script. I answered y to all rebuild questions. After some time your php5 CGI is built. In the last lines of the installer you can find your php5 CGI file. The php CGI is not /usr/local/bin/php, but /usr/local/bin/php-cgi !!

If you try a httpd restart now you will see it results in a failure. Errors in the virtualhosts. A workaround for this is at:
http://www.directadmin.com/features.php?id=828

If you have applied the workaround, go back to your ssh shell and try to start the httpd: /etc/init.d/httpd start

If it still not works then rebuild all your configurations with:
cd /usr/local/directadmin/custombuild/
./build rewrite_confs
/etc/init.d/httpd restart

Now http/apache2 must really work. If you modified all your virtualhost templates and deleted the if/else/endif because of the problems, you will get an error on php_admin_value. To fix this you have to go to the templates custom directory and edit all virtualhost*.conf templates en comment the php_admin_value line with a # in front of it. Then do the rewrite as written above again and it works.

Installed, what now?
After installing you have to keep all users have theyre own group/user permissions correct. So files in /home/cust1/ all have to be cust1:cust1 and maximum chmod is 755. Higher chmod or another user will result in an internal server error! To fix internal server errors go in ssh and fix permissions:
chmod 644 file/folder
chown cust1:cust1 file/folder
 
hehe dwm, the funny thing is i ordered the exact same server.
dell 860 (xeon quad, 4gb, 250 r1).

after i've read your thread i was sure to go with ubuntu :)
alltho the debian 4.0 r1 cd also didnt install.
 
Last edited:
hehe dwm, the funny thing is i ordered the exact same server.
dell 860 (xeon quad, 4gb, 250 r1).

after i've read your thread i was sure to go with ubuntu :)
alltho the debian 4.0 r1 cd also didnt install.

Hehe cool. I have the dell 860 - 3050 variant with Dual Xeon processor, 2GB ram and 160Gb r1

It is a pain in the ass to start with debian without good experiences at this time, but if no-one does start using it with DirectAdmin, or no-one does start adding threads for debian then the problems will never be fixed.
I hope that other sysadmins/users also will add theyre experiences and troubles (and solutions ofcourse) at the directadmin Debian section.

And since ubuntu is also debian i would like to ask to post all your problems (with or without) solutions at this forum. I would love to help you :)
 
Restarting dovecot: /etc/dovecot/dovecot.conf missing

I have running dovecot succesfully and i am testing all user accounts manually to go forward at the problem instead of awaiting for problems. With restarting dovecot is missing the configuration file, while it was not in first case. If you have this too, look behind:

/etc/init.d/dovecot stop
/etc/init.d/dovecot start

Gives as output:
File /etc/dovecot/dovecot.conf not found. Fixed this with symlinking.. too simple, though:

# cd /etc
# mkdir dovecot
# cd dovecot
# ln -s ../dovecot.conf dovecot.conf

Another way is to edit the /etc/init.d/dovecot and change every entry of '/etc/dovecot/dovecot.conf' to '/etc/dovecot.conf'. After one of the two the dovecot can be started again normal
 
Hey dwm,

Als eerste wil ik zeggen dat je goed bezig bent voor debian/ubuntu op het forum, great stuff and keep it up!

How is webmail running for you?

Do you get this in squirrelmail? :
111 : Connection refused

I do, and i would like to fix it.

Here is alot of stuff but it doesnt apply to debian/ubuntu:
http://www.directadmin.com/help/item.php?id=18

There is also some other stuff but its about dovecot which i dont use.

Got any ideas?
 
Hmm, i dont use squirrelmail because of the loads of bugs and exploits in it always. I am using Ubimeiau on a private part of the website, and planning to develop my own webmail on base of an existing mail/smtp php5 class.

I will look to it tomorrow, have to bring some christmas presents to some partner companies today first!
 
Hey dwm,

Als eerste wil ik zeggen dat je goed bezig bent voor debian/ubuntu op het forum, great stuff and keep it up!

How is webmail running for you?

Do you get this in squirrelmail? :
111 : Connection refused

I do, and i would like to fix it.

Here is alot of stuff but it doesnt apply to debian/ubuntu:
http://www.directadmin.com/help/item.php?id=18

There is also some other stuff but its about dovecot which i dont use.

Got any ideas?

Are you still using exim with vm-pop3d (mbox format)? If that is so, you really need to do some work. The imapd does not react, it refuses the connection, so it is not started. Else it would give an errormessage :)

// check for running pop3 deamon
# ps aux | grep pop3d | grep -v grep
// no result? its not running. Try this one:
# px aux | grep imap
// still nothing? check your init.d
# ls -al /etc/init.d/
// do you SEE the vm-pop3d file?
// if yes: /etc/init.d/vm-pop3d start
// if no: you need to install it: are you using customapache or custombuild?
 
Are you still using exim with vm-pop3d (mbox format)? If that is so, you really need to do some work. The imapd does not react, it refuses the connection, so it is not started. Else it would give an errormessage :)

Hm, only problem i just fixed are the file permission problems (using dovecot). Default the squirrelmail/data/ folder has apache:apache as permissions, but this has to be webapps:webapps to work:

cd /var/www/html/squirrelmail/
chown webapps:webapps data/* -R
 
hiya dwm

vm-pop3d is running but imapd not, do i need to start the service manually?

does this work on debian, but then init.d? :


-> http://help.directadmin.com/item.php?id=18

3) Make sure xinetd has the proper settings:
RedHat: /etc/xinetd.d/imap

Code:
# default: on
# description: imapd
service imap
{
   disable = no
   socket_type = stream
   wait = no
   user = root
   server = /usr/sbin/imapd
   log_on_success += DURATION USERID
   log_on_failure += USERID
   nice = 10
}
 
Now delete all php entries you find! In my situation this were:

rm -rf /usr/local/lib/php/
rm -f /usr/local/bin/php
rm -f /usr/local/bin/phpize
rm -f /usr/local/bin/php-config

Does this not affect the directadmin skins ? As far as im aware the paths are hardcoded into the skins.
 
Back
Top