Ph: 19216812

Archive

Posts Tagged ‘server’

Fedora bloat begone!

April 17th, 2009

I just spent the last 45 minutes trimming the fat from a default fedora install! Forty-five minutes!!! Well I think it’s a default installation… I didn’t install the image, but one thing is for sure — this image is full of desktop crap.

Apr 17 10:42:55 Erased: rss-glx
Apr 17 10:42:57 Erased: rss-glx-gnome-screensaver
Apr 17 10:43:03 Erased: lohit-fonts-oriya
Apr 17 10:43:06 Erased: lohit-fonts-telugu
Apr 17 10:43:08 Erased: lohit-fonts-gujarati
Apr 17 10:43:11 Erased: lohit-fonts-kannada
Apr 17 10:43:13 Erased: lohit-fonts-punjabi
Apr 17 10:43:15 Erased: lohit-fonts-tamil
Apr 17 10:43:18 Erased: lohit-fonts-bengali
Apr 17 10:43:20 Erased: lohit-fonts-hindi
Apr 17 10:44:07 Erased: neverball
Apr 17 10:44:26 Erased: reiserfs-utils
Apr 17 10:44:55 Erased: pirut
Apr 17 10:45:02 Erased: pykickstart
Apr 17 10:46:14 Erased: hpijs
Apr 17 10:46:14 Erased: sane-backends
Apr 17 10:46:16 Erased: lm_sensors
Apr 17 10:46:18 Erased: hplip
Apr 17 10:46:20 Erased: net-snmp-libs
Apr 17 10:46:21 Erased: gkrellm
Apr 17 10:46:23 Erased: sane-backends-libs
Apr 17 10:46:24 Erased: libsane-hpaio
Apr 17 10:46:48 Erased: bzflag
Apr 17 10:46:57 Erased: rhgb
Apr 17 10:47:23 Erased: nvidia-driver-installer
Apr 17 10:48:26 Erased: compiz
Apr 17 10:49:05 Erased: compiz-gnome
Apr 17 10:49:07 Erased: comps-extras
Apr 17 10:49:42 Erased: vino
Apr 17 10:49:47 Erased: nspluginwrapper
Apr 17 10:50:06 Erased: pulseaudio-esound-compat
Apr 17 10:50:34 Erased: libflashsupport
Apr 17 10:50:49 Erased: alsamixergui
Apr 17 10:51:04 Erased: libbtctl
Apr 17 10:51:04 Erased: gnome-bluetooth-libs
Apr 17 10:51:05 Erased: gnokii
Apr 17 10:51:06 Erased: gnome-vfs2-obexftp
Apr 17 10:51:06 Erased: bluez-utils-cups
Apr 17 10:51:09 Erased: bluez-gnome
Apr 17 10:51:15 Erased: gnome-phone-manager
Apr 17 10:51:17 Erased: bluez-libs
Apr 17 10:52:03 Erased: emacs-common
Apr 17 10:52:04 Erased: emacs-nox
Apr 17 10:52:26 Erased: f-spot
Apr 17 10:52:49 Erased: fedora-screensaver-theme
Apr 17 10:52:50 Erased: fedorainfinity-screensaver-theme
Apr 17 10:52:53 Erased: gnome-screensaver
Apr 17 10:53:33 Erased: gnome-session
Apr 17 10:53:38 Erased: gnome-media
Apr 17 10:53:43 Erased: nautilus-cd-burner
Apr 17 10:53:51 Erased: gnome-volume-manager
Apr 17 10:54:07 Erased: gnome-applets
Apr 17 10:54:10 Erased: pgadmin3
Apr 17 10:54:16 Erased: control-center
Apr 17 10:54:19 Erased: gstreamer-tools
Apr 17 10:54:22 Erased: gstreamer-plugins-good
Apr 17 10:54:27 Erased: gstreamer
Apr 17 10:54:28 Erased: wxGTK
Apr 17 10:54:32 Erased: gnome-power-manager
Apr 17 10:54:35 Erased: gstreamer-plugins-base
Apr 17 10:55:19 Erased: eog
Apr 17 10:56:11 Erased: tetex
Apr 17 10:56:15 Erased: tetex-latex
Apr 17 10:56:17 Erased: sazanami-fonts-gothic
Apr 17 10:56:19 Erased: jomolhari-fonts
Apr 17 10:56:21 Erased: paktype-fonts
Apr 17 10:56:25 Erased: tetex-fonts
Apr 17 10:56:26 Erased: baekmuk-ttf-fonts-gulim
Apr 17 10:56:28 Erased: baekmuk-ttf-fonts-common
Apr 17 10:56:29 Erased: tetex-dvips
Apr 17 10:56:30 Erased: texinfo-tex
Apr 17 10:56:30 Erased: a2ps
Apr 17 10:57:14 Erased: cjkunifonts-uming
Apr 17 10:57:16 Erased: kacst-fonts
Apr 17 10:57:49 Erased: galculator
Apr 17 10:58:05 Erased: opengl-games-utils
Apr 17 10:58:38 Erased: pulseaudio-module-x11
Apr 17 10:58:39 Erased: pulseaudio
Apr 17 10:58:40 Erased: pulseaudio-module-gconf
Apr 17 10:59:37 Erased: gnome-doc-utils
Apr 17 10:59:38 Erased: gnome-desktop-devel
Apr 17 10:59:49 Erased: yelp
Apr 17 10:59:51 Erased: gnome-doc-utils-stylesheets
Apr 17 11:00:49 Erased: gimp
Apr 17 11:00:50 Erased: gimp-libs
Apr 17 11:00:51 Erased: gnome-backgrounds
Apr 17 11:00:52 Erased: doxygen
Apr 17 11:00:56 Erased: gimp-help
Apr 17 11:01:02 Erased: gimp-help
Apr 17 11:01:32 Erased: bug-buddy
Apr 17 11:01:41 Erased: gnome-pilot
Apr 17 11:01:43 Erased: gnome-pilot-devel
Apr 17 11:02:25 Erased: gphoto2
Apr 17 11:02:29 Erased: gthumb
Apr 17 11:02:31 Erased: gnome-audio
Apr 17 11:03:01 Erased: httpd-tools
Apr 17 11:03:01 Erased: httpd
Apr 17 11:03:05 Erased: gnome-user-share
Apr 17 11:03:12 Erased: gutenprint
Apr 17 11:03:13 Erased: gutenprint-foomatic
Apr 17 11:04:17 Erased: gparted
Apr 17 11:04:18 Erased: openvpn
Apr 17 11:04:19 Erased: NetworkManager-openvpn
Apr 17 11:04:20 Erased: parted
Apr 17 11:04:21 Erased: nash
Apr 17 11:04:22 Erased: mkinitrd
Apr 17 11:07:59 Erased: gnome-sharp
Apr 17 11:08:37 Erased: gtweakui
Apr 17 11:09:05 Erased: libXScrnSaver
Apr 17 11:09:06 Erased: libXScrnSaver-devel
Apr 17 11:10:30 Erased: libgnomeprintui22
Apr 17 11:10:34 Erased: gnome-utils
Apr 17 11:10:39 Erased: libgnomeprintui22-devel
Apr 17 11:10:43 Erased: gedit
Apr 17 11:10:47 Erased: libgnomeprint22-devel
Apr 17 11:10:48 Erased: libgnomeprint22
Apr 17 11:11:00 Erased: libtheora
Apr 17 11:11:00 Erased: libvorbis-devel
Apr 17 11:11:01 Erased: libogg
Apr 17 11:11:02 Erased: libogg-devel
Apr 17 11:11:03 Erased: libvorbis
Apr 17 11:13:09 Erased: gpm-devel
Apr 17 11:13:28 Erased: pilot-link-devel
Apr 17 11:13:28 Erased: pilot-link
Apr 17 11:13:51 Erased: pcmciautils
Apr 17 11:14:26 Erased: vnc-server
Apr 17 11:14:32 Erased: vnc-libs
Apr 17 11:14:32 Erased: vnc
Apr 17 11:25:01 Erased: openobex
Apr 17 11:25:21 Erased: vsftpd
Apr 17 11:25:42 Erased: srecord
Apr 17 11:25:59 Erased: xorg-x11-drivers
Apr 17 11:26:00 Erased: synaptics
Apr 17 11:26:18 Erased: samba
Apr 17 11:26:24 Erased: samba-common
Apr 17 11:26:25 Erased: samba-client
Apr 17 11:27:05 Erased: redhat-lsb
Apr 17 11:27:07 Erased: cups
Apr 17 11:27:12 Erased: paps
Apr 17 11:27:12 Erased: libgnomecups
Apr 17 11:27:18 Erased: ntfs-3g
Apr 17 11:27:18 Erased: ntfsprogs
Apr 17 11:28:21 Erased: file-roller
Apr 17 11:28:30 Erased: policycoreutils-gui
Apr 17 11:29:54 Erased: alsa-utils
Apr 17 11:30:09 Erased: gnome-panel-devel
Apr 17 11:30:10 Erased: gnome-libs-devel
Apr 17 11:30:11 Erased: alsa-lib-devel
Apr 17 11:30:12 Erased: libgnomeuimm26-devel
Apr 17 11:30:13 Erased: libgnome-devel
Apr 17 11:30:14 Erased: libgnomemm26-devel
Apr 17 11:30:14 Erased: libbonoboui-devel
Apr 17 11:30:15 Erased: esound-devel
Apr 17 11:30:15 Erased: libgnomeui-devel
Apr 17 11:30:17 Erased: SDL-devel
Apr 17 11:30:27 Erased: curl-devel
Apr 17 11:30:44 Erased: iwl4965-firmware
Apr 17 11:31:00 Erased: paps-libs

Ok, it’s not all junk, but I didn’t need any of this stuff for this server.

Can anyone think of any other audio related packages I can get rid of? I don’t need audio, cd burning, flashy 3d graphics, printing, image or video playback/record capabilities on this machine at all.

Uncategorized bloat, desktop, fedora, junk, server, uninstall, yum

VNC server on a headless build machine to avoid warnings

April 9th, 2009

I have a build machine that runs a build script every day, but it runs on a headless server. That’s not really a problem except that I get a lot of GTK warnings because there’s no display. To get around having these useless warnings in my build log, I start a vnc server so i’ll have a display available on this machine.

Start a VNC server and grab the display number.

# su headless -c "vncserver &> $TEMP" \
VNC_DISP=`grep -o "desktop is.*" $TEMP" | awk '{print $3}'`

The VNC_DISP variable captures the hostname and display number so it knows which one to kill after you’re done.

New 'headless.host.com:1 (root)' desktop is headless.host.com:1

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/headless.host.com:1.log

Start your build script or do whatever it is you needed a display for on this headless server.

# su headless -c "export DISPLAY=$VNC_DISP && ~/build.sh

Kill the VNC server since it’s no longer needed.

# su headless -c "vncserver -kill $VNC_DISP &> /dev/null"

Voila, no more warnings on the build server! I call this in a script that runs daily as a cron. So at four in the morning, or whenever my cron script gets called, the system has a display available, does it’s business, and kills the display to clean up after itself.

programming build, display, headless, hostname, server, vnc, x

Apache on a diet: Tune for optimal memory usage and speed

January 1st, 2009

Lets get a running start… Make sure KeepAlive is set to ‘On’, HostnameLookups is ‘Off’ and comment out most of the modules loaded in your default Fedora, Ubuntu, Suse, other bloated distribution’s choice for default modules. Most of them you won’t need or want to have available. You’ll probably need rewrite and php, but depending on what kind of site you’re running, you might not need all those auth modules, etc.  If you’re hosting some apps that handle their own authentication and permissions and you dont want to allow directory browsing, statistics generation, ldap authentication, or apache statistics then by all means get rid of all those modules! In Fedora you’ll find they throw in the kitchen sink to start you off.

[image]http://blog.rootninja.com/wp-content/uploads/2009/01/treadmill.jpg” alt=”apache on a diet - running on a treadmill” class=”alignleft” />

Putting your apache on a diet and then restarting might be all the oomph you need, but you’ll probably see only a slight difference. Also, don’t just look at the memory usage right after a restart. Until your servers are actually called upon for battle, they’re just going to allocate the minimum requirements, so you might have a bunch of httpd’s running using say 10 meg each, but once they’re stressed, you might see them jump to to 20-30 meg and not let go. You’re probably going to get the most mileage out of tuning the number of servers running, maximum clients, minimum and maximum spare’s, etc. If you’re not expecting a lot of traffic and your memory is limited, you probably shouldn’t run a boat load of servers. Keep your MaxClients low so you don’t spawn so many that you start swapping right from the word go.

Your site, your traffic, and the type of content being loaded is going to affect your optimal settings. So just dive in and play around with the numbers.  Stress test your site and let it run a little while. If it gets better, then you’re probably pushing the numbers in the right direction! I’m sorry if you were looking for a “type 123 at prompt xyz” type of tutorial here. What’s working for me with 128 meg of memory is probably a little slim for the next guy.

I just hate to see people jump ship from apache to something like lighty just because they hear apache is bloated or experience that from their distribution’s default setup. Switching to another web server may just give yourself more headaches in the long run because you’re probably going to have to tweak lighty to work with the apps you’d like to run — apps that are already set up to work with apache right out of the box.

Linux apache, bloat, diet, lighttpd, lighty, memory, modules, requirements, server, tune, web

Setup your own YUM repository, the easy way!

September 25th, 2008

I don’t understand why some people think this is a complicated thing to set up, so here goes my approach which I think is the easiest method.  Perhaps you’re behind a very restrictive corporate firewall or you want to conserve bandwidth when you’re setting up several machines.  You can set up your own repositories on one machine in your network and have it download the packages and updates in the off-hours.  Whenever a client machine on your network wants updates, they’ll get them much faster and you’ll save bandwidth too.

Step-by-step:

Install createrepo on the machine you want to be your update server.

[user@hostname ~]$ sudo yum install createrepo

Now you’ll create a few crons to create and maintain your mirror.  Let’s start with the one that does the grunt work of downloading the packages.  I’ll go ahead and set a bandwidth limit and log my mirroring.  I don’t care about debug stuff so i’ll exclude that and any iso’s that may get dumped in there too.

#!/bin/sh
# GET THE LATEST PACKAGES
/usr/bin/rsync -aq –bwlimit=500 –stats –log-file=/var/log/rsync/i386.rsync.1.log rsync://your-favorite-linux-mirror/linux/updates/9/i386.newkey/ –exclude=debug/ –exclude=*.iso /opt/yum/updates/8/i386/
/usr/bin/rsync -aq –bwlimit=500 –stats –log-file=/var/log/rsync/x86_64.rsync.1.log rsync://your-favorite-linux-mirror/linux/updates/9/x86_64.newkey/ –exclude=debug/ –exclude=*.iso /opt/yum/updates/8/x86_64/

Create a cron to update your repo as new rpms get mirrored.

#!/bin/sh
# CREATE/MAINTAIN MY LOCAL REPOSITORY
/usr/bin/createrepo –update /opt/yum/base/8/i386
/usr/bin/createrepo –update /opt/yum/base/8/x86_64

Create another cron to rotate your logs, saving the last week’s worth.

#!/bin/sh
# ROTATE THE LOGS
rm -f /var/log/rsync/yum-rsync-log7.tar.gz
mv -f /var/log/rsync/yum-rsync-log6.tar.gz /var/log/rsync/yum-rsync-log7.tar.gz
mv -f /var/log/rsync/yum-rsync-log5.tar.gz /var/log/rsync/yum-rsync-log6.tar.gz
mv -f /var/log/rsync/yum-rsync-log4.tar.gz /var/log/rsync/yum-rsync-log5.tar.gz
mv -f /var/log/rsync/yum-rsync-log3.tar.gz /var/log/rsync/yum-rsync-log4.tar.gz
mv -f /var/log/rsync/yum-rsync-log2.tar.gz /var/log/rsync/yum-rsync-log3.tar.gz
mv -f /var/log/rsync/yum-rsync-log1.tar.gz /var/log/rsync/yum-rsync-log2.tar.gz
mv -f /var/log/rsync/yum-rsync-log.tar.gz /var/log/rsync/yum-rsync-log1.tar.gz
tar -czf /tmp/yum-rsync-log.tar.gz /var/log/rsync/*.log
rm -rf /var/log/rsync/*.log
mv -f /tmp/yum-rsync-log.tar.gz /var/log/rsync/

On your client machines, move or delete the existing repo definitions and create a new one that points to your local repositories.  Assuming your server machine’s IP address is 192.168.1.2 and you’re using Fedora your new repo definitions would look something like this:

[fairfield-base]
name=My_Local_Repo - base - Fedora $releasever - $basearch
failovermethod=priority
baseurl=http://192.168.1.2/yum/base/$releasever/$basearch
enabled=1
gpgcheck=1

[fairfield-updates]
name=My_Local_Repo - updates - Fedora $releasever - $basearch
failovermethod=priority
baseurl=http://192.168.1.2/yum/updates/$releasever/$basearch
enabled=1
gpgcheck=1

Wait until your cron fills your repositories or download a few packages and run your createrepo.  From now on your updates will execute much faster.  And if you want to build new machines, you can point your kickstart to get packages from your local mirror instead of just your cdrom so you can build machines that are fully up to date right out of the box.  Try updating on your clients.  You should notice it takes ten times longer to install the updates than it does to download them.

[user@hostname ~]$ sudo yum update

http://blog.rootninja.com/wp-content/uploads/2008/09/rootninja_80×151.jpg“>[image]http://blog.rootninja.com/wp-content/uploads/2008/09/rootninja_80×151.jpg” alt=”root|ninja” width=”80″ height=”15″ />

Linux Linux, packages, repo, rpm, rsync, server, updates, yum


You are viewing a mobilized version of this site...
View original page here

Mobilized by Mowser Mowser
Mobilytics