Answers 64

From LXF Wiki

Answers 64

<title>ISPs open to Linux</title> <question>Have you a list of ISPs that can be accessed from Linux PCs? AOL and BT do not appear to be of any use for a PC running the Linux operating system. No doubt the answer is staring me in the face but I'd be grateful for you to point that out...</question>

<answer>Almost all ISPs that provide PPP-based dial-up will work with Linux, which is just about every one, except for AOL. As AOL uses a non-standard protocol for the connection, you will be unable to get AOL to work; however, BT's service should work without any problems from Linux. BT offers several dial-up options, including BTInternet and BTConnect. They all work using PPP and CHAP for authentication, and will work happily through Linux. Many ISPs are supporting Linux now as a platform, or at least acknowledge that their service will work with Linux. Some ISPs, such as Demon Internet and UKLinux.net, actively support Linux and will provide information for configuration of their service with Linux. </answer>

<title>Rar rage</title>

<question>I've installed and set up BitTorrent on my Linux box as I just got my broadband connection set up. I downloaded software from a torrent site. One problem: it's a rar file, or rather a directory of rar files. I appear to have a lot of `parts'­ how the heck do I put them together as one whole file that can be installed? Now, I could go upstairs with my credit card and use my daughter's PC with its bloated junk OS to pay for an overpriced Windows version of rar software and then come and install the resulting file on my Linux box, so that I can then install Windows apps and games to demonstrate to said daughter that Linux is worth considering. In short, how do I convert a rar directory into an RPM? Oh, and as an aside, why the heck would anyone use rar files? I mean, what a fuss and bother it is!</question>

<answer>The `rar' file format is popular under Windows, as it allows an archive to be split across multiple files and for those files to be combined once downloaded. You can't convert a rar file into an RPM, as the rar is simply a package, just like a tar.gz or tar.bz2 file. But you can unpack it using the `unrar' program, which will be available from your ISP's FTP service, or on the original installation media. You will also have to install Wine and any other required software to be able to run programs for Windows under Linux, which may be harder work than actually just finding Linux alternatives to the Windows software. Almost everything that can be done in Windows can be performed in Linux using freely available software, including playing many games.</answer>

<title>Wireless questions</title>

<question>I currently use an Alcatel modem (SpeedTouch 330) given to me by my ISP and I simply can't get it to work with Linux (I'm using Gentoo Linux with 2.6.9 kernel). I decided to build a wireless home network, so I'm planning to buy a D-Link DSL-G604T wireless ADSL router. My first question: is this hardware fully compatible with Linux or do I need to install any drivers as with the Alcatel modem? I have a notebook, and I want to connect it to the network through a wireless cardbus adapter. I want a card supported natively by a kernel module, something that could work straight out of the box with Knoppix, for example. After some reading I found that it should be a card with the Prism 2/2.5/3 chipset, but I'm confused and don't know how to find a manufacturer/vendor of a popular cheap card with that chipset. So my second question is, can you suggest a good adaptor using the Prism chipset? Thank you for your help.</question>

<answer>The wireless router from D-Link will make the connection to your ISP over the DSL circuit, so you will not need any PPPoE or PPPoA support on the Linux system. You can connect straight into the router using Ethernet, and DHCP against the router for an internal address. Essentially, everything will be offloaded on to the router, making your Linux system a plain old workstation, rather than a router. As far as PCMCIA wireless adaptors are concerned, you can check out www.linux-wlan.org/ or www.prism54.org/. You'll find that Prism54 identifies devices supporting the 802.11g standard as well as 802.11b for faster connectivity. Prism2 and Prism54 cards are identified by Knoppix at boot time, and will enable you to access the internet easily without having to install a large number of supporting packages.</answer>

<title>Into the Abyss</title>

<question>I'm setting up an old computer to act as a web server internally on my network, to use for my web design business. I'm planning to try Vector Linux 3.2, which I have on disc, for the OS and, after reading LXF57 (page 68), Abyss web server. I would like to run it without a monitor or keyboard, accessing it from my main computer over the network. Here's my question: once I've installed the software, how do I set it up to log in automatically on booting up so I don't need to see what's happening? And what user name should I use for logging in? Do I need a user specifically added for the purpose or can I use the same user as my other machines?</question>

<answer>Web servers will generally start through the scripts in /etc/init.d/ at boot time, so it's unnecessary for you to log in as anyone to run the service. When you install the package providing the web server process, it will create any required users necessary to run the service, so you won't need to do anything. Once installed, web services should start when the system is rebooted, allowing the box to be restarted without any user involvement.</answer>

<title>Talking chattr</title>

<question>Does anybody at LXF use the chattr program at all? I was looking at the program's man page recently and it appears to be a very interesting utility. I'm a little surprised that it doesn't seem to get much mention as some of the attribute settings it can create would, on the face of it, appear to be very useful, such as the immutable attribute, switch `-i'. Would that be useful from a security point of view to protect key system programs from being modified (renamed, deleted, overwritten, etc)? And the `-s' switch looks good, which I take to mean `sparse', as it apparently zeros a file's blocks, then writes them back to disk on a

delete. Would that be a quick solution for people who have posted, inquiring about how to remove a file in total?

The program even has an`undeletion' attribute, switch `-u', though it should be pointed out that it's not implemented as yet. There will be a total gem if that ever occurs. In fact chattr seems like a gem of a utility overall. I suppose it could make updating files a bit bothersome, if a person forgot they had set the immutable attribute on a file. But then, it would just be a matter of resetting it as `root'. I guess a trojan or the like could do the same if it suspected it may be set. But at least it would forcethe trojan to engage in extra activity and possibly make itself known as a result. The man page suggests that chattr's designed for the ext2 FS, but it does mention ext3, and talks about a journaling switch `j'. I'm not sure how much that would limit its broader usability. I would think it would just be one of the many concerns associated with any development project. I've been wondering what people think of chattr, and, if they've used it, if it just caused them too much bother to be bothered. To me, it seems like it's just been hiding down there in /usr/bin', waiting to be put to work. </question>

<answer>The chattr utility is indeed very useful, as it allows many of the extended POSIX flags for files to be modified easily from the command line. chattr should work with many file systems, although it should be noted that ext2 and ext3 are essentially the same, with the latter being wrapped by the jbd layer in the kernel. Using chattr is very useful in situations where you don't want users to delete files from their home directory, or make modifications to them even when they can run `chmod' over them. It can also prove handy when multiple administrators are working on a system and you want to avoid them making changes other admins don't want modifying. While anyone with root access can remove chattr settings, it does make them think and hopefully stops people before they make silly mistakes. It's worth remembering that many file systems now also have extended ACL capabilities configurable from the command line, with the current 2.6 kernel releases, to allow for very granular file access controls.</answer>

<title>Distro fever</title>

<question>If you have a document in, say, AbiWord, or another program, can it simply be read by someone who has another distribution of Linux?

In other words, if soul A writes something in AbiWord on their Debian machine, and sends it to soul B, who has SUSE, or to soul C, who wears a Fedora, or soul D, who has a Yellow Dog, can these all simply be read, say by someone who has OOo, but not AbiWord?

Further, if I were to have, say, SUSE and Debian, or another distribution, on the same machine, is it simple enough to transfer that file to the Linux on the other hard drive or partition? This may be a simple question, but I recall reading years ago that information can't necessarily be easily transferred from one Linux distribution to another. It doesn't make sense to me why this would be the case, but... Right now, I'm thinking that I would like to get a machine and put either Mandrake or SUSE on it. Though I'm always reading good things about Debian, too. I realise that the focus of some of these distributions is different, or at least it is my distinct impression that they are directed toward different purposes. Any advice?</question>

<answer>Every distribution is essentially the same: the Linux kernel with the GNU tools. Debian, Mandrake, Fedora and everything else is pretty much the same thing under the hood, although they have different installers and styles to the installation. As long as the file format being used is portable across different applications, then the file can be read on any distribution, or even operating system, without much hassle. Sharing files between different distributions is done all the time without any problems. Indeed, many people share files between Linux and other platforms, such as BSD, Windows, Solaris and so forth, for remote file access and portability.</answer>

<title>Dual booting SUSE</title>

<question>I'm guessing that a few readers have tried dual booting SUSE 9.2 and Windows XP. Given the problems with 9.1 (and several other distros, not just SUSE) a few months ago, my question is, does Grub get along with the XP boot loader straight out of the box now? I'm asking because my daughter's boyfriend is coming to stay with us, and he wants me to install SUSE on his laptop for him. The laptop is currently running WinXP, but he's seen my daughter's PC running Linux and wants to begin migrating. Naturally I'm delighted that he's decided to embrace the penguin, but I'd rather not (a) have problems during his stay trying to get a dodgy dual boot to work or (b) make his XP unbootable. (Actually, there might be some pleasure in that, but that's another story...!) If all is well, then SUSE 9.2 will go on. If there are still problems, I could always do a 9.0 install instead, but I'd really rather give him the benefit of the latest versions of everything.</question>

<answer>When you install SUSE, it will locate the Windows XP file system and automatically add an entry to the Grub configuration so that XP will continue to boot. For the most part, distributions are intelligent enough to spot what else is on the discs and will add the appropriate entries to the boot loader so that everything can keep on working. </answer>

<title>Dis-mount problems</title>

<question>I can copy a file from a Linux machine running Mandrake 10.0 to a Windows directory in a partition on the same machine, ie:

cp samba_issue.txt /mnt/windows/

This works OK. I can read from, but cannot copy any files to, a Windows directory on another machine mounted using Samba, ie:

cp samba_issue.txt /mnt/pc1_DOWNLOADS/
cp: cannot create regular file `/mnt/pc1_DOWNLOADS/samba_issue.txt':
Permission denied

The same PC re-booted in WindowsMe can copy to the Windows directory on the other machine. The target Windows machine is a Windows 98SE machine and has the directories shared with no password, as I know from past experience that there are issues that I don't understand with encypted or plain text passwords not working correctly. The machines are networked together by good old-fashioned Ethernet wires, via a router. The Samba connections were set up via the Mandrake control centre, and I have checked that I don't have the `read-only' option for the mount checked. The Samba packages I have installed are:

$ rpm -qa | egrep -i samba
samba-client-3.0.2a-3mdk
samba-winbind-3.0.2a-3mdk
samba-common-3.0.2a-3mdk
samba-doc-3.0.2a-3mdk
samba-server-3.0.2a-3mdk
    My "fstab" file looks like:
/dev/hda5 / ext3 defaults 1 1
none /dev/pts devpts mode=0620 0 0
/dev/hda7 /home ext3 defaults 1 2
/dev/hdc /mnt/cdrom auto umask=0,
user,iocharset=iso8859-15,codepage=850,noauto,ro,exec 0 0
none /mnt/floppy supermount dev=/
dev/fd0,fs=ext2:vfat,--,umask=0,iocharset=iso8859-15,sync,codepage=850 0 0
//pc1/DOWNLOADS /mnt/pc1_ DOWNLOADS smbfs username=%,defaults 0 0
//pc1/MY\040DOCUMENTS /mnt/ pc1_MY-DOCUMENTS smbfs username=% 0 0
//pc1/MY\040MUSIC /mnt/pc1_MY-MUSIC smbfs username=% 0 0
//pc1/RECORDINGS /mnt/pc1_RECORDINGS smbfs username=% 0 0
/dev/hda1 /mnt/windows vfat umask=0,iocharset=iso8859-15,codepage=850 0 0
none /proc proc defaults 0 0
/dev/hda6 swap swap defaults 0 0

I don't really understand the format of this file and have not edited it by hand. I understand that it controls how drives are mapped on to your machine. My understanding is that it is the entries in one's fstab file that control the mapping of drives on the machine you are running on, and that the /etc/samba/smb.conf file controls how the machine you are on appears as a Samba server on the network. Is this correct? Any help from you to get Samba writing from the Linux Mandrake 10.0 machine to the Windows 98SE machine working would be much appreciated.</question>

<answer>A common problem with Samba mounts are permissions. Obviously, Windows lacks the facilities of Unix file permissions, so these are masked by Samba to replicate the sort of file Linux may expect to see. The simplest option is to add the entry `umask=0' to the mount lines in /etc/fstab for the Windows mounts, which will allow any user to modify the files. As a more secure approach, you could create a group who can access Windows files, then use `umask=007, gid=group', where group is the GID of the group you created. This will enable users within this group to modify files, without their having to worry about everyone else being able to do it too. man 5 fstab' is a good place to start when trying to figure out the fstab file. /etc/samba/smb.conf is purely designed for the smbd and nmbd services ­ modifying anything in there is not going to change the way your mounts behave.</answer>

<title>Heavy load</title>

<question>I seem to be having some serious problems with Sendmail. Earlier this evening Sendmail seemed to be causing my server load to spike up in the 4.0 or greater area. When I ran the top command there were several instances of Sendmail going and they were the top processes running. It seemed to be affecting the server for an hour or so. I wish I'd taken a snapshot of the top command at the time. My first question is, what do I look for in my mail log file? What sort of things should raise flags? One issue I have is that I get a lot of spam. Lots of mail is addressed to users that don't exist on my server, configured.unknown.al.charter.com [192.168.10.20] (may be forged) Also, around the time of the problem I found records like this with a strange URL in them:

Nov 12 16:16:13 server1 sendmail[18756]: NOQUEUE:otherdomain.com.br
[192.168.10.30] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA

My second question: when I check my running processes, what sort of Sendmail commands should be running? Is there anything odd about this?

   20334 ? S 0:00 sendmail: server 27.domain.com [192.168.10.40] child wait
   20336 ? S 0:00 sendmail: ./iAE2ECt20336 27.domain.com[192.168.10.40]:DATA

Any thoughts you have on troubleshooting the maillog file would be greatly appreciated. Thanks in advance.</question>

<answer>I don't believe the service load you are experiencing is due to spam coming into your system (successful or failed), unless it's a targeted attack. A CPU load of 4.0 is really quite high and a mail server, unless under attack or extremely busy, should not use so much resources. Going through your mail log by hand can be painstaking even if you don't receive very much traffic. Logwatch at www.logwatch.org is able to go through your mail logs and give you summaries of what is happening. You should be able to tell from here if you have one serious culprit causing you trouble. For a more detailed analysis you could also install Anteater from anteater.drzoom.ch. Although it can be tricky to set up it can give you some very readable reports. The entries you've pointed out are more than likely spam but again, so much mail is these days. I'd highly recommend setting up some level of spam filtering on your system. At the very least subscribe to some RBLs: Spamhaus is a good option. Your second log excerpt is a connection to your server on the SMTP port that was not used to send a message. This could be a port-scan or if there are many of them it could by a Denial of Service attempt (although not a terribly effective one). The last entry you mention is just Sendmail processing a message.</answer>

<title>What's the form?</title>

<question>First off, let me give you a clear warning. I'm a new convert from the Microsoft camp, so you'll have to go easy on me. Well, new convert isn't entirely accurate: I still use mainly Windows 2000 servers but I'm trying to get as much moved to Linux as possible. It's not been an easy ride but it has been deeply rewarding, both in terms of bettering myself and financially. On my Windows servers with IIS I can get my forms to send me emails right out of the box. My pages are very simple HTML but it's just the form that's getting me. I don't mind using something other than FrontPage if I need to. Is there a Linux equivalent to FrontPage forms?</question>

<answer>Welcome to Linux. I'm sure you'll find that as your confidence and ability grows you will gain even more from the world of Open Source! Most Linux administrators and developers will tell you to stay away from FrontPage's extensions as they're so proprietary. They won't work on anything but IIS unless you find some unofficial way of supporting them. There is a FrontPage Extensions available for Linux but it's not made by or supported by Microsoft, and even then it doesn't work on every platform and every version of Apache. You'll be much better off with native code anyway. There are two very popular options when it comes to passing data from form to email under Linux with Apache. One is formmail.pl (www.scriptarchive.com/formmail.html) and the other is formmail.php (www.dtheatre.com/scripts/ formmail.php). formmail.pl is probably the more widely used and requires Perl. Though its reputation has been slightly tarnished by security issues it's still a good option ­ just make sure you get the newest version. The newer formmail.php does not need to run as a CGI script as it's PHP and will work just fine from your html document root. Both come with examples so integration should be pretty easy.</answer>

<title>Receiving visitors</title>

<question>I wrote an article a few months back that got mentioned on Slashdot, and, because I hosted the site myself, my humble server got pounded by thousands of visitors in just a few hours. Back then I used Apache 1.3 with MySQL 3.23. I've now got another article ready to upload that I think will also be a big hit, but this time I want to be prepared ­what can I do to ensure maximum throughput for my server? Since the first article, I have upgraded to Apache 2 and MySQL 4 (both compiled by hand), plus PHP 4.3, and am now using a dual 2.0GHz box with 1GB of RAM. The rest of the system is a pretty basic CentOS (the freebie Red Hat Enterprise) install. If possible I would rather not upgrade the hardware further!</question>

<answer>Slashdot can be difficult to prepare for without some sort of testing. Much of the advice I'll give depends on the type of content you're hosting. Obviously the more static you make your page the more hits your server will be able to handle. You may even want to create a separate low-bandwidth version for the Slashdot crowd. Mounting your file system (especially if it's ext3) with the noatime option will minimise disk overhead as your system will not be updating the `last accessed` time for the page every time it's opened:

    /dev/sda5 /var/www/htmlext3defaults,noatime11

In Apache itself it's well worth turning keepalives off. That will reduce the amount of simultaneous open connection but will introduce some latency into the page loading, especially if there are many images in your page. This is a tradeoff you will have to test but usually turning keepalives off is beneficial. You mentioned that you have a custom-compiled version of Apache. Be sure to turn your MaxClients variable up quite a bit. By default it's hard-coded to 256 in the Apache source and you'll probably need something substantially higher. Still in Apache, you could try an Apache module like mod_gzip. This is only really useful if the bottleneck is your bandwidth (as opposed to your CPU or system). It will compress outgoing data with a hit on CPU utilisation. From the kernel you could modify the net.ipv4.tcp_keepalive_time and net.ipv4.tcp_fin_timeout to something more suitable. I've had good results with setting fin_timeout to 30 seconds and keepalive to 20 minutes. You can modify these using the sysctl command. You could consider using bdflush, especially if you're using a 2.4 kernel. There are many options here to optimise your memory (and page file) usage. Given the specs of the server you've mentioned I doubt you're using IDE hard drives but if you are, make sure that DMA is turned on. Check your IDE drives performance out by running:

   hdparm ­Tt /dev/had

An acceptable speed is about 400MB/sec for cached reads and 20-30MB/sec for disk reads. I've seen a similar configuration on similar hardware managing 200,000 unique connections per hour serve around 300k each time so with a little planning you should be successful. Good luck!</answer>

<title>Slow pages</title>

<question>Now that my broadband connection is working under Linux (SUSE 9.0 and a Netgear DG834 modem/router), I have noticed that when loading web pages (using Mozilla 1.7) a message usually appears at the bottom of the Mozilla screen saying `Resolving Host XXXXXXXX' where XXXXXX is the web address being loaded. This causes a 5 to 10 second delay in the page appearing. Using Mozilla or IE6 under XP this does not occur, and pages load almost instantly. Do you know the reason for this, and can I speed up the display of web pages in any way?</question>

<answer>Mozilla will use IPv6 for DNS lookups, which you probably won't need, and will slow down web access while it times out trying to access hosts. Disable this in /etc/modules.conf by modifying the `net-pf-13' line, which loads the ipv6 support module, and replacing `ipv6' with `off'. This stops IPv6 support loading and will allow Mozilla to purely use IPv4 to access the DNS services for faster lookups.</answer>

<title>Adobe hiccup</title>

<question>I've just installed Mandrake 10.1 CE off the coverdisc (LXF60) and have also just downloaded Adobe Reader for Linux from the Adobe website for a bit of practice at installing something (I'm a newbie). I opened a terminal window and logged in as root (using su) and unzipped the file, etc. I then ran the install file (./INSTALL), and selected the default installation directory (/usr/local/Acrobat5). The installer began to copy the files but I was then hit with the following error:

   Installing platform dependent files ... Done
   ./INSTALL: line 219: ed: command not found
   ERROR installing /usr/local/Acrobat5/bin/acroread

I have repeated the procedure a number of times, and have downloaded the software from the Adobe site on several occasions. Can you shed some light on this one? Thanks.</question>

<answer>It looks like you're missing the `ed' utility, which will be available on the installation media or via the FTP services provided by Mandrake. Of course, one could also use `xpdf' or OpenOffice.org to view PDFs without having to resort to Acrobat.</answer>

<title>Wiki for backpackers</title>

<question>I run a backpackers website and I would like my users to be able to post their own news and photo albums for their family or friends without the need for webmaster interventions and without interfering with each other. What I have in mind is providing a zone/webpage system. I use PostNuke but I would like my (limited) number of users to have the possibility of creating their own homepage, visible to others or for their private use. Unfortunately, I have no idea what such a system is called... not a CMS (content management system) I suppose?</question>

<answer>The system you're looking for is known as a Wiki and allows users to log in and dynamically change pages available to them with ease. There is a Wiki in almost every language imaginable, and even a few no one has heard of, so there is quite a choice. Taking a look at sourceforge.net and freshmeat.net will give you a list of popular Wiki installations, as well as comments from users as to which work best for them. Each Wiki will have a variety of capabilities, including authentication, privileges and so forth, and installing a few and trying them all out is usually the best way to make sure everything works and that they do all you need them to.</answer>

<title>Thumb sucks</title>

<question>I was copying files to my thumb drive during my lunch when I realised I was late for work. Without regard for my thumb drive, I unplugged it mid-transfer and ran out. The thumb drive suffered the consequences, and now is not being detected by either my Linux OS or Windows XP. I fear that the drive is probably done for, since an OS has to detect it to reformat it, but I thought I would tap the community brain just in case. Any help would be appreciated.</question>

<answer>If you don't see anything in `dmesg' when you plug the device in, we would recommend returning it to the place of purchase and obtaining a new one. Possibly removing the card while it was active caused a short, or otherwise obliterated the electronics on the device. While USB is `Plug and Play', it does require filesystems to be unmounted cleanly and for any processes accessing files on the device to be shutdown. Unfortunately, even Linux isn't smart enough to sync all data in the buffers to disk the instant you start to yank it out of the back of the PC. </answer>

<title>Broadband link</title>

<question>I have loaded Mandrake 9.2 on to a second hard drive (with Windows ME running on the other) and have bought an Ethernet card to run my NTL broadband connection. Broadband runs fine on Windows now, but how do I get it running on Mandrake? Someone suggested I run `ifconfig' but I don't know what all this DHCP stuff is. I can get `configure network cards' up in Mandrake's configure but what do I do from here? If you can help I would be really grateful.</question>

<answer>Cable modems generally work via DHCP, so you can simply configure the Ethernet interface in Mandrake to obtain the address automatically from the network and let it work everything out. You can also test it from the command line using the `dhcpcd' utility, which will request a DHCP lease from the NTL server and allow you to access the internet. Using `ifconfig' is only really helpful if you have a static IP assignment, for example, on an internal network, so DHCP is the way to go with cable and DSL services.</answer>