Pages: 1 2 3 4 5 6 7 8 9 10 11 ... 13 >>

20/12/11

Permalink 12:48:00 pm, by richard Email , 43 words   English (GB)
Categories: Apache Web Server

Prospect give out members details to an unknow person by email

Here is the letter I received this morning from My old Union, I am in the process of finding a new one. Words cannot fully encapsulate the utter stupidity of the person who sent encrypted personal data to the WRONG email address!

prospect_letter.tgz

20/07/11

HOWTO: Setup and install NUT to work with Fedora

The only reason I'm using NUT rather than apcupsd is that my ReadyNas Duo will not talk to apcupsd. apcupsd is a lot simpler to setup and install without a lot of duplication of configuration values.

sudo yum install nut nut-client nut-cgi

We need to edit a whole bunch of config files most are in /etc/ups. But first we will start with

sudo nano /etc/sysconfig/ups
MODE=netserver
SERVER=yes

Tell nut we will be a server over the network.The same message needs to also be in the nut.conf. You will see this type of annoying duplication of configuration a lot with nut ( think I already mentioned that though).

Setup which UPS's we are going to be monitoring from this machine, in our case its the one actually connected to this machine.

sudo nano /etc/ups/hosts.conf
MONITOR UPS@localhost "UPS on Mailserver"

Tell Nut we will be a netserver again.

sudo nano /etc/ups/nut.conf
MODE=netserver

Create the setting for the UPS we will be monitoring, I'm using an APC Back-UPS BR 800 connected via its USB cable. If you want this to be able to talk to a ReadyNas you MUST call it [UPS]. (ReadyNas Duo another product I have and would not recommend. Among other things it is painfully slow even with the extra RAM module.)

sudo nano /etc/ups/ups.conf
[UPS]
    driver = usbhid-ups
    port = auto
    desc = "UPS on Mailserver"
sudo nano /etc/ups/upsd.conf
LISTEN 192.168.0.11 3493

set the user that will be connecting in to get the status of the UPS. This one is local.

sudo nano /etc/ups/upsd.users
[upsuser]
    password = PASSWORD_HERE
    upsmon master
sudo nano /etc/ups/upsmon.conf
MONITOR UPS@mailserver 1 upsuser PASSWORD_HERE master
sudo chkconfig ups --list
sudo chkconfig ups on
sudo service ups restart

It is possible to check the drive is starting up cleanly, If it does not make sure you are using the correct driver for your hardware and that all the options are set correctly.

sudo upsdrvctl start

With my APC ups I see the following:

Network UPS Tools - UPS driver controller 2.6.1
Network UPS Tools - Generic HID driver 0.35 (2.6.1)
USB communication driver 0.31
Using subdriver: APC HID 0.95

Check that data is being returned correctly and providing a good status.

upsc ups@localhost ups.status
OL
  • OL - on line power
  • OB - on battery
  • LB - low battery

To check that all is running look at the verbose output from this command, which is a list of all the settings for your ups.

upsc ups@mailserver

Where ups is the [name] from ups.conf and appears to be case insensitive for this command.

I also had to hack :> /etc/init.d/halt to stop the system going down completely. This was necessary to allow the system to come back up automatically after the power is restored.

sudo nano /etc/init.d/halt
HALTARGS="-d"
[ "$INIT_HALT" != "HALT" ] && HALTARGS="$HALTARGS -p"
sleep 120
exec $command $HALTARGS

Test the whole thing is working by removing the power core from the UPS wait fort he message to say the UPS is on battery power and then run this command

sudo upsmon -c fsd

If all is well the system should close down to the system has halted output and stay powered up. The UPS will then cut power to the system. When you put the power cord back in the UPS it will pop and squeak a bit and the lights should flash. After a short delay evertything will power backup again.

Pages: 1· 2

17/07/11

HOWTO: setup a pxe server on Fedora with dnsmasq

To setup a PXEserver with dnsmasq and fedora is really simple the second time :D. This is how I do mine.

Setup dnsmasq so it is providing DNS and DHCP first. See my mini HOWTO.

decide where you are going to put the files for your PXE server. The files I mean are the copies of the install CD/DVD, the menus and configuration for the tftp server. I put mine in tftp and then in sub directories pxeboot and webroot. Create the empty directory structure now. From now on when I refer to pxeboot I mean /tftp/pxeboot and for webroot I mean /tftp/webroot. Also when I'm talking about http://localhost you can substitute the local ghost for a host name or IP address.

We will be needing a working HTTP server I use Apache as it is already used for a number of other things on my server/Nas machine. without further ado lets get on! Install apache, in fedora the package is called httpd.

sudo yum install httpd

The web server should have it's root directory pointing at /tftp/webroot. The simplest config file for this is

/etc/httpd/conf.d/pxe_webroot.conf
&lt&#59;Directory /tftp/webroot/>
</Directory>
Alias           /webroot        /tftp/webroot

sudo service httpd start

To test the basic http service use the url http://localhost you should see the Fedora Apache web page.

To test the webroot directories, lets create a simple index.html page and check it displays in a browser. Create the file /tftp/webroot/index.html with the following text. Save it so it is readable by everyone.

/tftp/webroot/index.html
<html><body><h1> Default Webroot start page</h1>
<p>This is the default web page for the webroot server.</p>
<p>The web server software is running but no content has been added, yet.</p>
</body></html>

Now reload the apache configuration

sudo service httpd reload

in your browser use the URL http://localhost/webroot/ and you should see the text from the index.html you save above. If you do not you did it wrong, please try again and follow all the steps in order.&amp;#58;&amp;#62;

One more test to check that weget is working as expected. go to your HOME directory and get the index.html file from webroot.

cd
wget
">http://localhost/webroot/index.html[/khakisample]

This should look something like this

$ wget http://localhost/webroot/index.html
--2011-07-17 09:51:35--  http://localhost/webroot/index.html
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5533 (5.4K) [text/html]
Saving to: `index.html'
100%[=====================================================>] 5,533       --.-K/s   in 0s      
2011-07-17 09:51:35 (178 MB/s) - `index.html' saved [5533/5533]

Configuration for dnsmasq for a tftp server

To change a working install of Dnsmasq to work as a PXE server we need to turn on a few settings.

Edit the file /etc/dnsmasq.conf to turn on the following options, seethe comments in the file for what they do.

/etc/dnsmasq.conf
dhcp-boot=pxelinux.0
enable-tftp
tftp-root=/tftp/pxeboot

get dnsmasq to reload the changes

sudo service dnsmasq restart

Creating the PXE server content

Download the latest Fedora installation DVD, not the live CD. This needs to be copied to webroot. I have a subdirectory structure that allows for continuous expansion and makes it easy to update from one version to another.

webroot
|-- common_files
|   |-- mailserver
|   `-- scripts
|-- f14
|   |-- i386
|   |   |-- files
|   |   |-- img
|   |   |   |-- EFI
|   |   |   |-- images
|   |   |   |-- isolinux
|   |   |   |-- Packages
|   |   |   `-- repodata
|   |   `-- ks
|   `-- x86_64
|       |-- files
|       |-- img
|       |   |-- EFI
|       |   |-- images
|       |   |-- isolinux
|       |   |-- Packages
|       |   `-- repodata
|       `-- ks
`-- f15
    `-- x86_64
        |-- files
        |-- img
        |   |-- EFI
        |   |-- images
        |   |-- isolinux
        |   |-- Packages
        |   `-- repodata
        `-- ks

Mount the Fedora install DVD and copy everything over to the img directory for the correct release (f14, f15) and architecture (i386, X86_64). See my mini howto for that.

While that is copying over we can create the PXE server stuff in pxeboot. Create a subdirectory boot and then another subdirectory under that for the release of fedora, (f14, f15). Rather then copy the PXE boot files over again make a symbolic link back to the isolinux subdirectoy from the img directory you are copying from the DVD. In my case I use:

ln -s ../../../webroot/f14/x86_64/img/isolinux x84_64

Create another subdirectory under pxeboot this time called pxelinux.cfg. This will hold your Menu configuration files.

Now get a copy of pxelinux.0 this can be found in the syslinux RPM, install it and copy it over from /usr/share/syslinux/pxelinux.0
also copy over a copy of the file vesamenu.c32 you can also get this from the isolinux directory this is common over a number of fedora release.

So assuming you are working with Fedora 15, the current version, lets create a simple menu to boot up from.

Using PXElinux it will eventually load the pxelinux.0/default. A quick and dirty one option menu would be

pxeboot/pxelinux.cfg/default
UI vesamenu.c32
LABEL f15_desktop
        MENU LABEL ^1) Install Desktop
        KERNEL boot/f15/x86_64/vmlinuz
        APPEND initrd=boot/f15/x86_64/initrd.img ks=http://192.168.0.2/webroot/f15/x86_64/ks/generic_desktop.ks ksdevice=eth0

NOTE: The last line, APPEND, must be all on one line.

Useful links

  • Text files in /usr/share/doc/syslinux-<version>
  • Specifically:
    • pxelinux.txt
    • menu.txt
  • /thekelleys.org.uk/dnsmasq/doc.html">Home page for Dnsmasq
  • Dnsmasq Man page
  • PXE Linux home

HOWTO: Setup dnsmasq on Fedora as DNS DHCP and tftp for PXE

Description

This description shamelessly take from the dnsmasq home page.

The dnsmasq DHCP server supports static address assignments and multiple networks. It automatically sends a sensible default set of DHCP options, and can be configured to send any desired set of DHCP options, including vendor-encapsulated options. It includes a secure, read-only, TFTP server to allow net/PXE boot of DHCP hosts and also supports BOOTP.


Dnsmasq supports IPv6 for DNS and TFTP, but not DHCP. Dnsmasq accepts DNS queries and either answers them from a small, local, cache or forwards them to a real, recursive, DNS server. It loads the contents of /etc/hosts so that local hostnames which do not appear in the global DNS can be resolved and also answers DNS queries for DHCP configured hosts.

Installing dnsmasq is just a case of using yum.&amp;#58;&amp;#68;

Installation
sudo yum install dnsmasq

we need to make sure that the dnsmasq service will start at boot time, here we check it and then set it.

sudo chkconfig dnsmasq --list
sudo chkconfig dnsmasq on

Looking at the file /etc/dnsmasq.conf first. The lines are listed are those that I changed from their defaults. Just uncomment and amend them as necessary. (Remove the '#' from the beginning of the line).

/etc/dnsmasq.conf

Edit /etc/dnsmasq.conf
domain-needed  
bogus-priv  
no-resolv
no-poll
server=208.67.222.222
server=208.67.220.220
local=/example.com/
address=/doubleclick.net/127.0.0.1
no-hosts
addn-hosts=/etc/dnsmasq.d/static/hosts.conf
expand-hosts  
domain=example.com  
dhcp-range=192.168.0.20,192.168.0.50,72h
dhcp-option=option:router,192.168.0.1
dhcp-option=option:ntp-server,192.168.0.5
dhcp-option=19,0              # ip-forwarding off
dhcp-option=44,192.168.0.5    # set netbios-over-TCP/IP aka WINS
dhcp-option=45,192.168.0.5    # netbios datagram distribution server
dhcp-option=46,8

What these lines will do for you.

  • domain-needed This tells dnsmasq to never pass short names to the upstream DNS servers. If the name is not in the local /etc/hosts file then "not found" will be returned.
  • bogus-priv All reverse IP (192.168.x.x) lookups that are not found in /etc/hosts will be returned as "no such domain" and not forwarded to the upstream servers.
  • no-resolv Do not read resolv.conf to find the servers where to lookup dns.
  • no-poll Do not poll resolv.conf for changes
  • server=208.67.222.222

    server=208.67.220.220
    Set one or more DNS servers to use when addresses are not local. These are open DNS servers.
  • local=/example.com/ Our local domain, queries in these domains are answered from /etc/hosts or the static-hosts files.
  • address=/doubleclick.net/127.0.0.1 Use this force an address for the specified domains. e.g to block adverts force doubleclck.net to localhost
  • no-hosts This options stops dnsmasq using the local /etc/hosts file as a source for lookups
  • .
  • addn-hosts=/etc/dnsmasq.d/static/hosts.conf Force dnsmasq to use this file for lookups. It is in the same format as /etc/hosts.
  • expand_hosts So we can see our local hosts via our home domain without having to repeatedly specify the domain in our /etc/hosts file.
  • domain This is your local domain name. It will tell the DHCP server which host to give out IP addresses for.
  • dhcp-range This is the range of IPs that DHCP will serve: 192.168.0.20 to 192.168.0.50, with a lease time of 72 hours. The lease time is how long that IP will be linked to a host. (All most&amp;#58;&amp;#45;&amp;#47; )
  • dhcp-option=option:router,192.168.0.1 When a host is requesting an IP address via DHCP also tell it the gateway to use.
  • dhcp-option=option:ntp-server,192.168.0.5 When a host is requesting an IP address via DHCP also tell it the NTP to use.

Starting and stopping the service

sudo service dnsmasq start
sudo service dnsmasq stop
sudo service dnsmasq restart

Useful links

16/07/11

Permalink 09:30:00 am, by richard Email , 198 words   English (GB)
Categories: Fedora, File systems, Installing and Configuration, Systems Administration

Installing 3ware gdm3 for a 9650SE-8LPML on Fedora

Fight with the 3ware web site, which is appalling, downloading the latest software, if you can work out which one to get.

This link works but does not go where you would expect it to http://www.lsi.com/channel/ChannelDownloads

From the link above I went to Support -> Support and downloads by product, 9650SE-8LPML, I then downloaded what seemed to be the latest from the section "complete code set". I have 10.2-complete-code-set.iso which is no longer listed &amp;#58;&amp;#45;&amp;#47;

To instyall the software which seems to be just a web interface with lotsf options that go to the same place. mount the cd

sudo mount -o loop /data/windows_drives/drivers_and_stuff/3ware_HW-Raid/10.2-Codeset-Complete.iso  /mnt
cd /mnt/packages/installers/tools/linux
sudo ./install.sh -i

Then read and follow the prompts

After the install check that the new service tdm2 is running. Which will run the 3gm software. Note the inconsistent naming!

sudo chkconfig tdm2 --list
sudo chkconfig tdm2 on

Start the service the first time with

sudo service tdm2 start

You can now see the web interface with https://localhost:888/

The first time you log in the password for both user and administrator will be 3ware This can be changed by going to 3dm2 settings and filling in the old and new passwords.

1 2 3 4 5 6 7 8 9 10 11 ... 13 >>

Here are a collection of Mini-HOWTOs some of which are too short even for that grand title. I keep them around as it is easier to remember where to look these up that to remember the content of the mini-HOWTO

Search

Contents

open source blog