View Full Version : My surviving in debian (blog)
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):
Linux version 2.6.18-5-686 (Debian 2.6.18.dfsg.1-13etch4) (dannf@debian.org) (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):
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
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:
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:
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. I will make a conversion script for it later.
# 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:
# 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:
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:
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:
/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).
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
See post below!
Press CTRL+O to save. Ready for usage.
DirectAdmin Support
12-05-2007, 01:59 PM
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:
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 /
# 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.
You really need to set your time correct for your timezone, else your backups will run at day instead of at night.
# apt-get install ntp
For editing the defaults use:
# pico /etc/ntp.conf
Also edit the /root/.bashrc file:
# pico /root/.bashrc
and uncomment all lines which are not comments, and save the file with CTRL+O
# ~/.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'
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
It took me over the weekend, but i have fixed the installation of mysql 4.1 under Debian. I made a new thread for it so that everyone can post his/her questions about migrating to mysql 4.1 under Debian. The thread is here:
http://www.directadmin.com/forum/showthread.php?p=119855#post119855
greenm
12-18-2007, 03:21 AM
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 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 :)
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
greenm
12-20-2007, 03:27 AM
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
greenm
12-24-2007, 05:10 AM
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
# 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
}
iceuk626
12-24-2007, 05:16 AM
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.
@myself:
i have the problem that the php-cgi never dies. A workaround is here:
http://www.directadmin.com/forum/showthread.php?p=120452#post120452
Does this not affect the directadmin skins ? As far as im aware the paths are hardcoded into the skins.
No, the software installations are free to customise. I either dont believe paths of php are hardcoded, but if it is it should not be a problem because you reinstall php after the deletion process!
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
# 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
}
It should work too, the inetd.d answer. But what i see is your only problem that your imapd is not running. port 110 is pop3, and that should work if you (can) switch squirrelmail to pop3 access. For using imapd it has to be installed ofcourse. Your can check this with 'updatedb' and then 'locate imapd'. If no results, it is not installed *duh*. For installing i used before on CentOS just some package downloaded from the Internet. For Debian i use dovecot, so i dont really know how you can fix this. Maybe john knows a quick fix for this (support@directadmin.com).
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?
My squirrelmail runs smoothly :) I am gonna look to the other stuff to fix!
Today i made a workaround for the incorrect httpd configs which are generated by DirectAdmin every time i add or modify a user, domain or subdomain. The solution is to rewrite_confs, but i dont get why this isnt happening automatically. John tells me in every mailsupport to do './build rewrite_confs' so i automated this in a set of custom scripts:
http://www.directadmin.com/forum/showthread.php?p=120456#post120456
m4ri00sh
12-27-2007, 09:26 PM
Hey, Just wanted to say:
Good job!
PS:
After 6 months of testing (DA + Debian)... It's good to see somene starting thread like this. :)
.. If I just had more time for that.... :D
I have server open for testing so if you need someone to test something to compare a results, just let me know....
Hey, Just wanted to say:
Good job!
PS:
After 6 months of testing (DA + Debian)... It's good to see somene starting thread like this. :)
.. If I just had more time for that.... :D
I have server open for testing so if you need someone to test something to compare a results, just let me know....
Thats cool! I will keep that in mind, since i am thinking about creating some sort of ./build file for applying the fixes i described above..
If you are a user in group wheel or root, then it is a good thing to become root rights without logging in as root. Therefor you use 'su' or 'sudo'. Also 'visudo' (the sudoers file) is used by many. These are not installed by default. For installing use:
# apt-get install sudo
I found that some packages are not yet installed (on all systems), so here some goodies:
// First update all packages, else some commands will go wrong:
# apt-get update
// Install the local ftp client tool for testing
# apt-get install ftp
// Install the lsof monitoring tool for managing your system:
# apt-get install lsof
// Install dig, host and other BIND tools which are not included by default, but which are really needed at a good working system:
# apt-get install bindtools
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.