Posts Tagged ‘gentoo’

Εγκατάσταση Ubuntu Intredip με dnsmasq και PXE

Posted in HowTo, Internet & technology on October 31st, 2008 by atma – Be the first to comment

Έχω έναν φορητό υπολογιστή Fujitsu Siemens (AMILO). Τα specs δεν τα γνωρίζω καλά καλά, αλλά υπολογίζω 1.5 Ghz / 512 MB Ram / 40 GB HD. Το CDRom είναι χαλασμένο. Θέλει καρφίτσα, τσιμπιδάκι για να σφηνώσει έτσι ώστε να μην αναπηδά το CD. Το συγκεκριμένο laptop έχει δυνατότητα PXE boot. Συγκεκριμένα το PXE-2 της intel.

Οπότε αποφάσισα να χρησιμοποιήσω το Dnsmasq έτσι ώστε να κάνει boot σε Ubuntu το μηχάνημα μέσω δικτύου. Το πρώτο που πρέπει να κάνω είναι το setup του server.

Κάνω edit το dnsmasq.conf. Η διανομή του server είναι Gentoo GNU/Linux. Οι ρυθμίσεις στην ουσία είναι για Gentoo αλλά με ευκολία μπορούν να λειτουργήσουν σε όλες τις διανομές Linux.

# mkdir /mnt/tftp ; cd /mnt/tftp

# screen lftp -c “open http://archive.ubuntu.com/ubuntu/dists/hardy/main/installer-i386/current/images/netboot/; mirror”

#ln -s /mnt/tftp/pxelinux.cfg/default /mnt/tftp/pxelinux.cfg/000AE42EA642

# cat /etc/dnsmasq.conf
dhcp-boot=pxelinux.0,gentoo-server,192.168.3.45 #boot image, server και ip του server
enable-tftp # Λέμε στο dnsmasq να κάνει start τον tftp demon. Αλλιώς θέλουμε κάτι σαν το tftp-hpa.
tftp-root=/mnt/tftp #Θέτουμε το root directory του TFTP server

Αφού κάνουμε start το dnsmasq, χρησιμοποιούμε το netstat ή το lsof για να δούμε αν οι υπηρεσίες που μας ενδιαφέρουν λειτουργούν κανονικά:

egasus tftp # lsof -i|grep -i dns

# lsof -i|grep -i dns
dnsmasq 23683 nobody 5u IPv4 137982 UDP *:bootps

dnsmasq 23683 nobody 6u IPv4 137987 UDP *:domain
dnsmasq 23683 nobody 7u IPv4 137988 TCP *:domain (LISTEN)
dnsmasq 23683 nobody 8u IPv6 137989 UDP *:domain
dnsmasq 23683 nobody 9u IPv6 137990 TCP *:domain (LISTEN)
dnsmasq 23683 nobody 10u IPv4 137991 UDP *:tftp

ή

# netstat -lu|grep tftp
udp 0 0 *:tftp *:*

Στο παραπάνω παράδειγμα κάνω χρήση της εντολής “ln”. Το αρχείο default κάνει link στην MAC Address του client που θέλουμε να κάνει boot. Πως την βρίσκουμε; Κάνοντας ένα ping στο target και χρησιμοποιώντας την εντολή “arp -a” σαν root!
Προσοχή, στο ln -s, το mac address που βάζουμε ως link είναι χωρίς τα “:”. Κάπως έτσι:

pegasus ~ # ping -c 1 192.168.0.1
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
64 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=0.451 ms

— 192.168.0.1 ping statistics —
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.451/0.451/0.451/0.000 ms
pegasus ~ # arp -a
router (192.168.0.1) at 00:1d:7e:b4:78:da [ether] on eth0
pegasus ~ # ln -s /mnt/tftp/pxelinux.cfg/default /mnt/tftp/pxelinux.cfg/001d7eb478da

Έπειτα ανοίγουμε τον υπολογιστή που θέλουμε να εγκαταστήσουμε το σύστημα και κάνουμε boot κι απλά ακολουθούμε τις οδηγίες στην οθόνη!

EDIT: Εάν για κάποιο λόγο κολλάει η εγκατάσταση στο “Release” και δεν σας βγάζει πληροφορίες για τα πακέτα που κατεβάζει, αλλάξτε το mirror! Το Ελληνικό δεν είναι ενημερωμένο συνήθως, καλύτερα δοκιμάστε το Ιταλικό “it.archives.ubuntu.com”.

Going back to the roots: Gentoo

Posted in Internet & technology on April 30th, 2008 by atma – Be the first to comment

Yesterday I had to plug once again my home server. This server runs a few services and acts as a DNS for the local network. I have a machine like this up 24/7 to serve specific purposes. I haven’t find any router that can replace it. Of course, I didn’t try high range routers, like CISCO. Anyway, this machine used to run OpenBSD.

My experience after almost a year of OpenBSD (simple) administrating is somewhat bad. The home server used to run, DNSmasq, MySQL, Lighttpd with PHP5 and a modified version of lighttpd in order to run Ruby on Rails. It was an OpenVPN server, along with sshd and OpenNTPD. Also there was a Nessus server running on the same machine and FTP just for the local network.

The server is a Pentium 4 with 256 MB RAM. It can handle the above easily no matter what OS you install. However, the OpenBSD proved to be a bit too much frustrating for me. Although my experience allows me to do everything manually, download, install and configure programs manually, due to my experience with Gentoo, I was trying to find in every situation the right way to do things. The drawback is that you have to read a bit more usually, but in return you will be just fine when upgrading (hopefully!).

The problems with OpenBSD start exactly there. The manual clearly states that people should use the precompiled packages before using the Ports. First thing, using precompiled packages saves huge amounts of time compared to Gentoo’s philosophy of compiling everything. But! There’s always a “but”. They seriously lack of flexibility and that was a known issue. I was fine with that, after all I didn’t want a bleeding edge machine. I just needed a server to serve a few services to the local network, nothing more. The installation of the combo: lighttpd+mysql+php proved to be much more complicated than I ever imagined! First problem was that the precompiled binaries didn’t match in versions. I had to find manually my packages from various mirrors. You see I didn’t find a way to tell pkg_add to switch between mirrors automagically. Then, I found out that the precompiled versions of PHP and lighttpd were unfit. The fastcgi option is kinda rare. So I had to install them using ports. No problem, I thought. After a few tries and much reading, I managed to install the combo. The frustration continued with ruby on rails. Ruby on rails is not easy to install anywhere. I had a few issues on MacOSX as well but I managed to install them correctly in both systems using lighttpd and mysql correctly. Then I wanted to install DNSmasq. After the configuration and a few days of frustrating troubleshooting a guy told me that there was bug in the OpenBSD kernel that stops dnsmasq from working properly: DNSmasq was not able to assign ip’s because it couldn’t send announcements packets! I still didn’t thank this guy enough! I was going crazy, I never had issues before with dnsmasq!

Apart from the OpenBSD installation troubles: every single install, from irssi to complex PHP applications was an issue. The most frustrating for me was the version upgrade process. I don’t know why they need to upgrade the base system in that manner. I tried both cvsup -for advanced users and heavily discouraged by the handbook- and CD upgrade. Both methods gave me issues. The strange thing is that I was really going by the handbook! The folks on #openbsd@Freenode helped a lot. But still I didn’t understand this lack of flexibility and ease of package management and upgrade process. In the end everything became so frustrating that I really had no will to install anything more than the absolutely necessary.

After almost 3 years of absence from my computers, Linux came finally in (again). Gentoo was the obvious choice. I know very well the community and the mindset around Gentoo, so I feel very comfortable with it. Although it may seem an obsolete choice for a computer server, but for me is the best! The upgrade process is simple yet powerful, emerge is the perfect tool for package management and the troubleshooting is easy. While it was hard for me to find help with OpenBSD’s issues, the gentoo community is one of the most active communities I’ve ever seen. Plus the fact that… everything works! I just typed:

# env USE=\"cgi php mysql fastcgi\" emerge lighttpd

and everything worked like a charm!

Going back to linux?

Posted in Internet & technology on April 13th, 2008 by atma – Be the first to comment

Recently I’m feeling the desperate need for a Desktop computer. Due to “much spending” and other needs, I am seriously thinking to buy an iMac on September. However until then I need a widescreen desktop. I didn’t buy anything near to core duo. The last two computers I got, were 2 Pentium 4 powered machines. The first one is acting as a home firewall/gateway server and the second one will act as a home server for torrents and other needs mostly. On the other hand there’s a Dreambox decoder running here, that could be easily turned into a small Linux server for torrents and other staff. I have to decide the topology these days.

If I get the mac, it will be an iMac 2.8 Ghz Core Duo with a 24” screen and at least 2G of RAM. However, as mentioned above, this scenario seems a little rough right now. So I’m seriously thinking to go back to GNU/Linux. I haven’t used Linux as my main desktop for almost three years. I’m really satisfied with OSX, it suits my needs perfectly. However a desktop computer is badly needed here so… I’m thinking of a core duo machine with at least 1.5 G of Ram and plenty of HD available. The graphics shouldn’t be nothing extravagant, I don’t need them. I do some basic video and photo editing but that’s all.

The first problem in a similar cases is how you transfer you data from one computer to the other. Now, all the mp3′s and photo libs are handled by my laptop on the WD MyBook’s UFS partition. I like the way iPhoto and iTunes handle the library, although iTunes tend to be a bit bloated & slow, it works good enough and it’s in line with my iPod. Linux will give a hard time with the ipod and… Windows is not an option.

Another issue is the distribution of choice. I am among Gentoo and Ubuntu. I have a computer on the basement running WindowsXP & Ubuntu Gutsy. I’m surprised by the ease of use and way that the Ubuntu team put everything together. Apparently everything works as it should. I didn’t had issues with broken programs etc. But as said before, it’s not a day-to-day computer for me so I can’t be sure. On the other hand, I like Gentoo. I love it. It would be a one-way choice for me, but the problem is time. Gentoo takes time to configure and I’m not quite sure I want to spent too much time on configuration. I’m much more interested in quality time, you know? Doing things with a computer not just troubleshooting in order to make it work.

Next week, I’m leaving the army (FINALLY!) for good and I have to make a choice and stick with it…


Convalesco is using WP-Gravatar