Forum Moderators: bakedjake
The new host has installed Apache + PHP + mysql + phpMyAdmin. My first time logged in to the temp-server I did:
# locate phpmyadmin ¦ less
locate: /var/cache/locate/locatedb: No such file or directory(my response: blimey, but is this barebones or what!)
-bash: less: command not found
I have no experience of Debian, period, and little time to explore. Any help or experience that would assist to shorten this learning period would be greatfully received.
apt-get update && apt-get upgrade Afterwards you can install aptitude with the command:
apt-get install aptitude You can also install programs etc. with apt-get if you know their name: go to [packages.debian.org...] for the list. As "less" seems to be missing you can try:
apt-get install less I assume you're running "Debian stable", otherwise known as "Woody"?
Debian is good stuff: the package management makes it a breeze to administer. But you'll need to get a few more things installed first!
I don't think fresh installs of linux generally have the locate database built.
locate requires that a database be created which doesn't happen until the cron job kicks in for the first time overnight.It is now populated.
encyclo:
It looks like the machine is far too "bare-bones" to be useful.
I don't mind the barebones... only a temp server until my main server is transferred. A useful test-bed for me to gain experience. Also, an
apt-getjust gave
Reading database ... 11248 files and directories currently installed.so it is not quite so empty.
Try typing "aptitude" to see if it is installed. ... apt-get update && apt-get upgrade
apt-getinstead of
yum. Are there any big differences between the two that I need to watch out for? (One example just discovered: my experience of
yumis that it always asked y/n before completing, whereas just now
apt-get install joewent ahead and did it without any intervention - is this simply a config issue?)
aptitudeis installed. I think I prefer the command line! It also messed up the primary terminal screen after quitting.
Everything (already installed) turned out to be fully updated, and
lessinstalled without bother. Hooray!
Many thanks for the help so far. Any more Gotchas to watch out for?
rm [files]on rh asked for confirmation of each file; Debian does not.
I assume you're running "Debian stable", otherwise known as "Woody"?
lessdoes not work on directories
After much man-reading this was down to the pre-processor
lesspipe. RH has
lesspipe.sh, which seems to do it's job without complaint. So, after putting:
export LESSOPEN="¦/usr/bin/lesspipe.sh %s"
# alias rm='rm -i'...etc), `lesspipe.sh' was rsync'ed across, and less now works fine on directories.
Here is the shell script for those without access to a RH distro:
#!/bin/sh -(be warned that all `¦' (broken vertical lines) need to be replaced with a proper pipe character; it is a characteristic of these forum pages which causes endless grief)
#
# To use this filter with less, define LESSOPEN:
# export LESSOPEN="¦/usr/bin/lesspipe.sh %s"lesspipe() {
case "$1" in
*.[1-9n]¦*.man¦*.[1-9n].bz2¦*.man.bz2¦*.[1-9].gz¦*.[1-9]x.gz¦*.[1-9].man.gz)
case "$1" in
*.gz) DECOMPRESSOR="gunzip -c" ;;
*.bz2) DECOMPRESSOR="bunzip2 -c" ;;
*) DECOMPRESSOR="cat" ;;
esac
if $DECOMPRESSOR -- "$1" ¦ file - ¦ grep -q troff; then
if echo "$1" ¦ grep -q ^/; then #absolute path
man -- "$1" ¦ cat -s
else
man -- "./$1" ¦ cat -s
fi
else
$DECOMPRESSOR -- "$1"
fi ;;
*.tar) tar tvvf "$1" ;;
*.tgz¦*.tar.gz¦*.tar.[zZ]) tar tzvvf "$1" ;;
*.tar.bz2¦*.tbz2) bzip2 -dc "$1" ¦ tar tvvf - ;;
*.[zZ]¦*.gz) gzip -dc -- "$1" ;;
*.bz2) bzip2 -dc -- "$1" ;;
*.zip) zipinfo -- "$1" ;;
*.rpm) rpm -qpivl --changelog -- "$1" ;;
*.cpi¦*.cpio) cpio -itv < "$1" ;;
*.gif¦*.jpeg¦*.jpg¦*.pcd¦*.png¦*.tga¦*.tiff¦*.tif)
if [ -x "`which identify`" ]; then
identify "$1"
else
echo "No identify available"
echo "Install ImageMagick to browse images"
fi ;;
*)
case "$1" in
*.gz) DECOMPRESSOR="gunzip -c" ;;
*.bz2) DECOMPRESSOR="bunzip2 -c" ;;
esac
$DECOMPRESSOR -- "$1" ;;
esac
}if [ -d "$1" ] ; then
/bin/ls -alF -- "$1"
else
lesspipe "$1" 2> /dev/null
fi
The #2 Gotcha is the most important for me at the moment:
2 RH8+ has apache2, Debian has apache 1.3
apache2-mpm-worker - 2.0.54-2 - high speed threaded model
apache2-mpm-prefork - 2.0.54-2 - traditional model
apache2-mpm-perchild - 2.0.54-2 - experimental high speed perchild threaded model
As important for me as Apache is PHP, and the php installed is for 1.3. Thus, removing apache means removing php which removed phpmyadmin, and suddenly I had removed (almost) everything already installed!
When using PHP it is important to install
apache2-mpm-prefork, since this is non-threaded (like apache1.3) and is the only version safe to use with PHP. There is a big broo-ha-ha [zend.com] going on between Apache and Zend-PHP at the moment, with PHP previously saying that Apache2 was not safe with PHP, but now saying that it is OK with the prefork model. It is not that PHP is not thread-safe (?), but rather that some (many?) of the libraries that do the back-end work are not thread-safe. Trouble is, I do not know of any listing of which libraries are thread-safe and which are not. If the PHP folks would stop whinging, perhaps they could do this instead?
Doing
apt-get install apache2-common apache2-doc apache2-mpm-preforkthen introduced new Gotchas:
Apache2 Configuration under Debian GNU/Linux
============================================Debian's default Apache2 installation attempts to make adding and removing modules, virtual hosts, and extra configuration directives as flexible is possible, in order to make automating the changes and administering the server as easy as possible.
Files and Directories in /etc/apache2:
apache2.conf : This is the main configuration file.
conf.d/ : Files in this directory are included in to apache2.conf.
httpd.conf : Empty file.
magic : Magic data for mod_mime_magic Apache module
mods-available/ : This directory contains a series of .load and .conf files.
mods-enabled/ : Symlinks to the .load, .conf files in mods-available/.
ports.conf : Config directives for ports and IP addresses to listen to.
sites-available/ : config directives for different virtual hosts
sites-enabled/ : Symlinks to sites in sites-available/Tools
Currently, a2enmod and a2dismod are available for enabling and disabling modules utilizing the above configuration system.
a2ensite and a2dissite have been added, which do essentially the same thing as the above tools, but for sites rather than modules.
Is there anyone actually using the above 'in anger' on a live site?
i switched to debian from rh in january of this year.
the best thing about debian is that it is rock solid in the stable version. do not use anything else other than stable packages on a production server. testing is fine on your desktop. but when you start mixing versions of debian, you will only end up with broken dependancies and headaches.
so you ought to get used to apache 1.3 ;) (you can still use the latest versions of php and mysql by compiling from source - it is not that difficult and means each is compiled with only the things you need).
check the /etc/apt/sources.list and edit it to contain only stable sources, uninstall apache2 and anything else from testing and start again. it really pays to spend a bit of time reading about APT from the debian site docs.
good luck!
(one thing i found which really helped was i documented all the things i did, which made it very easy to go back and start again)
do not use anything else other than stable packages on a production server.
so you ought to get used to apache 1.3 ;) ... uninstall apache2 and anything else from testing and start again.
it really pays to spend a bit of time reading about APT from the debian site docs.Thanks for that. Have just now completed my first read-through. Interesting to see that APT came before RH's RPM.
... use the latest versions of php and mysql by compiling from source - it is not that difficult and means each is compiled with only the things you need
one thing i found which really helped was i documented all the things i didAlso my instinctive reaction. I'm doing this both personally and--in an attempt to help others--in this thread.
made it very easy to go back and start again(Shudders) I hope not!
After reflection, I am continuing with Apache2. Even PHP are using it now (US + UK sites) and, after a couple of years of development, it should now be stable. It has certainly been OK across the last 6 months on my production server (Centos1), and I cannot stand the thought of re-re-jigging all the .conf files for Apache1.3 + Apache-SSL + PHP.
Can you help with Gotcha4?:
/etc/apt/sources.list file and update/upgrade. Not sure about your gotcha 4: you are using bash and not sh as your default shell?
a good time ... to discover Debian Backports ... Includes Apache 2.0.54
Two problems with this:
you are using bash and not sh as your default shell?It is bash, yes. Interestingly,
joeworks fine. I looked through the config file for joe (
joercfrom memory) and it has specific entries to capture the control sequences sent by these two keys. However, I put it down as a Gotcha because it works fine on the command-line in RH, but not in Debian.
4 <Home> + <End> do not work on the command line (PuTTY with std SSH terminal)
After much man-reading the issue is within the
inputrcfile (config file for readline):
# /etc/inputrc - global inputrc for libreadline
# See readline(3readline) and `info rluserman' for more information.
...
# some defaults / modifications for the emacs mode
$if mode=emacs
# 2005-05-03 - BOL + EOL un-commented -AK
# allow the use of the Home/End keys
"\e[1~": beginning-of-line
"\e[4~": end-of-line
<moan>emacs is the default for Debian, so I really would have expected this to be the default settings.</moan>
; Note: For Red Hat Linux, packaged extension modules are now loaded via
; the ini files in the directory /etc/php.d.
--with-config-file-scan-dir=/etc/php.d' during compilation. Debian has the old-format from earlier versions of PHP.
do not use anything else other than stable packages on a production server.
;)
believe me, when i say you will only have headaches with non-stable packages. i use 100% stable apart from php, curl and mysql which i have installed from source. it is a breeze to administer and everytime a security update comes along, all i do is "apt-get update; apt-get upgrade".
i tried backports and simply got myself into problems. if you want bleeding edge software you shouldn't really be using debian.
i actually set up a mirror server at home to practice installs and reconfigs of debian - and after several failed goes using backports, i stuck with stable and have not had a problem since.
my 2c ;)
After completing the initial setup I emailed my new host to say thanks, but no-thanks to Debian, I'll stick with the existing Centos, ta.
He informs me that the `Testing' section is shortly to become the `Stable' section, but that will be too late for me.
In the end it was YUM that decided it. I simply had too many problems with apt-get; far too complicated.
Many thanks to all that have helped - it was a great assistance whilst setting up the temp server.