dispatch-conf rather that etc-update

nano -w /etc/dispatch-conf.conf
==
merge=”vimdiff -c ‘saveas %s’ -c next -c ‘setlocal nomodifiable readonly’ -c prev %s %s”
==
=n=
Note: The left pane will hold the original config file saved as the merge output, so make changes in the left pane and save that pane. To help you remember the right hand pane (containing the new config file) will be marked unmodifiable and read-only.
=n=

emerge rcs
=n=
this tells dispatch-conf to save a history of any changes to your config files in an RCS repository
=n=

emerge world with pam shadow conflict

emerge sync
USE=”-pam” emerge -v util-linux
emerge –buildpkgonly –nodeps shadow && emerge -C pam-login && emerge –usepkgonly shadow
etc-update
=o=
Scanning Configuration files…
The following is the list of files which need updating, each
configuration file is followed by a list of possible replacement files.
1) /etc/pam.d/login
/etc/pam.d/._cfg0000_login
2) /etc/login.defs
/etc/._cfg0000_login.defs
3) /etc/securetty
/etc/._cfg0000_securetty
Please select a file to edit by entering the corresponding number.
(don’t use -3 or -5 if you’re unsure what to do)
(-1 to exit) (-3 to auto merge all remaining files)
(-5 to auto-merge AND not use ‘mv -i’):
=o=
emerge -1 shadow
USE=”mode-force symlink mysql” emerge -puavDN world
emerge –depclean
emerge gentoolkit
revdep-rebuild

Shorewall Firewall on Gentoo 2006.0

nano -w /etc/portage/package.keywords
==
net-firewall/iptables
net-firewall/shorewall
sys-kernel/genkernel
==

emerge -pv shorewall
emerge shorewall
==

NAT: Not available
Packet Mangling: Not available
Multi-port Match: Not available
Connection Tracking Match: Not available
Packet Type Match: Not available
Policy Match: Not available
Physdev Match: Not available
IP range Match: Not available
Recent Match: Not available
Owner Match: Not available
Ipset Match: Not available
CONNMARK Target: Not available
Connmark Match: Not available
Raw Table: Not available
CLASSIFY Target: Not available

==
http://gentoo-wiki.com/HOWTO_Iptables_for_newbies
http://www.gentoo.org/proj/en/infrastructure/firewall/server-firewall.xml
http://www.gentoo.org/doc/en/genkernel.xml
http://gentoo-wiki.com/HOWTO_Compile_a_Kernel_Manually
genkernel –menuconfig all
==
Device Drivers —>
Networking Support —>
Networking Options —>
<*> PF_KEY sockets
<*> IP: AH transformations
<*> IP: ESP transformations
<*> IP: IPComp transformations
<*> IP: tunnel transformations
<*> IPsec user configuration interface
Network Packet Filtering —>
IP: Netfilter Configuration —>
<*> IPsec policy match support
==
==
[*] QoS and/or fair queueing
[*] HBQ
==
=n=
You could also specify pf_key, ah?, esp?, ipcomp and xfrm_user as modules (M) but then you would have to load them at boot time by including them in /etc/modules.autoload.d/kernel-.
=n=
nano -w /etc/modules.autoload.d/kernel-2.6
or
echo “ip_tables” >> /etc/modules.autoload.d/kernel-2.6 && modules-update

# ebuild /path/to/iptables.ebuild compile
# ebuild /path/to/iptables.ebuild install
# ebuild /path/to/iptables.ebuild qmerge
shorewall show capabilities
=o=
Policy Match: Available
=o=
You can now define IPsec tunnels within Shorewall’s configuration files in /etc/shorewall/

Tomcat5 Mod_jk Apache2 on Gentoo 2006.0

Java Development Server Install

USE=”-xmms -arts -oss -jpeg -mpeg -motif -mp3 -png” emerge dev-java/sun-jdk

=
* Please download j2sdk-1_4_2_10-linux-i586.bin from:
*

http://javashoplm.sun.com/ECom/docs/Welcome.jsp?StoreId=22&PartDetailId=j2sdk-1.

4.2_10-oth-JPR&SiteId=JSC&TransactionId=noreg
* (SDK 32-bit/64-bit for Windows/Linux/Solaris SPARC 32-bit for Solaris x86,

then select download Linux Self-extracting.
* and move it to /usr/portage/distfiles
=

No JAVA_HOME available! Please set your Java Virtual Machine
No JAVA_HOME available! Please set your Java Virtual Machine
No JAVA_HOME available! Please set your Java Virtual Machine
No JAVA_HOME available! Please set your Java Virtual Machine
THIS SYSTEM VM IS NOT SUFFICIENT, REQUIRED BINARIES WERE NOT FOUND
System Virtual Machine set
You may want to update your enviroment by running:
“/usr/sbin/env-update && source /etc/profile”
>>> Regenerating /etc/ld.so.cache…

* After installing sun-jdk-1.4.2.10 this
* was set as the default JVM to run.
* When finished please run the following so your
* enviroment gets updated.
* /usr/sbin/env-update && source /etc/profile
* Or use java-config program to set your preferred VM

* Some parts of Sun’s JDK require virtual/x11 to be installed.
* Be careful which Java libraries you attempt to use.

java-config –list-available-vms
java-config –set-system-vm sun-jdk-1.4.2.10
/usr/sbin/env-update && source /etc/profile

emerge tomcat
/etc/init.d/tomcat5 start
=s=
* Starting Tomcat …
Using CATALINA_BASE: /opt/tomcat5
Using CATALINA_HOME: /opt/tomcat5
Using CATALINA_TMPDIR: /opt/tomcat5/temp
Using JAVA_HOME: /opt/sun-jdk-1.4.2.10
=s=
rc-update add tomcat5 default

emerge apache (follow gentoo wiki guide)
/etc/init.d/apache2 start
rc-update add apache2 default

nano -w /etc/portage/package.keywords
==
=www-apache/mod_jk-1.2* ~x86
==
emerge -pv mod_jk
emerge mod_jk

nano -w /etc/conf.d/apache2
==
APACHE2_OPTS=”-D JK”
==

nano -w /etc/apache2/modules.d/88_mod_jk.conf
==
JkWorkersFile conf/jk-workers.properties
JkLogFile logs/mod_jk.log
JkLogStampFormat “[%a %b %d %H:%M:%S %Y] ”
JkRequestLogFormat “%w %V %T”
jkAutoAlias /var/lib/tomcat-5/default/webapps/
jkMount /*.jsp ajp13
==

nano -w /etc/apache2/jk-workers.properties

/etc/init.d/apache2 restart && /etc/init.d/tomcat5 restart
/opt/tomcat5/webapps/ROOT/testing $ nano -w index.jsp
==
Hello! The time is now <%= new java.util.Date() %>
==
http://localhost:8080/testing/

MySQL 4.1 in Gentoo 2006.0

nano -w /etc/portage/package.use
==
dev-db/mysql innodb berkdb
==

emerge -1 mysql
=n=
his will emerge the dev-db/mysql ebuild without adding it to the world

namespace. Thus, whenever you type ’emerge –update world’ mysql will not be

updated. This is extremely useful since portage doesn’t support straight,

unattended updates for mysql. Since you will have to manually update mysql

anyway, you may wish to remove it from world so that your auto-update script(s)

don’t fail.
=n=

emerge –config =dev-db/mysql-4.1.20
or
ebuild /var/db/pkg/dev-db/mysql-4.1.20/mysql-4.1.20.ebuild
/etc/init.d/mysql start
mysql_setpermission
mysql> SET PASSWORD FOR ‘root’@’localhost’=PASSWORD(‘password_here’);
mysql_secure_installation
rc-update add mysql default

PHP4 PHP5 CGI with suPHP

/etc/portage/package.use
==
=dev-lang/php-4* cgi force-cgi-redirect
=dev-lang/php-5* cgi force-cgi-redirect
==

USE=”force-cgi-redirect” emerge ‘=dev-lang/php-4*’ ‘=dev-lang/php-5*’

/etc/conf.d/apache2
==
APACHE2_OPTS=”-D SUPHP”
==

echo “>=www-apache/mod_suphp-0.6* ~x86″ >> /etc/portage/package.keywords

USE=”mode-force” emerge mod_suphp

/etc/suphp.conf
==
[handlers]
;Handler for php-scripts
x-httpd-php=php:/usr/lib/php5/bin/php-cgi
x-httpd-php5=php:/usr/lib/php5/bin/php-cgi
x-httpd-php4=php:/usr/lib/php4/bin/php-cgi
x-httpd-phtml=php:/usr/lib/php5/bin/php-cgi
==

Gentoo 2006.0 Install on Compaq Deskpro EN

Gentoo 2006.0 Install on Compaq Deskpro EN

Linux: Gentoo 2006.0
Compaq Despro EN Slim Form Factor

CPU0: Intel Pentium III (Coppermine) stepping 0a 1GHz
512 MB DDR Memory
hda: WDC WD200BB-60DGA0, ATA DISK drive
hdc: LITE-ON CD-ROM LTN-4891S, ATAPI CD/DVD-ROM drive

localhost home # lspci

00:00.0 Host bridge: Intel Corporation 82815 815 Chipset Host Bridge and Memory Controller Hub (rev 04)
00:02.0 VGA compatible controller: Intel Corporation 82815 CGC [Chipset Graphics Controller] (rev 04)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 02)
00:1f.0 ISA bridge: Intel Corporation 82801BA ISA Bridge (LPC) (rev 02)
00:1f.1 IDE interface: Intel Corporation 82801BA IDE U100 (rev 02)
00:1f.4 USB Controller: Intel Corporation 82801BA/BAM USB (Hub #2) (rev 02)
00:1f.5 Multimedia audio controller: Intel Corporation 82801BA/BAM AC'97 Audio (rev 02)
02:08.0 Ethernet controller: Intel Corporation 82801BA/BAM/CA/CAM Ethernet Controller (rev 01)

The Install

Legend:
= action
== content

Boot using the minimal install CD “Gentoo 2006.0 Minimal CD/InstallCD”

On Boot:

gentoo acpi=off agpgart nosata nosmp doapm nofirewire scandelay
net-setup eth0
passwd

SSH client: (logged as root)

useradd -m -G users xorprime
passwd xorprime
hdparm -d 1 -A 1 -m 16 -u 1 -a 64 /dev/hda
==
/dev/hda1 /boot 512
/dev/hda2 swap
/dev/hda3 /
/dev/hda4 /home
==
mke2fs /dev/hda1
mke2fs -j /dev/hda3
mkswap /dev/hda2
swapon /dev/hda2
mkreiserfs /dev/hda4
mount /dev/hda3 /mnt/gentoo
mkdir /mnt/gentoo/boot
mount /dev/hda1 /mnt/gentoo/boot
cd /mnt/gentoo
links http://www.gentoo.org/main/en/mirrors.xml
=
download stage3 and portage snapshots
=
tar xvjpf stage3-*.tar.bz2
cd /mnt/gentoo
tar xvjf /mnt/gentoo/portage-.tar.bz2 -C /mnt/gentoo/usr
nano -w /mnt/gentoo/etc/make.conf
==
CHOST=”i686-pc-linux-gnu”
CFLAGS=”-march=pentium3 -O2 -pipe -fomit-frame-pointer”
CXXFLAGS=”${CFLAGS}”
==
MAKEOPTS=”-j2″
mirrorselect -i -o >> /mnt/gentoo/etc/make.conf
mirrorselect -i -r -o >> /mnt/gentoo/etc/make.conf
cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf
mount -t proc none /mnt/gentoo/proc
mount -o bind /dev /mnt/gentoo/dev
chroot /mnt/gentoo /bin/bash
env-update
source /etc/profile
export PS1=”(chroot) $PS1″
emerge –sync

ls -FGg /etc/make.profile
less /usr/portage/profiles/use.desc
mkdir -p /etc/portage
echo “sys-libs/glibc userlocales” >> /etc/portage/package.use
nano -w /etc/locales.build

USE=”-doc symlink” emerge gentoo-sources
ls -l /usr/src/linux

emerge genkernel
zcat /proc/config.gz > /usr/share/genkernel/x86/kernel-config-2.6
genkernel –menuconfig all
ls /boot/kernel* /boot/initramfs*

emerge coldplug
rc-update add coldplug boot

find /lib/modules// -type f -iname ‘*.o’ -or -iname ‘*.ko’
nano -w /etc/modules.autoload.d/kernel-2.6

nano -w /etc/conf.d/net
==
config_eth0=( “192.168.1.50 netmask 255.255.255.0 brd 192.168.1.255” )
routes_eth0=( “default gw 192.168.1.1” )
==
rc-update add net.eth0 default
passwd
echo “tts/0” >> /etc/securetty
nano -w /etc/rc.conf
nano -w /etc/conf.d/keymaps
nano -w /etc/conf.d/clock
emerge syslog-ng
rc-update add syslog-ng default
emerge vixie-cron
rc-update add vixie-cron default
emerge reiserfsprogs

emerge lilo
nano -w /etc/lilo.conf
==
boot=/dev/hda # Install LILO in the MBR
prompt # Give the user the chance to select another section
timeout=50 # Wait 5 (five) seconds before booting the default section
default=gentoo # When the timeout has passed, boot the “gentoo” section

# For genkernel users
image=/boot/kernel-genkernel-x86-2.6.16-gentoo-r9
label=gentoo
read-only
root=/dev/ram0
append=”init=/linuxrc ramdisk=8192 real_root=/dev/hda3 udev”
initrd=/boot/initramfs-genkernel-x86-2.6.16-gentoo-r9
==
/sbin/lilo
cd
umount /mnt/gentoo/boot /mnt/gentoo/dev /mnt/gentoo/proc /mnt/gentoo
reboot
useradd -m -G users,wheel,audio -s /bin/bash xorprime
passwd xorprime

==
# ls /usr/share/zoneinfo
(Suppose you want to use GMT)
# cp /usr/share/zoneinfo/GMT /etc/localtime
date 081914582006

nano -w /etc/fstab

==
emerge ati-drivers xorg-x11 -pv
USE=”symlink” emerge -puavDN world
(Remerge libtool to avoid further potential problems)
mybox etc # emerge libtool

(Update config files, make sure you do not let etc-update
update config files you have edited)
mybox etc # etc-update

(If perl has been updated, you should run the perl-cleaner script)
mybox etc # time perl-cleaner all
real 1m6.495s
user 0m42.699s
sys 0m10.641s

(In case of a major upgrade of python, you should run the python-updater script)
mybox etc # python-updater