I’m a little late on writing this, but tomorrow the new version of Ubuntu officially launches and I must say, I’m impressed!
I’ve spent the past couple of days installing it on 2 of my boxes and testing/checking it out.
I encountered a couple of rather minor issues and have reported the bugs, but I must say the new version is a really nice improvement from 9.10 in many ways!
The new “favored” improvements are as diverse as the users who use it, but a few of mine are these:
Improved support for NVIDIA proprietary graphics drivers
I have NVidia GeForce 8800GT cards in both of my boxes with a dual-monitor setup on one and this has been a major challenge in the past.
In 9.10, if the monitors weren’t connected at the time Ubuntu was installed the graphics driver would always fail when adding a new monitor during boot.
Trying to add the second monitor to work correctly was such an issue that I finally backed up my files and just re-installed it,
but even then it would sometimes fail to load correctly and took re-booting a couple of times for it to finally load correctly.
Well, with 10.04, it worked great! I did have some issues with swapping the screen layout positions in the NVIDIA X Server Settings with
Xinerama enabled, but when left in their default positions, they worked great.
I’m even using two different resolutions, 1440×900 on my 19″ and 1680×1050 on my 22″ and no problems so far.
This has been a problem I’ve dealt with since 9.04 and it’s finally looking a lot better!
New Faster Boot
The new version loads FAST! It takes no time at all to get into the desktop compared to previous versions.
I don’t know what they did, but it seems they put a turbo charger under the hood and it get’s there quick!
iPod Touch / iPhone Support!
That’s right! I connected my iPod Touch and can now access/listen to the files on it!
I don’t know if anyone ever figured this out in 9.10, but it was a very simple no-fuss process and worked instantly!
I noticed the package also ways it supports the iPhone as well, but I can’t confirm this since I’m not rich enough
to afford one of those.
Either way, I’m definitely excited about this feature!
One less reason to need Windows…..
Gwibber Social Client
For those who are social network fanatics, they’ve got a new toy for you!
Gwibber allows you to keep track of your feeds from a variety of social networks such as Twitter, Facebook,
Flickr and more by adding your accounts and then being notified of all new updates.
There’s lots of other features I’m forgetting, but there’s a couple that stood out to me.
Drawbacks:
Well, just as sure as there are pros, there are also cons.
Compiz Strikes Again!
One bug I encountered was “System > Preferences > Appearance” and the “Visual Effects”,
which is the compiz package…. when any of these options are enabled, it really gets buggy.
I am unable to add/remove items from the launch bar, some of the “Unlock” buttons in the administrative
menu don’t work, I couldn’t shutdown/reboot the pc since it kept dumping me to the login screen instead, etc.
It took me a while to figure it out, but with some help I managed to discover it was this causing the issues.
Also BEWARE, some applications will automatically switch this on without asking, so if you get these errors,
check there first.
Hopefully they get this bug fixed soon if it’s not already fixed at the official release.
Upgrade From 9.10 to 10.04 broke Grub
I don’t know how common this issue is or will be, but when I updated from within 9.10 to 10.04,
it for some reason mapped my boot drive to an invalid device, which was easy enough to fix.
There were other issues with this, but as I said, it was fixable with minimal fuss.
Minimize/Maximize/Close Buttons on the left side!!
I was told this was done to make Ubuntu “unique”, sorta like branding or something and I don’t like it one bit!
Do a little searching and I’m not the only one who dislikes this either.
There are a number of tutorials on how to correct this, so if you insist on sticking with the new theme,
just Google it and you will find the answer on how to correct it.
The only issue with repairing it is if you switch themes then switch back, you’ll have to fix it again.
I found a much simpler solution!
It turns out this only applies to a couple of the themes, so if you go to “System > Preferences > Appearance” and
select a different theme, such as “New Wave”, the buttons go back over to the right side where they belong.
The New Wave theme was the default one in 9.10 and looks good enough for my liking, so that’s the one I’m using.
I really think the swap was a terrible idea and very few are going to like that, especially the cross-platform people
since it’s confusing, but if they think that’s necessary, well, I’ll just change it back and keep on going.
Conclusion
That’s all I can think of off the top of my head, but over all, I definitely like the improvements and new features!
They’ve done a great job and it’s a refreshing version for sure.
While it does have a few glitches that hopefully will continue to be fixed, I think it’s the best version I’ve used
since starting with 8.10.
Hey everyone,
I wanted to let you all know I am working on a new website for myownserver.info!
I’ve been using Joomla for over a year now and it has done a pretty good job, but it isn’t the friendliest when it comes to allowing contributors to get involved and requires a lot of extra maintenance on my behalf.
So since I don’t want the website to become out-dated and no longer useful, I decided to re-structure it for friendlier navigation and better structuring and convert the site to use Mediawiki, which allows better user contributions. This also allows users to update content and add on things I may have missed. I wanted to make it a community project for some time now and I think this is a good step towards doing just that.
The new site is located at http://myownserver.info/wiki/ and once it is further along and better developed, I will eventually remove the main site and forward all traffic to the new one. So thanks again!
This tutorial explains how to install cwRsync “rsync for Windows” on your windows 7/Vista PC. I personally am using Windows 7 64-bit, but it should be the same for other versions as well. I am configuring it to use SSH so it is a secure connection between the machines.
Rsync is a very flexible and useful tool for syncing files between computers or even folders on the same computer.
While it is primarily developed for Linux, there are Mac and Windows versions of it available as well. The Windows version depends partially on cygwin to resolve issues such as the Windows drive names. ( The “:” is a problem. ) It doesn’t require having to install Cygwin, it just uses some dlls from it.
Why rSync and not one with a GUI?
Sure there’s Unison, DeltaCopy, and some other syncing utilities, but I really needed a one-way syncing option that works similar to Pscp, but doesn’t copy every file over every time it runs, only new ones. And I also didn’t want to delete my local copies if they no longer existed from the source I was syncing from either, so Unison was out of the picture and not what I needed.
DeltaCopy looked somewhat promising, but it doesn’t give me the option to use command line commands with it and it also requires a daemon/client configuration, which was way more than what I needed. rSync can transfer files just fine without a daemon running, which was confusing when I read numerous articles on it.
I just wanted something I could add to Windows Task Manager that would check with my server every day for new files and make a copy of those so I’d have the files if the server went down before I was able to get them from it. A CLI rsync was a must for this. If one of the other one’s suit your needs, then by all means use them instead since they’re a little easier to use.
File Permissions Between Linux and Windows
One thing I wanted to note is that Windows will NOT preserve the file/folder permissions for the files being synced from Linux. This may not seem like a big deal, but if you need to quickly restore a backup, you will have to go back through and re-configure all of your permissions/ownership settings. The work-around is to archive the files using tar or gzip on the Linux machine BEFORE transferring the file to Windows, which I was already doing that since I’m syncing crontab job backup files.
Installing cwRsync For Windows
First you need to download cwRsync and follow the 6 simple installation steps there.
I will add one recommendation though, install it in a folder such as C:\cwrsync\ or something, NOT the Program Files (x86) or similar folder. There’s a good reason for this.
Once you have finished installing it, we’ll assume you installed it in the suggested path I mentioned, you should find it created a sub-folder named cwRsync.
How To Configure and Run cwRsync for Windows 7/Vista
There’s a few steps on setting it up correctly so that it will work. This is where I had the most difficulty because there are so many different explanations on how to do this.
Remember, I’m just interested in using rsync to sync files one-way from Linux to Windows with the rsync command.
First we will add the rsync path to Window’s Environment Variables so we don’t have to use the path to the command and so it can find ssh.exe.
You may see some tutorials showing you to do it via the command line using Path=C:\…. but the problem with that method is it only lasts for the duration of that CLI session or until Windows is rebooted. ( Not sure which one exactly. )
Unless you want to keep entering it every time it runs, that’s not the way to do it.
Git, msysgit, tortoiseGit, OpenSSH Users Beware!
Before I go any further, I want to warn people of a problem that caused me a lot of trouble!
I have msysgit installed and it had added the path to the bin folder to my Environment Variables so it can access OpenSSH for the SSH connections.
The problem is this will cause cwRsync to use THAT ssh instead of the one it should be using in the C:\cwrsync\cwRsync\bin\ directory and it won’t work for some reason.
So beware of that if you have any of those installed!
To access your Windows Environment Variables, click on your start menu, then right-click on computer and select Properties.

It should open a screen with “View basic information about your computer”.
On the left side, you should see the Control Panel Home column. Select “Advanced system settings”.

It will open a window named System Properties. Make sure the Advanced tab is selected.
Look near the bottom and you should see a button titled Environment Variables… Click it.

This will open up a window titled Environment Variables.
In the lower window titled System variables, scroll down and find “Path” and double-click it.

NOTE TO GIT/ OPENSSH USERS:
If you use any of the programs mentioned above, browse through the Variable value and see if there is any path in there that refers to the bin folder or any folder containing ssh.exe.
For instance, I am using msysgit and I have the path C:\msysgit\Git\bin\ in there. If so, make SURE you enter the following BEFORE this path.
You will likely see several values for Variable value:.

Be careful to not delete any of them or mess them up because it could cause some of your programs to not work correctly.
Press the “End” key or just arrow over until you reach the end of the line and then add your path with a “;” before it if there are existing values here.
Here’s an example of a before and after:
C:\Program Files (x86)\QuickTime\QTSystem\ C:\Program Files (x86)\QuickTime\QTSystem\;%SystemDrive%\cwrsync\cwRsync\bin\
The last value doesn’t need a following semi-colon, but every value MUST have semi-colons separating them from other values.
You may notice I used %SystemDrive% instead of C: and may wonder why. There’s no particular reason because they both mean the same thing, so you can do it either way.
Once you have added your path, simply click “OK” on all of the windows and they will close out.
To test it and make sure it is set correctly, Click on your Start menu and in the Search box, type cmd and press enter.
It should open up the Windows Command Prompt.
Type rsync and press Enter.
If the path is set correctly, you should see it spit out a bunch of stuff about rsync similar to this:

If not, go back and check your path and make sure there isn’t any mis-spellings and it IS the correct path.
If you change the Path variable, make sure you close the command window and then launch it again after changing it.
Otherwise the changes won’t be applied until it is re-launched.
Now the next step is to create a couple of directories that OpenSSH will try to find, but won’t for storing the known_hosts file.
Go to your install directory, C:\cwrsync\cwRsync and create a new directory named home.
Open that directory and then create a directory named the same as your user name.
Example, mine is David, so I created a folder named David.
So now you should have C:\cwrsync\cwRsync\home\David\ or whatever your user name is.
Now we need to jump over to our Linux PC and verify rsync is installed and we have a directory we can read from.
We’ll come back to Windows in just a minute, so just leave it as is for the time being.
Configure Linux Ubuntu 9.10 for rsync
This part is really simple since we’re not using a daemon. We should just need to check a couple of things and we’re done.
Open up Terminal and simply type:
rsync
It should spit out a bunch of info like it did in Windows. If it says something about it not being a valid command, you will need to install it by typing:
sudo apt-get install rsync
It came pre-installed with mine, so anyways.
Now decide what folder you will be syncing with. I am storing my backups in a root folder named backup, so the path is /backup/.
You can just as easily store it in your user’s home directory, which would be something like /home/username/backup/ or similar.
Now make sure if you’re just syncing FROM this directory, your linux user has Read Permissions for this directory. So it needs something like 0640 or 0700 depending on your particular needs. If you don’t understand Linux permissions, I recommend searching Google and reading about them.
Now add a file and/or directory with files so you have some test content.
We should be done with Linux now!
Testing cwRsync in Windows
Now one last thing we need to do is create a local folder to store the synced files in. I just created the folder C:\backups\ for simplicity.
At the command prompt, try the following:
rsync -avz server@192.168.1.115:/backup/ /cygdrive/c/backups
WHAT IS THAT?!?!?
Ok, we’re using the options -avz which means “Archive Mode” to compress the files if they aren’t already, “Verbos” which means we want to see the status, then “Compress” to compress file data during transfer.
Next, we have our username and server’s IP. So it is username@serverip.
Now we use a colon “:” and then specify the remote (Linux) directory we want to sync with. As I stated above, I’m using /backup/.
Next we use a space and then specify our local backup directory we want to copy/sync the remote files to.
“What’s the /cygdrive/c/ thingy all about?”
This is one of the ways rsync uses cygwin. Since the colon “:” has special meaning in rsync, you can’t use C:\ because it won’t work. So cygwin provides a substitute to correct this by referencing the drive as a Linux-style path. So in a nutshell, /cygdrive/c/ is the same thing as C:\.
Then the last part is simply the directory relative to our C: drive for storing the backups.
If everything is correct, you should first be prompted to enter your Linux user’s password, something like:
server@192.168.1.115's password:
Enter your password and press enter. ( It doesn’t show the characters as you type them. )
Next you will see a notice saying something like “The authenticity of host ‘192.168.1.115 (192.168.1.115)’ can’t be established. RSA key fingerprint is …” and then asked Are you sure you want to continue connecting (yes/no)?.
Type yes.
It will say: Warning: Permanently added ‘192.168.1.115′ (RSA) to the list of known hosts.
This is fine.
At this point, it should start syncing the files. At this point, you now have cwrSync successfully syncing from Linux Ubuntu to Windows 7/Vista!
If you got any errors, then see the bottom of this post for a couple of things to try.
Also something I noticed while writing the tutorial is if you wait too long between going through the steps, it will fail, so don’t leave long delays between entering your password and what not.
There’s one last thing I’m going to explain how to do:
Use rsync without having to enter the password every time
In order for me to run cwRsync with Windows Task Scheduler, I had to somehow manage to run rsync without being prompted for a user password.
I found something in the rsync man pages explaining how to set a password variable or use a password-file, but the password I’m being prompted for pertains to the SSH connection and therefore those options won’t work.
I don’t recommend this unless you need to run rsync with Task Scheduler since it does pose a risk.
!! WARNING !! – This is a serious security risk!
Since Windows isn’t a very secure system to begin with, if someone manages to get a hold of your private key, they can wreak havoc on your server! So beware!
For this part, the tutorial at How To scp, ssh and rsync without prompting for password was a good one to follow.
Step 1 is a little confusing, just run that command from your Windows command prompt.
Also remember /home/User/.ssh/ is actually C:\cwrsync\cwRsync\home\User\.ssh\ in case you forgot that part earlier.
A final note on that tutorial is I highly recommend NOT doing step 5. Read my warning just above. It’s a really bad idea.
Once you finished those steps, try running rsync from your CLI again and you shouldn’t be prompted for a password this time.
If so, GREAT! Now you can add it to Windows Task Manager and have it automatically check your server for new backups or files without you having to do anything!
COMMON ERRORS
These were the errors I encountered and they almost drove me crazy since I had a very hard time finding solutions for them.
Directory Issues:
These three errors were due to the /home/User/ directories not existing.
Could not create directory '/home/User/.ssh' ORCould not create directory '/c/cygwin/cwRsync/home/User/.ssh' ORFailed to add the host to the list of known hosts (/home/User/.ssh/known_hosts)
I explained what to do to prevent these above: CLICK HERE.
The other error was this one:
rsync: connection unexpectedly closed (0 bytes received so far) [sender] rsync error: error in rsync protocol data stream (code 12) at io.c(600) [sender=3.0.6] rsync: connection unexpectedly closed (0 bytes received so far) [Receiver] rsync error: error in rsync protocol data stream (code 12) at io.c(610) [Receiver=3.0.7]
This one was covered above in my warning to Git users: CLICK HERE
I created a post on my other blog, one I consider my “dumping” blog where I post a wide variety of topics that I don’t feel belong here, that goes into more details pertaining to these errors. You can check that article out at cwRsync Won’t Work In Windows Vista/Windows 7.
I really hope this tutorial helps you and serves as the last destination for getting cwRsync to work. I know I had my share of issues sorting this out and nothing I was finding helped, so hopefully this isn’t another unhelpful how-to.
After successfully using my previous tutorial to get my server up and sending emails, I thought I was finally finished with the email nightmare. The server was sending them and I was receiving them … then came the next nightmare. ALL of my local mail was being sent via my SMTP relay and it was using up ALL of my allotted 250 SMTP relays per day as per Godaddy!
I had created a seperate account just for the outgoing emails, which I never checked since it was JUST FOR OUTGOING emails. When I started experimenting and trying to learn how to setup cron jobs on my Ubuntu 9.10 server, I started realizing I wasn’t getting any emails anymore from the cronjob. I tried sending them via the CLI, which worked before, but all of the sudden nothing!
I logged into my godaddy account and looked at that account and discovered I had exceeded the limit. How in the world?!?!? It should only send a couple of emails a day, so how did I manage to max out the 250 limit?
I logged into the webmail panel for that account and it was FULL of all kinds of server reports that were sent to other users, such as root, etc. Something I had never noticed was that Ubuntu regularly uses the mail program for system messages and when you don’t have any sort of email server setup, it usually defaults to writing it to files in /var/mail/mail . Unless you actually research it, you’ll probably never even notice or realize that this is happening.
I was having problems with cron not writing to a log file and it turns out the errors were all being sent via mail. The email account inbox was FULL of them!
Before You Begin:
This tutorial is written with the assumption you’ve already read the previous tutorial, Make Exim4 MTA work with PHP on Ubuntu 9.10 .
This is a re-configuration tutorial based on that one, so I just wanted to note that since there’s some additional steps mentioned in that tutorial that aren’t in this one.
The Solution:
After several hours of trying to find an answer of how to stop all local emails from being sent via the smarthost SMTP relay, I was really having no luck. The documentation IS thorough, but it gets to a level where an average guy like myself just can’t understand all of it and I sure didn’t know how to apply it or where to begin. IRC wasn’t offering any help either.
So on a hunch, I gave the configuration process another look and I managed to find someone who sorta knew how to configure it, which was far better than what I was doing. So with a little of assistance, I managed to get it figured out and here’s how:
Download and Install a GUI Exim4 Monitor
I downloaded and installed the package gEximon, which you can install via the Synaptic Package Manager in Ubuntu or just type:
sudo apt-get install geximon
There’s no menu shortcut, so to launch it, type
sudo geximon
and it should open up the GUI. The two lower windows is what we want to pay attention to. The upper one shows the status of the sent emails and where they were sent to. If you’re having the same problem as me, you will see all of them being sent via your smtp_smarthost.
The lower window shows you all new emails that are queued and waiting to be processed (if any). This will allow you to see what is happening with exim4.
The first useful tip was to copy /usr/share/doc/exim4-config/README.Debian.gz to the desktop, then unarchiving it. I did it like this:
sudo cp /usr/share/doc/exim4-config/README.Debian.gz /home/username/Desktop/README.Debian.gz cd ~Desktop/ sudo chmod 777 README.Debian.gz
Then I right-clicked and chose Extract Here. ( Sorry, I didn’t know the CLI command. )
Open the README file and it has a pretty good explanation of each step starting at 2.1.
Now, in the Terminal, type :
sudo dpkg-reconfigure exim4-config
This should bring up the Mail Server Configuration screen.
General type of mail configuration:
In my previous tutorial, I chose the mail sent by smarthost; no local mail and I think this is where my problem was or at least where it began.
Section 2.1.1.1. in the README file was very helpful at better understanding the differences.
It turns out mail sent by smarthost; recieved via SMTP or fetchmail was actually what I should’ve selected, even though I was only interested in sending emails from PHP scripts or by using the mail command in a crontab. The received via SMTP or fetchmail part was what was confusing me because I really wasn’t interested in incoming mail.
The ‘mail name’ is the domain …
I believe I also made a mistake when setting this in the previous tutorial as well. Since we can set rewriting later and MOST of the email will be local, I went ahead and set this to my server’s hostname. I’m not sure what role this setting plays or if it even matters, but since it worked fine after changing it, I’m going with that.
To find your hostname, open another Terminal and type one of the following: (both worked for me)
hostname OR hostname --fqdn
This will give you the host name of your server, so just enter it.
Ip-addresses to listen on for incoming SMTP connections:
I left this like it was before, 127.0.0.1
Other destinations for which mail is accepted:
Leave this one blank
Machines to relay mail for:
Leave this one blank too.
IP address or host name of the outgoing smarthost:
This should be the SMTP server value for your email hosting account.
You should be able to use your Internet Service Provider email account for this, but I’m using Godaddy, so it was smtpout.secureserver.net.
See my previous tutorial for more details on this setting.
Hide local mail name in outgoing mail?
I chose Yes for this one, but I’m not sure how relevant this is or exactly what it does for that matter.
If you fully understand it, great! You know more than I do if so.
Visible domain name for local users:
I really think some of these questions look like they’re asking the same thing, just changing the wording.
For this value, I went ahead and entered the domain name I am primarily using.
Example: myownserver.info
Keep number of DNS-queries minimal (Dial-on-Demand)?
I chose no, but it’s your decision.
Delivery method for local mail:
NOW we’re getting somewhere! This is what I needed before.
Since Ubuntu/Debian normally uses mbox as the description says, I chose mbox format in /var/mail/ for this one.
Split configuration into small files?
Once again, your choice. Mine was No.
Root and postmaster mail recipient:
I entered my username for this. At first I thought this could make it send the emails via SMTP to me, but local emails are now local emails, so it will write it to the /var/mail/ directory instead.
If you don’t assign a mail recipient, you may find it difficult to retrieve them.
As a side note, if you’re running Ubuntu 9.10 Desktop as your server OS ( I just like the GUI, can’t make myself drop it.), then you can configure Evolution Mail to read the local mail files. Searching google should lead you to a good tutorial on how to do this.
After this step, it should close out and you will see it say something like Stopping MTA for restart …
Once it finishes restarting, it should now be configured correctly. To try it out, try using the mail command.
Make sure you have gEximon open so you can see what happens.
First, send an email to a local user, such as root or postmaster.
echo 'Just saying hi!' | mail -s 'Test Email' root
You should see something like:
20:18:21 102Din-008Tl-A9 <= root@server-desktop U=root P=local S=352 20:18:21 102Din-008Tl-A9 => /var/mail/mail <root@server-desktop> R=mail4root T=address_file 20:18:21 102Din-008Tl-A9 Completed
Wonderful! So this is telling us the local email WAS sent to the mail folder like we want. You can repeat that for other users if you like and they should be doing the same thing.
Next, try sending it to a remote address, which should be transferred via the smarthost.
echo 'Just saying hi!' | mail -s 'Test Email' myname@hotmail.com
Now check the email account you sent it to and you should have recieved the email as long as your smtp is configured correctly.
If you look at gEximon, you will see the message looks a little different.
20:20:45 102Dpx-0009t-4p => myname@hotmail.com R=smarthost T=remote_smtp_smarthost H=smtpout.where.secureserver.net 20:20:45 102Din-0009t-4p Completed
This means the email was sent successfully via our smtp_smarthost!
And that concludes this tutorial!
As I’ve said before, I’m not very sharp when it comes to email servers and unfortunately I’ve spent way more time than I care to. My hope is this is my LAST time of having to re-visit Exim4 unless I just get bored and decide to explore other options with it.
If you are savvy with it, PLEASE contact me and I’ll gladly work with someone to write some more simple tutorials that takes all the complicated mess out of it.
I think the single most difficult thing I’ve ever encountered to set up is some sort of email on a personal web server that allowed me to send email with my PHP scripts.
I’ve encountered countless tutorials online for sendmail and all of the others that just left me with a non-working install and still unable to send email from my web server.
When hosting your own website, email notification from your PHP scripts is crucial.
So hopefully this tutorial finally buries the hatchet and all the countless hours you’ve wasted trying to configure email on your server for your scripts.
The scope of this tutorial:
I want to first clarify what I’m covering so I don’t waste your time.
This tutorial is only for configuring/installing exim4 on a Ubuntu machine so that you can send emails from PHP. I am not going to go into sending emails via email clients or any other usage such as recieving emails with Exim4.
Those are all beyond the scope of this tutorial and beyond my knowledge and understanding.
So just to be clear, this tutorial is to show you How to use Exim4 to send email with PHP via the mail() function.
** UPDATE ** – 4/14/2010
I’ve re-visited exim4 recently and I’ve created an alternate configuration tutorial based off of this one. I HIGHLY recommend you checking it out after you finish this one and get this working.
Exim4 – Stopping All Local Emails From Being Sent Via SMTP!
Installation/Setup/Configuration
I’ve formed this tutorial by basically combining two different tutorials:
http://blog.edseek.com/~jasonb/articles/exim4_courier/exim4.html and
http://www.howtoforge.com/exim-authenticated-smarthost.
I must also note I’m not setting this up to use TLS or SSL, so you should be warned about security risks doing it this way. You might want to refer to the second link for more info, but I don’t know because I haven’t tried.
Installation
You can either use the Synaptic Package Manager if you’re using the actual Ubuntu machine’s desktop or you can use the Terminal (Command Line Interface) to install exim4.
Here’s what using the CLI would look like:
sudo apt-get update sudo apt-get install exim4
This will install exim4-base, exim4-config, and exim4-daemon-light.
Configure
Next you need to configure Exim4.
In your command line, type this:
dpkg-reconfigure exim4-config
This will bring a configuration screen up in the CLI to configure it with.
Your first option will be to choose from the following:
internet site; mail is sent and received directly using SMTP mail sent by smarthost; received via SMTP or fetchmail mail sent by smarthost; no local mail local delivery only; not on a network no configuration at this time
Since I’m running my server on a server with a dynamic IP, I had to use smarthost.
Also, since I’m only concerned with sending emails from PHP, the option mail sent by smarthost; no local mail was the option I used. The other options are beyond the scope of this tutorial.
The next option is the Server mail name:
Here you should specify your domain name as the example there states. Also note, your emails will be sent from whatever user is logged in, so you may need to setup an account for that user with your SMTP provider.
Note about the SMTP server:
The SMTP server is usually provided by your ISP(Internet Service Provider). By relaying your emails to a SMTP server, your emails won’t get rejected by the receiving email server.
You can use another SMTP server such as email hosting through Godaddy.com.
Basically, you will be setting it up like you would an email client such as Outlook. There will be more on this later.
So if you’re logged in as Joe, your emails will be sent by joe@yourdomain.com. I think there’s a way to send it via another name, but I won’t go into that and leave you to search google for the answer.
Ok, so now that we’ve entered our domain.com for the System mail name, we need to tell Exim SMTP listener daemon what IPs to listen on. I honestly don’t think this really applies for the configuration we’re doing, but we’ll go ahead and specify them anyways.
Here’s the two I specified for my setup, my server’s internal IP and it’s LAN IP that all traffic get’s routed to by router. There’s no need to specify your public IP since your router sends everything to your LAN IP.
127.0.0.1; 192.168.1.154
For the next screen, I just left the default value there, which was my server pc’s name.
Just to clarify, this is the value for Other destinations for which mail is accepted:
If I understand it, this also is for incoming email and we’re not interested in that nor setting that up. We’re focused on out-going email only.
I was next prompted for Visible domain name for local users:, which I entered the same value as I did earlier, mydomain.com.
IP address or host name of the outgoing smarthost:
This is important to get this right. It will be something like smtp.mail.com or whatever your smtp outgoing mail server is with your ISP.
With Godaddy, it’s something like smtpout.secureserver.net.
Domains to relay mail for:
I really wasn’t sure about this, so I just used * for the value here.
Machines to relay mail for:
I believe this is all the local IP’s for machines you want to be able to send email through the server with. I’d say there’s two options here, either just enter the local IP address for your server or specify the range of IP’s for all computers on your network. Since we’re only using it to send email via PHP from our server, only your server’s IP needs to be entered here.
In my example above, I would enter 192.168.1.154.
Keep number of DNS-queries minimal (Dial-on-Demand)?
From what I read, this applies to dial-up connections. I simply chose No.
Split configuration into small files?
Since it was more stable to choose No, I chose No.
After that, it will leave the configuration and restart the MTA. You will probably see an alert message like this:
ALERT: exim panic log /var/log/exim4/paniclog has non-zero size, mail system possibly broken
I think that was from an error before and it’s irrellevant unless you need to refer to it for ongoing problems.
Almost done!
Next, at your CLI, type:
sudo nano /etc/exim4/passwd.client
Add this line at the bottom of it:
*:userlogin:userpassword
Replace userlogin with the login name for your SMTP server and userpassword with your login password.
Save that file and close it.
Next, type this:
sudo touch /etc/exim4/exim4.conf.localmacros
Then this:
sudo nano /etc/exim4/exim4.conf.localmacros
And add this line, then save and close it:
AUTH_CLIENT_ALLOW_NOTLS_PASSWORDS = 1
This is a security risk! It will send your email password unencrypted!
Now that I’ve stated that, you can refer to the second tutorial on how to send it securely, but my focus is to make it work, not secure it. Just beware if you’re copying me on this.
Now finally, type the following:
sudo /etc/init.d/exim4 restart
Configure PHP to use Exim4 for sending emails via mail()
The last thing we have to do is edit our php.ini settings to use Exim4 for sending emails.
In Ubuntu, the php.ini file will most likely be located here:
/etc/php5/apache2/php.ini
To edit it, type:
sudo nano /etc/php5/apache2/php.ini
Search for sendmail_path, which was located on line 671 in mine. You want to set it to:
sendmail_path = /usr/sbin/exim4 -t
Save and close it.
Now restart your apache server, which should be this command:
sudo apache2ctl restart
You’re done!
Oh, but you probably want to send a test email to make sure we did everything right, correct? Well, let’s do that then.
How To Send A Test Email With Exim4
Here’s how you can send a test email with both the CLI(command line interface) and with a simple PHP mail() function.
How To Send Test Email From CLI in Exim4
From your command line, type the following command:
echo "my test" | mail -s "test Message" recipient@email.com
Of course replace recipient@email.com with a valid email address.
You can also just specify a user in place of the email and it will send it to the domain you specified earlier as your qualified domain name.
How To Send Test Email Using PHP mail() in Exim4
Here’s the php syntax to send a test email. You MUST have PHP installed with Apache.
<?php $email_to = 'someone@email.com'; $subject = 'Test Email'; $msg = 'You successfully recieved this test email!'; $header = 'From: me@myserver.com'; mail($email_to, $subject, $msg, $header); ?>
Now run the script and your recipient email should recieve a test email if nothing failed.
Be sure to check your JunkMail folder too since it may be filtered as possible spam by your email provider.
How to monitor Exim4 transactions
This probably should’ve been mentioned at the beginning of the test.
Open up a terminal window and type the following:
tail -f /var/log/exim4/mainlog
Now when you send an email, you will see this update giving you a status.
What to do if you get errors or it doesn’t work
This is where it goes beyond my ability to help. Here’s a few things I can suggest you look into if you’re having issues.
- Does your ISP block port 25?
Some ISP’s block it and your SMTP service may offer alternative ports. Do some checking into that if you think port 25 could be your issue. - Are you SURE your SMTP server information is correct?
A wrong SMTP server address will mess things up for sure. Verify the username/password details too. You can re-run the configuration without any problems if you need to make adjustments to the settings.
Beyond that, I really don’t have any advise. If you do have issues and solve them, please please post them in the comments below to help others out. So many times before a user’s comments helped me when the post itself didn’t.
Conclusion
I hope this finally solves your nightmare with trying to set up sendmail/email sending on your server as it did for me. I really wish I knew more and understood it better so I could go more in-depth with configuring email servers on personal web servers, but I just don’t. There’s a huge lack of good information that works out there on doing just that and that’s my reason for posting this.
If anyone reading this is savvy with email and servers, please contact me so I can ask some questions and pass the info on to others to help them out.
A little while back, I began doing some research on how to create my own URL shortening service that uses a mysql database to store/retrieve the new URLs and automatically redirect the visitor to the correct URL.
The problem I encountered was they were all very complicated and difficult to understand examples that I found.
Well, since then I’ve managed to learn regular expressions and I’ve also discovered sqlite (A flat-file database). So I decided to see if I could make my own very simple redirect service using what I know with PHP and here’s what I’ve managed to accomplish.
The files:
This script consists of 3 files to work:
- index.php – This is the primary file that contains all of the logic and code that makes it all work.
It has the form and php code that processes the requests. - .htaccess – This file is very important for the script to work correctly. It contains the rewrite conditions for the urls and MUST be present for the re-directs to work correctly.
- db.sqlite – This file will be created if it doesn’t exist. This is the sqlite database file where all the data is stored. It should be set to read/write permissions by the server, which usually is the group www-data.
The table needs to be created by index.php when first setting it up. Refer to the notes in the index.php code for more info.
How it works:
The way this script works is by utilizing Apache’s mod_rewrite function to determine if the url is a request and if so, it retrieves the url from the sqlite database and sends 301 (permanent redirect) headers to the user’s browser and takes them to the correct URL.
In order for the code to match, the shortened URL MUST not contain any characters that aren’t numbers or letters. Otherwise it will not forward the user and instead try to locate the actual file locally.
Example:
http://mydomain.com/ade45612rt/ or http://mydomain.com/ade45612rt will work.
http://mydomain.com/ade45612rt.html will not since it has the period in it.
It will instead try to locate the actual file ade45612rt.html on the server.
The rewrite code in the .htaccess file matches the first example, then performs a GET request on the database to find the actual URL matching the value ade45612rt and sending that in the redirect header.
You may also specify a custom url if you do not wish for the script to auto-generate a 10-character string automatically.
The custom url may contain “_” or ” -” for spacing . If you enter empty spaces in it, it will be replaced with underscores “_” automatically.
Here’s the code:
.htaccess file
RewriteEngine on RewriteBase /rewrite/ RewriteRule ^([A-Za-z0-9-_]+)/?$ index.php?value=$1
index.php file
<?php
/* The Base URL this script is running from. This script won't work otherwise! */
$base_url = 'http://mydomain.com/rewrite/';
/*
* The SQLite Database - If it doesn't exist, it will be created.
* The database file MUST be readable/writable by the server or else it will fail.
* "db.sqlite" is the database filename that will be created.
*/
$db = new SQLiteDatabase("db.sqlite");
// Create Database Table //
// Uncomment the lines below by removing both "/*" and "*/" to create the table neccessary for storing the values for this script.
// Only run it once. You will get an error if you run it more than once.
/*
$db->query("BEGIN;
CREATE TABLE urls(id INTEGER PRIMARY KEY, value VARCHAR NOT NULL, url VARCHAR NOT NULL);
COMMIT;");
echo 'Table Created Successfully!';
*/
if(isset($_GET)) {
// Processes the URL request when the generated URL is requested and re-direct them accordingly.
if(!empty($_GET['value'])) {
$sql = "SELECT url FROM urls WHERE value='$_GET[value]'";
$result = $db->query($sql);
$value = $result->current();
header("HTTP/1.1 301 Moved Permanently");
header("Location: $value[url]");
}
// Retrieves all url re-directs //
if(!empty($_GET['urls']) && $_GET['urls'] == 'all') {
$sql = "SELECT * FROM urls";
$result = $db->query($sql);
while ($result->valid()) {
$items[] = $result->current();
$result->next();
}
}
}
/* /// Random String Generator /// - This is for randomly generating a value for the URL if a custom one isn't specified.
A unique string cannot be guaranteed, so code to either check existing values or using a unique key such as time
should be added to ensure no duplicates are added. */
function genRandomString() {
$length = 10;
$characters = "0123456789abcdefghijklmnopqrstuvwxyz";
$string = null;
for ($p = 0; $p < $length; $p++) {
$string .= $characters[mt_rand(0, strlen($characters))];
}
return $string;
}
// Process New URL Form //
if(isset($_POST) && !empty($_POST['url2'])) {
// If custom_url is empty, use a generated string instead. //
if(empty($_POST['custom_url'])) {
$string = genRandomString();
}
else {
$string = $_POST['custom_url'];
$string = preg_replace('/ /', '_', $string);
}
// Add URL to database. //
$sql = "INSERT INTO urls(url, value) VALUES ('$_POST[url2]', '$string')";
$result = $db->query($sql);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
label {
display: inline-block;
width: 150px;
}
table {
font-size: 12px;
}
-->
</style>
</head>
<body>
<form action="index.php" method="post" name="url">
<p>
<label for="url2">URL:</label>
<input type="text" name="url2" id="url" />
</p>
<p>
<label for="custom_url">CUSTOM URL:</label>
<input type="text" name="custom_url" id="custom_url" />
</p>
<p>
<input type="submit" name="submit" id="submit" value="Submit" />
</p>
</form>
<p>
<a href="index.php?urls=all">View All URLS</a>
</p>
<?php if(isset($_POST) && !empty($string) && $result != false) {
// Display the new URL if it was successfully added.
// Otherwise this message will not show.
echo 'Your new URL is <a href="'.$base_url.$string.'">'.$base_url.$string.'</a>';
}
if(isset($items) && !empty($items)) {
// Display all of the current re-directs in a table. //
?>
<table width="600" border="1">
<tr>
<td width="300" align="center"><strong>URL</strong></td>
<td width="300" align="center"><strong>ACTUAL URL</strong></td>
</tr>
<?php foreach($items as $item): ?>
<tr>
<td align="center">
<?php echo '<a href="'.$base_url.$item['value'].'">'.$base_url.$item['value']; ?></a>
</td>
<td align="center">
<?php echo '<a href="'.$item['url'].'">'.$item['url']; ?></a>
</td>
</tr>
<?php endforeach; }?>
</table>
</body>
</html>
Known Issues & Requirements
This script isn’t really written for production/public use. It is written for basic function only.
So what does this mean? DON’T USE IT ON A PUBLIC SERVER AS-IS!!!!
- The script is not password-protected, which means anyone can access the form and create a URL from your site. This can pose as a problem since spam could also be used.
It also allows anyone to see all of the posts in your database. - This will ONLY work on Apache servers with mod_rewrite enabled. Some Apache servers may not have this enabled and this won’t work at all on IIS servers.
- sqlite module must be installed for PHP. The code could easily be changed to mysql if sqlite isn’t available on your server.
- There’s no filter for incorrect custom urls, meaning something that detects if they’ve entered “.html” or “.php” in the custom url field. Since it won’t work if any special characters are added, it should be filtered and then alert the user if it’s incorrect.
Otherwise the rewrite condition in the .htaccess should be modified to accommodate special characters. - There’s nothing checking that the randomly generated string is a duplicate or not, meaning that duplicate entries are possible.
I suggest adding date/time to the function to ensure that it is a unique value or else check the generated string against any current entries.
Bottom line is this is a very simple script that should work fine if all the conditions are met. If you build on it, please share your ideas and any improvements you’ve managed to make to it.
Hey everyone,
There hasn’t been much activity on this site in a while since I’m busy developing my own scripts and other various tasks, but I’ve got big plans for this site in the (hopefully) near future.
I was having a discussion with a MSN chat friend and he told me about a forum that doesn’t use a MySQL database and runs off of files only. I’ve known of the concept of using text files to store data, although it’s very complex, but I never have seen a project as large as a forum utilizing this until now.
Welcome to Myupb!
Myupb is an open-source project free to download and use and provides a pretty sophisticated discussion forum you can add on your site and doesn’t require a database. They have a demo, http://forum.myupb.com/, where you can see it in action.
Their primary site is at http://www.myupb.com/.
I’ve done a lot of searching for a good light-weight CMS program that is very easy to use and easy to customize and let me introduce you all to Concrete 5. I am very impressed with this one compared to any of the others I have used in the past, although add-ons are limited and they aren’t all free.
But as far as a very usable framework to build websites on, I really don’t think you can beat Concrete 5.
Words don’t really do it justice, so I’ll just link you to it and let you see for yourself. They have an IRC channel, #concrete5 on the freenode server if you need it.
Here’s the trial, but you have to signup for a trial account:
http://www.concrete5.org/about/trial
You can get started using concrete by downloading it and then watching their excellent screencasts:
http://www.concrete5.org/help/editing/login-incontext-editing/
Today I went out shopping for an external 1TB hard drive since I’ve simply ran out of storage space on my PC. While doing a little price comparing at my local Best Buy, I stumbled across this nifty looking device for about $30 more than the rest of the 1TB drives. I apparently didn’t pay a whole lot of attention, because I didn’t realize it’s not designed to be directly connected to a PC via USB.
But what did catch my attention is it has a Ethernet Port on the back and I thought that was a really neat feature to have in addition for only a little more price wise.
I read on the box that I could also connect to it via FTP and that was REALLY intruiging and sold me on it. When I got to the register, it rang up for $200, which was way more than what I was expecting and more than what I wanted to spend. The cashier did a price check and said it was actually only $10 more than what I thought it was, which ended up coming out to $139. I ended up going ahead and buying it and when I got home, I hooked it up and checked it out.
As I went through the configuration menu, I started noticing it had a TON of features. https access, ftp connection, and even DocuWiki pre-installed on it. I couldn’t believe it! It had a web server software built-in with PHP and a FTP server!
The features are down right awesome and I couldn’t believe they were being sold for only $140!! So I did a search online and found out the actual going price for them is $229, NOT $140 and I had gotten a GREAT deal on this one! But it didn’t stop there.
I did a lot of searching and unfortunately I couldn’t find anything that gave any information on the server software and the wiki files aren’t accessible, even though there is a wiki folder. Apparently this thing is still really new and not enough hackers/programmers have started to dig into it and figure out how to customize it.
My thinking was it would be awesome to put my own website on it and have it serve as my basic web server. But there’s nothing indicating how to even begin doing this and I’m thinking it’s all in the firmware.
So for now, I’m hoping someone will unlock this mystery and really unleash the possibilities of this little device. It has some of the best features I’ve ever seen for a NAS drive and VERY affordable, even at it’s normal price.
Hey everyone,
I know it’s been a while since I’ve added anything to this site and it’s because I’ve got several projects I’ve been busy with and it hasn’t left me with much time to mess with this site.
I thank you all for your continued feedback!
I got to wondering something earlier . . . What do you all use the information you get from this website for? Do you start hosting your own websites from the servers? Do you use it for development?
If you’re hosting your own sites, would you care to share?
I think it’d be pretty cool to create a list of websites that are hosted on personal web servers, so if you feel like sharing, leave a comment below and I’ll create a list of everyone’s contributions.
I personally use to host about 5 different websites on my personal web server, a couple of them were for friends and then I had all kinds of different ideas of my own. As a matter of fact, this website use to be hosted on it for several months.
But when I lost my internet connection, I moved it all over to paid hosting with Godaddy for better reliability and so it didn’t depend on my server/connection. I also have a testing server that costs me $10/year and then my personal server I use for my own personal use and script development now. It IS public, but I don’t always keep it online and it doesn’t really have anything useful to anyone else but myself on it.
Anyways, tell me what you all think. . .














