Categories
Unix Websites

Webmail on Linux

I maintain my own mail server and for cases where I can’t easily connect directly with an IMAP mail client, I use a webmail interface.

I’ve been using SquirrelMail for a while, and just recently installed Roundcube webmail which looks worlds better!

The only drawback is that it does not have vacation plugin that works right away with Dovecot, so I’m still playing around with that functionality…

Categories
Unix

Installing Fedora 16 with Tips 

I have to admit I wasn’t too thrilled with Fedora 15, it seemed slower than when I had Fedora 13 running. Perhaps it was because I did the “upgrade” instead of a fresh install. But I did decide to upgrade my hardware and did a fresh install of Fedora 16.

In general, the install went well, there are a few areas I have some notes and tips that may help you if you are encountering problems.

/etc/init.d has changed

Yes it has, but don’t panic! You basically use the “systemctl” command to handle things now, it is a little tricky because you will need to “enable” the service first, THEN you can start/stop/restart like you may have done with init.d in the past. So, for example:

systemctl enable httpd.service

systemctl start httpd.service

To see a full listing of what is available:

systemctl -t service

One thing that is not as obvious, are the iptables commands. For this, you can use:

/usr/libexec/iptables.init save

to save the iptables so they don’t get lost on reboot.

Setting Up Virtualbox

Here are the quick commands to get the awesome Virtualbox going:

cd /etc/yum.repos.d/

wget http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo

yum install kernel-devel kernel-headers gcc dkms

/etc/init.d/vboxdrv setup

I would also install Google Chrome:

Add following to /etc/yum.repos.d/google.repo file (this is for a 64 bit machine):

[google-chrome]
name=google-chrome - 64-bit
baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub

Then:

yum install google-chrome-stable

Getting Flash Installed

rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-x86_64-1.0-1.noarch.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux
yum check-update
yum install flash-plugin nspluginwrapper alsa-plugins-pulseaudio libcurl

NVidia Drivers

Lastly, here are my tips on getting NVidia drivers going, I have three monitors across two NVidia graphics cards that each have 1 DVI and 1 VGA, so I have 2 monitors on the DVI ports, and 1 on the VGA.

Get nvidia drivers direct from nvidia.com, go to the drivers/download section and you will download a linux “.run” file which is basically a shell command file.

Disable nouveau, by appending the following to /etc/modprobe.d/blacklist.conf

blacklist nouveau

options nouveau modeset=0

Drop out of “X” windows, as root do “init 3” — if that does not work, you can ssh into your host from another to get a non-windows login.

Run the nvidia “run” file, i.e. “sh NVIDIA-Linux-x86_64-295.33.run”

Start “X” back up and configure your xorg.conf. Of course, this is an insanely troublesome thing to do, and since all systems are going to be different I can’t tell you what to put exactly. But, I can provide my xorg.conf file and you can perhaps get some help from checking it out.

One last important note… when you eventually “yum update” your system and get a new kernel, you will need to re-run that NVIDIA run file. For me, my system comes up with blank screens until I ssh into my box from another host, re-run the “run” file, and reboot.

Those are my Fedora 16 tips! Hope they help you!

 

Categories
Hardware Movies Unix

Ubuntu and XBMC

Xbox Media Center be praised!

I just installed this on a linux Ubuntu box, and I used the “Live” version which I put onto a USB drive. So, the steps:

  1. Download the ISO file from http://xbmc.org/download/
  2. Burn the ISO onto a thumb drive (or CD)
  3. Boot your host off the USB/CD, you may need to hit F11 during bootup to get to your BIOS and choose boot media.
  4. When booting you can either install or boot off the media to see how it works on your setup. Once you verify your setup, you should install.
  5. Hook up to your TV and stereo and go!

Now, I actually have a file server in my home that stores all my movies in AVI format. So, my XBMC is a very shrunk down system, you could even put it on a small solid state flash drive which would be nice and fast. Then the question is, how to access the files from another server?

I use NFS on my server and mount them on the XBMC host. However, I had to do a few steps to get this going:

  1. You need to install nfs-common to be able to mount. But, the Live install does not have that by default. So, you need to SSH into your XBMC. This is a little tricky, since XBMC will use DHCP to get an IP address and you may not know what IP it has!
  2. Find the IP. One way is to use a “pinger” program that will try and ping every IP in your home network range, and once you do that you can try SSH’ing into each IP that turns up. I use PUTTY if on a windows box to do SSH.
  3. Once logged in, then do “sudo apt-get update”
  4. Then do “sudo apt-get install nfs-common”
  5. Edit your fstab file, i.e. “sudo vi /etc/fstab”
  6. You’ll want to add your file server, usually something like “192.168.2.100:/movies                /movies         nfs     defaults        0       0”
  7. Make sure you mkdir your mount point (/movies in this example) on the xbmc host, then do “sudo mount -a” and your xbmc host should mount the movies
  8. In XBMC, go to Video and add “root file system” to point to your new mount point!
  9. Enjoy!

 

Categories
Unix

Upgrading to Fedora 15 (Lovelock)

After playing damn whack-a-mole with the annoying “want to upgrade?” popup that my Fedora 13 install was throwing at me on a daily basis for months, I finally am upgrading to Fedora 15. I decided to jump right to 15 instead of 14, because why go halfway? And, who wouldn’t jump at installing a release with such a catchy code name.

If you review the past code names for Fedora, you get the idea that the people making them went from being alcoholics, to Twilight fans, to gassy historians, to Nasa enthusiasts, to Bachelor-Pad viewers who like the letter “L”.

But I digress.

Outside of some sys admin changes that can throw you for a loop if you are used to core things not changing, the system feels the same which is nice. One GREAT thing is that I didn’t have to adjust anything for my 3 screens/monitors configuration to still work!

One oddity is that Thunderbird 6 (I had thunderbird 3 previously) seems to run slow, so I am investigating plugins/settings to see what can be done.

Categories
Unix

Webmin PCI Compliance

PCI compliance! Just the phrase is enough to ruin one’s day. But fear not, here is some handy info on what I’ve learned.

For Webmin, you should:

  1. Go to Webmin -> Webmin Configuration -> SSL Encryption
  2. Enter this into Allowed SSL Ciphers field: “ALL:!ADH:!LOW:!MEDIUM:!SSLv2:!EXP:+HIGH”
  3. Set SSL protocol version to “3”

You can check from the command line to make sure SSL-2 is not allowed via:

openssl s_client -connect localhost:10000 -ssl2

and you should get a line that has “error” in it to verify.

Categories
Unix Websites

Running root commands in PHP via Apache

I have a web application that needs to perform shells commands as root within a PHP function, and you would think that would be pretty straight forward… but it did take my a few googles to get all the details, so here are my handy notes on it. This is on a Linux system running Apache, and we’ll be using “sudo” within “shell_exec” to run the commands.

The main thing is to edit the /etc/sudoers file, and typically you can (as root) use the ”visudo” command to do so.

Make sure apache can run commands, AND not require a password:

apache  ALL=(ALL)       NOPASSWD: ALL

Then you need to comment out this line:

#Defaults    requiretty

If you don’t, then you will see these errors in /var/log/secure: “sorry, you must have a tty to run sudo”. Now you are ready to go, and the PHP code is simple:

$results = shell_exec(‘sudo date’);

Categories
Unix

SquirrelMail working with change_sqlpass

I installed SquirrelMail 1.4.21 the other day, and I wanted to add the plugin for password changes. I chose the one that works with MySQL, since I use Dovecot with the MySQL option for users/passwords.

I downloaded the change_sqlpass plugin, and ran into an issue where once the user changed the password, it gave an error “Your session has expired, but will be resumed after logging in again.”

I had to dig around to find some patches people recommended to use, but that plugin download is over 5 years old and has not been updated with it! You basically need to update one file, “functions.php”, so I have done so and you can just grab it here.

Categories
Unix

Pure-FTPd is good

I sure do like pure-ftpd, it chroots user logins so they can’t chdir all over the place, and is easy to configure and use.

I did have one case lately where I would connect in and it would hang while “entering passive mode”. It turns out I needed to add some extra stuff into iptables. This did the trick:

-A RH-Firewall-1-INPUT -p udp -m udp –dport 20 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m tcp –dport 20 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m tcp –dport 21 -m recent –set –name FTP –rdest -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m tcp –dport 1024:65535 -m recent –rcheck –seconds 9800 –name FTP –rdest -j ACCEPT

-A RH-Firewall-1-INPUT -p udp -m udp –dport 20 -j ACCEPT -A RH-Firewall-1-INPUT -p tcp -m tcp –dport 20 -j ACCEPT -A RH-Firewall-1-INPUT -p tcp -m tcp –dport 21 -m recent –set –name FTP –rdest -j ACCEPT -A RH-Firewall-1-INPUT -p tcp -m tcp –dport 1024:65535 -m recent –rcheck –seconds 9800 –name FTP –rdest -j ACCEPT

Categories
Unix

SVN in chroot says you don’t exist

You may one day set up a chroot environment and find you get this message when you try to ssh or use svn (using ssh):

You don’t exist, go away!
svn: Connection closed unexpectedly

In addition to my assurance that you do indeed exist in the universe, let me tell you how I fixed it.

Check your chroot /etc to make sure passwd and shadow exist for your user and the IDs are correct.

Then, note that when svn does a repository connection it uses libnss_files.so which can require proper DNS resolution. In my case, I had to add the repository domain name into the chroot /etc/hosts file.

Then I existed in more ways than one.

Categories
Hardware Unix

Fedora13 kernel update breaks video

I did my usual old “yum update” the other day and it hosed up my video upon reboot!

Never fear, it is a known problem, and has probably already been fixed by the time you read this.

But one thing I learned is that you should have akmod installed so the system will be smart and use a previous video driver if it fails. To do this, all I needed to do was:

yum install akmod-nvidia

then, on reboot, it was all working again.

[Update]

One thing to note is that when you do a yum update, make sure if there is a new kernel that there is a corresponding nvidia update for it! If not, then DO NOT yum update, and try again in a day or so. Eventually there will be a matching nvidia update and you are safe to update. Example:

Installing:

kernel x86_64 2.6.34.9-69.fc13 updates 22 M

kernel-devel x86_64 2.6.34.9-69.fc13 updates 6.4 M

Removing:

kernel x86_64 2.6.34.7-63.fc13 @updates 102 M

kernel-devel x86_64 2.6.34.7-63.fc13 @updates 23 M

Installing for dependencies:

kmod-nvidia-2.6.34.9-69.fc13.x86_64 x86_64 1:260.19.36-1.fc13.3 rpmfusion-nonfree-updates 2.8 M

Removing for dependencies:

kmod-nvidia-2.6.34.7-63.fc13.x86_64 x86_64 1:260.19.29-1.fc13 @rpmfusion-nonfree-updates 12 M