Jul 222008
 

You need to know all the steps needed to configure IP addresses on a NIC card. Web site shopping cart applications frequently need an additional IP address dedicated to them. You also might need to add a secondary NIC interface to your server to handle data backups. Last but not least, you might just want to play around with the server to test your skills.

This section shows you how to do the most common server IP activities with the least amount of headaches.

Determining Your IP Address

Most modern PCs come with an Ethernet port. When Linux is installed, this device is called eth0. You can determine the IP address of this device with the ifconfig command.

[root@bigboy tmp]# ifconfig -a

eth0 Link encap:Ethernet HWaddr 00:08:C7:10:74:A8
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:11 Base address:0x1820

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:787 errors:0 dropped:0 overruns:0 frame:0
TX packets:787 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:82644 (80.7 Kb) TX bytes:82644 (80.7 Kb)

wlan0 Link encap:Ethernet HWaddr 00:06:25:09:6A:B5
inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:47379 errors:0 dropped:0 overruns:0 frame:0
TX packets:107900 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:4676853 (4.4 Mb) TX bytes:43209032 (41.2 Mb)
Interrupt:11 Memory:c887a000-c887b000

wlan0:0 Link encap:Ethernet HWaddr 00:06:25:09:6A:B5
inet addr:192.168.1.99 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:11 Memory:c887a000-c887b000

[root@bigboy tmp]#

Continue reading »

Jul 082008
 

Customizing your RPM build environment

To make RPM use your environment definitions, you need to override the default macros RPM uses. The only one that is crucial for this is %_topdir (which by default would point to /usr/src/redhat).

You can do this by adding the following to ~/.rpmmacros.

%_topdir /home/dag/redhat/

As a consequence, RPM will need the default directory structure underneath. So you can do as user:

$ mkdir -p ~/redhat/{BUILD,RPMS/{i386,i686,noarch},SOURCES,SPECS,SRPMS}

And now you’re set to go.

The obvious catch

Beware that you don’t have the same permissions as root, which means you can’t chown files to other users. So if the default Makefile uses chown or install to change ownership, this will obviously fail. As a workaround, you can’t use %makeinstall, and instead use install yourself without changing owners. Ownerships should be in the %files section.

Customize even more !

Since you now can build packages yourself, you can also customize the default packager, vendor and other information by defining more macros.

%packager Dag Wieers <dag@wieers.com>
%vendor Dag Wieers <dag@wieers.com>
%_tmppath /home/dag/tmp/
%_topdir /home/dag/redhat/
%prefix /usr/local/

There are much more macros for changing default paths, programs or even function-macros. See our links for more specific information.