Monthly Archives: July 2012

XAMPP – Apache service not working on Windows Xp

I’ve been installing XAMPP on Windows 7 for 2 to 3 times, which is always a simple install and Apache/PHP works fine. However, yesterday with the 1.8.0 version, I get the same problem on two Windows XP machines, here is what I downloaded:

It installed successfully without any errors:

MySQL works fine, but when I hit the “Start” button to start Apache it says “Running” and then it stops running again in like 2/3 secs:

I had tried every possible way to free the port 80. For example, Disabled option that “Use port 80” in Skype and Teamviewer as well. But, still no luck:

The solution to this problem is really simple, just download and install Microsoft Visual C++ 2008 SP1 Redistributable Package (x86):

Then hit the “Start” button to start Apache:

Type http://localhost/ and hit Enter, this time it will present you with the xampp default web page:

Hope this will help you!

Please Remember me in your prayers!

Enjoy 🙂

Advertisements

Configure the DHCP server dynamically update the DNS records on Ubuntu 12.04LTS

 This tutorial is based on Ubuntu 12.04 LTS, in which I will try to show you that how to configure the DHCP server automatically update the DNS records, when it assigns a new lease to a client on local network. We will use the below network diagram as a base for this tutorial:

Before Starting this tutorial:

Before starting this tutorial, you can check my other tutorials to learn that, how i configure DHCP server and Gateway:

Ubuntu as a firewall/gateway router

How to Install the DHCP Server on Ubuntu 12.04LTS

Network Configuration for the Ubuntu Gateway:

Configure the DNS:

Install the DNS (bind9) using this command:

sudo apt-get install bind9 dnsutils

Also edit the hosts settings so that the server will be able to accepts the DNS requests. Here is an example of my server’s host file:

cat /etc/hosts

Move to the bind directory:

cd /etc/bind/

Next, we need to configure the forwards for bind, I am using Google’s DNS servers as an example:

sudo nano named.conf.options

forwarders {
 8.8.8.8;
 8.8.4.4;
 };

Now we create a secret key that will be shared between the DHCP server and the DNS:

sudo dnssec-keygen -r /dev/urandom -a HMAC-MD5 -b 128 -n USER DHCP_UPDATER

Show the generated key:

sudo cat Kdhcp_updater.*.private|grep Key

Edit the named.conf.local file in /etc/bind/ directory:

sudo nano named.conf.local

Define the locations of the forward and reverse zone files as well as the secret shared key here:

Move to the /var/lib/bind/ directory:

cd /var/lib/bind/

Create the forward zone file for your doamin:

sudo nano tendo.local.db

Replace the tendo.local with your domain name. Here’s an example of my forward zone file:

$ORIGIN .
$TTL 907200 ; 1 week 3 days 12 hours
tendo.local IN SOA dnssrv.tendo.local. arbab.tendo.local. (
                   2012071707 ; serial
                   10800 ; refresh (3 hours)
                   3600 ; retry (1 hour)
                   604800 ; expire (1 week)
                   38400 ; minimum (10 hours 40 minutes)
                   )
                   NS dnssrv.tendo.local.
                   A 172.16.10.1
$ORIGIN tendo.local.
dhcpsrv            A 172.16.10.2
dnssrv             A 172.16.10.1
gateway            A 172.16.10.254

Every time you make the changes to the zone file, you need to change the serial before reloading the bind.

Next, create the reverse zone file for your doamin:

sudo nano 10.16.172.rev

Here is my reverse zone file, replace the hosts and domain name with your own that match with the forward zone file just created above:

$ORIGIN .
$TTL 907200 ; 1 week 3 days 12 hours
10.16.172.in-addr.arpa IN SOA dnssrv.tendo.local. arbab.tendo.local. (
                       2012071706 ; serial
                       10800 ; refresh (3 hours)
                       3600 ; retry (1 hour)
                       604800 ; expire (1 week)
                       38400 ; minimum (10 hours 40 minutes)
                       )
                       NS dnssrv.tendo.local.
$ORIGIN 10.16.172.in-addr.arpa.
1                      PTR dnssrv.tendo.local.
2                      PTR dhcpsrv.tendo.local.
254                    PTR gateway.tendo.local.

Restart the bind service:

sudo /etc/init.d/bind9 restart

Configure the DHCP server to send updates to the DNS:
sudo nano /etc/dhcp/dhcpd.conf

Add the secret key that we created on our dns server in the dhcpd.conf file and other option, some of the main configurations are mentioned below:

For given subnet, we need to define the zones and within the zones, we need to tell the DHCP server which key to use to update the DNS server:

Here is a DHCP scope that will be used to assign the IP configuration to the clients:

Restart the dhcp service:

sudo /etc/init.d/isc-dhcp-server restart

Once again, restart the bind service on DNS server:

sudo /etc/init.d/bind9 restart

Check the log messages on both dns and dhcp servers:
sudo tail -f /var/log/syslog

DHCP server successfully add the client to the forward and reverse zone.

DNS server accept the secret key and update it’s forward and reverse zone.

Verification on dhcp client:

Enjoy 🙂

Troubleshooting:

I found some really nice troubleshooting steps regarding dhcp and dns server here (Thanks to original author):

  • error: zone [zone-name]/IN: NS ‘[dns-server-hostname]‘ has no address records (A or AAAA)
    You’ll probably encounter this if you forget to provide records for your DNS server in your zone files; e.g. [dns-server-name] IN A [dns-server-ip-address]
  • error: [some-zone-file]: create: permission denied
    Check to make sure that permissions on the given file are correct. Configuration files must be readable by the bind user, and zone/journal files must be writable by the bind user.
  • updating zone ‘[zone-name]/IN’: error: journal open failed: unexpected error
    It is possible that Ubuntu’s AppArmor is getting in the way of the zone updates. Make sure you check /var/log/syslog for related messages. Also check the AppArmor configuration at /etc/apparmor.d/usr.sbin.named.
  • error: zone [zone-name]/IN: [some-hostname]/A: bad owner name (check-names)
    The hostname that a client is requesting is invalid for use in a FQDN. Change the client’s hostname.
  • error: zone [zone-name]/IN: journal rollforward failed: journal out of sync with zone
    The zone journal file has gotten out of sync with the zone file (usually occurs with forced restarts, or modifying the zone file while BIND9 is running). Delete the .jnl file (in/var/lib/bind), and restart BIND9.

Hope this will help you!

Please Remember me in your prayers!

Internet Connection Sharing on Ubuntu through Wireless

Yesterday, I tried to share the Internet connection from my laptop to iPhone through wireless and it’s really simple. These are the steps that I follow on my laptop that has Ubuntu 12.04 LTS:

Click on the “Network Manager” icon and from there,select “Create New Wireless Network…”:

Enter the details,according to your desire for this new “ad-hoc” network:

Note: For the WEP 40/128-bit Key option, you key has to be exactly 5/10/13 characters long.

Laptop will automatically connect to this new network we have just created:

Click on the “Network Manager” icon again and select “Edit Connections…”:

Select the “ad-hoc” connection that we created above and click on Edit button:

 Verify that the “Connect automatically” check-box is selected:

On the IPv4 Settings tab verify that the Method option is set to “Shared to other computers”:

Check the IP address for eth1(wireless):

Configuring the iPhone:

Hope this will help you!

Please Remember me in your prayers!

Changing the MOTD in Ubuntu Server

Ubuntu server display a message everytime,when users log in at the terminal, this message is known as MOTD (the message of the day). Ubuntu Server generates this message automatically from a collection of scripts and motd contains the user’s last login time, the system version and information about available software updates.

Sometime, we don’t want to show all these informaitons to the login user and want to show customize message. To do this, we have to follow these steps.

First,we need to edit /etc/motd.tail file:

sudo nano /etc/motd.tail

Here is mine custom MOTD that I want to show to the users after login:

 ######################################
 # If you are not authorized to access#
 # or use this system, disconnect now #
 ######################################

Move to this directory:

cd /etc/update-motd.d

In order to disable all the unwanted information, we need to disable the execution of these scripts:

sudo chmod -x 00-header
sudo chmod -x 50-landscape-sysinfo
sudo chmod -x 10-help-text
sudo chmod -x 90-updates-available

Now, when we login to our Ubuntu Server, it will show us the MOTD that we just configured above:

Enjoy 🙂

Extra Info:

If you want that your server didn’t show MOTD at all after login, then just do this:

sudo dpkg-reconfigure landscape-common

Select “Do not display sysinfo on login”

Hope this will help you!

Please Remember me in your prayers!

How to install Ptcl eVo on Ubuntu 12.04 LTS

Plug the eVo 3G modem and then click on the Network Manager and select Edit Connections:

Move to the Mobile Broadband tab and click on Add:

Select the 3G device and click Continue:

Select Pakistan from Next Screen and press Continue:

Select Ptcl EVO from provider screen and press Continue:

Click Apply:

In the new Window, Enter:

Username: vwireless@ptcl.com
Password: ptcl

Click  Close:

In order to connect,click on Network Manager icon in Taskbar and then select the newly created connection:

After a successful connection, It will look like this:

Troubleshooting:

If you are facing a problem that your computer doesn’t recognize the 3G device then install this:

sudo apt-get install usb-modeswitch usb-modeswitch-data

Hope this will help you!

Please Remember me in your prayers!

How to fix Wireless Card on Ubuntu

I have a Dell inspiron 1564 laptop, the wireless device itself is Dell Wireless WLAN 1520 Half MiniCard, it is integrated in the laptop. The driver is installed and under windows the device works perfectly fine. I recently installed Ubuntu 10.04 LTS on it, when I select the connections in the upper bar in Ubuntu,it shows both the wired and wireless, though the wireless is gray and unclickable (that says “device not ready”).

To fix this problem,I followed this procedure.

Install rfkill:

sudo apt-get install rfkill

Enter the following command to unblock all the wireless devices:

rfkill unblock all

After these commands,wireless will work instantly, I hope. But sometime the network-manager state get corrupted. To fix this problem, open the NetworkManager.state:

sudo nano /var/lib/NetworkManager/NetworkManager.state

It will look something like this:

Change any from ‘false‘ to ‘true‘ to re-enable networking:

Then restart the laptop:

sudo reboot

To check the wireless card status, issue this command:

rfkill list

No means that the wireless device is working perfectly.Now, connect to the wireless network:

Hope this will help you!

Please Remember me in your prayers!

Enjoy 🙂

%d bloggers like this: