Long
time since I put anything here.
Just start with a fun one then I will do some serious stuff
This is a place for me to put random thoughts and bit's and pieces that I find interesting.
Wednesday, 29 September 2021
Monday, 12 October 2015
IIS7 and Apache on the same server
Ok so you want both IIS and Apache on the same machine. The problem is that IIS is rather greedy and takes up any IP addresses that you have on the machine so that Apache can not have a lock on any IP address, even if you specify IP's in the IIS management console. If you type in netstat -an and you see 0.0.0.0:80 it means that IIS has got hole of everything.
1) Added or make sure your machine has two ip’s
2) Open a command prompt
3) Type netsh
4) Type http
5) Type sho iplisten. It should be blank6) Type add iplisten ipaddress=192.168.0.90
You should get IP address successfully added7) Type sho iplisten again
It should sho 192.168.0.90 in the list8) Type exit to get out of netsh
9) Type type netstat -an. See if you notice 192.168.0.90:80 in the list. If you see 0.0.0.0:80, do an iisreset
10) Download and install Apache (actually I installed Xamp)
11) Do a default install,
12) Open httpd.conf and adjust the ip listen to 192.168.0.91:80
2) Open a command prompt
3) Type netsh
4) Type http
5) Type sho iplisten. It should be blank6) Type add iplisten ipaddress=192.168.0.90
You should get IP address successfully added7) Type sho iplisten again
It should sho 192.168.0.90 in the list8) Type exit to get out of netsh
9) Type type netstat -an. See if you notice 192.168.0.90:80 in the list. If you see 0.0.0.0:80, do an iisreset
10) Download and install Apache (actually I installed Xamp)
11) Do a default install,
12) Open httpd.conf and adjust the ip listen to 192.168.0.91:80
# Listen: Allows you to bind Apache to specific IP addresses and/or# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
#Listen 12.34.56.78:80
#Was 80
#Change to
Listen 192.168.0.91:80
12) Restart the Apache service.
13) Type netstat -an
14) You should see 192.168.0.90:80 and 192.168.0.91:80. Open a browser and test both IP’s to see if IIS7 and Apache come up.
15) Reboot the server to see if it works after that.
16) Turn off Apache, browse IIS, turn of IIS, browse Apache. Test it every which way to see if it works.
13) Type netstat -an
14) You should see 192.168.0.90:80 and 192.168.0.91:80. Open a browser and test both IP’s to see if IIS7 and Apache come up.
15) Reboot the server to see if it works after that.
16) Turn off Apache, browse IIS, turn of IIS, browse Apache. Test it every which way to see if it works.
I got this from http://iislogs.com/steveschofield/2007/07/07/iis7-post-44-iis7-and-apache-on-the-same-machine/ and I am repeating it here so I know where to find it in the future.
Why Dogs Never Die!
Dogs never die.
They don't know how to. They get tired, and very old, and their bones hurt. Of course they don't die.
If they did they would not want to always go for a walk, even long after their old bones say "No, nor not a good idea. Let’s not go for a walk." Nope, dogs always want to go for a walk. They might take one step before their aging tendons collapse them into a heap on the floor, but that’s what dogs are. They walk.
They don't know how to. They get tired, and very old, and their bones hurt. Of course they don't die.
If they did they would not want to always go for a walk, even long after their old bones say "No, nor not a good idea. Let’s not go for a walk." Nope, dogs always want to go for a walk. They might take one step before their aging tendons collapse them into a heap on the floor, but that’s what dogs are. They walk.
It’s not that they dislike your company. On the contrary, a
walk with you is all there is. Their boss, and the cacophonous symphony of odour
that the world is. Cat poop, another dog's mark, a rotting chicken bone (exultation),
and you. That’s what makes their world perfect, and in a perfect world death
has no place.
However, dogs get very very sleepy. That’s the thing, you
see. They don't teach you that at the fancy university where they explain about
quarks, gluttons, and Keynesian economics. They know so much they forget that
dogs never die. It’s a shame, really. Dogs have so much to offer and people just
talk a lot.
When you think your dog has died, it has just fallen asleep
in your heart. And by the way, it is wagging its tail madly, you see, and that’s
why your chest hurts so much and you cry all the time.
Who would not cry with a happy dog wagging its tail in their chest?
Ouch! Wap wap wap wap wap, that hurts. But they only wag when they wake up. That’s when they say "Thanks Boss! Thanks for a warm place to sleep and always next to your heart, the best place.”
When they first fall asleep, they wake up all the time, and
that’s why, of course, you cry all the time. Wap, wap, wap. After a while they
sleep more (remember, a dog while is not a human while. You take your dog for
walk; it’s a day full of adventure in an hour. Then you come home and its a
week, well one of your days, but a week, really, before the dog gets another
walk. No WONDER they love walks.)
Anyway, like I was saying they fall asleep In your heart,
and when they wake up, they wag their tall. After a few dog years, they sleep
for longer naps, and you would too.
They were a GOOD DOG all their life, and you both know lt.
It gets tiring being a good dog all the time, particularly when you get old and
your bones hurt and you fall on your face and don't want to go outside to pee
when it is raining but do anyway, because you are a good dog.
So understand, after they have been sleeping in your heart,
they will sleep longer and longer. But don't get fooled. They are not "dead."
There's no such thing, really. They are sleeping in your heart, and they will
wake up usually when you're not expecting it. Is just who they are.
I feel sorry for people who don't have dogs sleeping in
their heart. You've missed so much. Excuse me I have to go cry now.
I don't know where or when I found it but it is so good that I had to repeat it.
I don't know where or when I found it but it is so good that I had to repeat it.
Sunday, 29 June 2014
Moving cPanel CentOSVHm on Hyper-V
Sometimes for one reason or another you just can not move VM's from one host to another.Moving the virtual machine from one host to another is just one one of the many advantages of the virtual environment over the physical.
So here is a quick list of the steps that I have needed to take when copying a CentOS install from one host to another.
So here is a quick list of the steps that I have needed to take when copying a CentOS install from one host to another.
- Create the new virtual machine.
- Save file permissions
- Rename the VHD (just in case)
- Copy the VHD.
- Set file permissions.
- Change the Network configuration
- Create the new virtual host and make is as identical as the one that you want to copy from Full text
- use icacls [Server].vhd /save file.perm to save the permissions Full text
- rename the VHD (just incase) Full text
- Copy the VHD from the old host to the new host. Full text
- use icacls D:\hyper-v\BlueMidget /restore file.perm to set the permissions of the new file. Full text
- boot up the VHD Full text
- Change the MAC address of the network card(s) to match the new server nano /etc/sysconfig/network-scripts/ifcfg-eth0
nano /etc/sysconfig/network
Saturday, 28 June 2014
Breast Cancer Awareness
Have you seen some (more) silly status on Facebook reciently. Well it is the latest Breast Cancer Awareness campaign.
You will see one of the following status reports.
- Dang diarrhea!
- Just used my boobs to get out of a speeding ticket
- Anyone have a tampon? I'm out.
- How do you get rid of foot fungus?
- Why is nobody around when I'm horny?
- No toilet paper goodbye socks!
- Someone offered me a job as a prostitute but I'm hesitant.
- I think I'm in love with someone what should I do?
- I've decided 2 stop wearing underwear.
- It's confirmed.. I'm going to be a daddy/mommy.
- I really don't know how 2 tell anyone and I'm sick of hiding it I'm gay.
- Guess it was 2 good 2 b true I'm pregnant.
- Just won $1900 on a scratch card
- I've just found out I've been cheated on for the past 5 months.
If you are female then they will contact you getting you to put one of the above status on Facebook.
Friday, 28 December 2012
Telecommuters Work Longer Hours than Office Goers
When someone says “telecommuting,” do you picture yourself
easing into the workday in a pair of fuzzy slippers? Does your boss think the
same?
The reality is, far from this. Because a new study shows that folks who work at home at least some of the time put in more hours than those who stay at the office.
Telecommuting for a portion of the work week certain has its appeal.
Researchers took advantage of labor information from census bureau surveys and were surprised by what they found. First off, the proportion of people who work remotely remained unchanged from the mid-’90s to the mid-2000s the most recent data available. Second, those who do telecommute are more likely to work overtime, an additional 5 to 7 hours on top of the standard 40.
This means that people who work from the comfort of home are not slackers in slippers.
They’re more likely tech-savvy self-starters—who don’t know when to stop.
That’s according to work published in the journal MonthlyLabor Review. [Mary C. Noonan and Jennifer L. Glass, The hard truth about telecommuting]
The reality is, far from this. Because a new study shows that folks who work at home at least some of the time put in more hours than those who stay at the office.
Telecommuting for a portion of the work week certain has its appeal.
- Avoiding the time and cost involved in commuting
- Having a more flexible schedule
- A better work-life balance
Researchers took advantage of labor information from census bureau surveys and were surprised by what they found. First off, the proportion of people who work remotely remained unchanged from the mid-’90s to the mid-2000s the most recent data available. Second, those who do telecommute are more likely to work overtime, an additional 5 to 7 hours on top of the standard 40.
This means that people who work from the comfort of home are not slackers in slippers.
They’re more likely tech-savvy self-starters—who don’t know when to stop.
That’s according to work published in the journal MonthlyLabor Review. [Mary C. Noonan and Jennifer L. Glass, The hard truth about telecommuting]
Monday, 17 December 2012
Correcting Unix Clock Drift on Hyper-V
I recently had a problem where my CentOS 5 virtual machine running on Hyper-V on Server 2008 R2 was gaining time quite dramatically.
Initially, I turned off "Time synchronization" in the Integration Services section of the Hyper-V settings for the CentOS virtual machine. This did help a bit, but it was still far to inaccurate and too much for NTP to correct.
After a bit of Googling, here is what I did to correct the clock inaccuracy problem:
Modify the kernel boot options by editing [/boot/grub/grub.conf] and adding the line "divider=10 clocksource=acpi_pm" (for 32-bit) or "notsc divider=10" (for 64-bit) after the appropriate kernel line, as below.
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/hda5
# initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-308.20.1.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-308.20.1.el5 ro root=LABEL=/ selinux=0 notsc divider=10
initrd /initrd-2.6.18-308.20.1.el5.img
title CentOS (2.6.18-274.17.1.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-274.17.1.el5 ro root=LABEL=/ selinux=0
initrd /initrd-2.6.18-274.17.1.el5.img
Now to configure NTP, you might need to install it first with yum install ntp
The following is the [/etc/ntp.conf]. Note that you should normally change 0.centos.pool.ntp.org to something specific to your country, for example, 0.uk.pool.ntp.org, and the same for the other ntp servers here, and in [/etc/ntp/step-tickers] in below. See www.pool.ntp.org/en for more information on the NTP pool and which servers you should use.
tinker panic 0
restrict 127.0.0.1
restrict default kod nomodify notrap
server 0.uk.pool.ntp.org
server 1.uk.pool.ntp.org
server 2.uk.pool.ntp.org
server 3.uk.pool.ntp.org
# Dont use local clock
#server 127.127.1.0 # local clock
#fudge 127.127.1.0 stratum 10
# Drift file.
driftfile /var/lib/ntp/drift
# Key file containing the keys and key identifiers used when operating
# with symmetric key cryptography.
keys /etc/ntp/keys
# Specify the key identifiers which are trusted.
#trustedkey 4 8 42
# Specify the key identifier to use with the ntpdc utility.
#requestkey 8
# Specify the key identifier to use with the ntpq utility.
#controlkey 8
The conf directive "tinker panic 0" instructs NTP not to give up if it sees a large jump in time. This is important for coping with large time drifts and also resuming virtual machines from their suspended state. The directive "tinker panic 0" must be at the top of the ntp.conf file.
It is also important not to use the local clock as a time source, often referred to as the Undisciplined Local Clock. NTP has a tendency to fall back to this in preference to the remote servers when there is a large amount of time drift.
An example of such a configuration is:
server 127.127.1.0
fudge 127.127.1.0 stratum 10
Comment out both lines.
Now for the step tinker file. This is to get the time to synk up at a reboot and not rely on the hardware. So add / edit the file [/etc/ntp/step-tickers]:
0.uk.pool.ntp.org
1.uk.pool.ntp.org
2.uk.pool.ntp.org
3.uk.pool.ntp.org
Now everything is ready for the CentOS to look after it's self we just need to set the time correctly.
If you want to get the time closer set the time with the date command:
e.g. for 18th December 2012 at 10:00 am use
Just to add on a windows 2008 server use
Initially, I turned off "Time synchronization" in the Integration Services section of the Hyper-V settings for the CentOS virtual machine. This did help a bit, but it was still far to inaccurate and too much for NTP to correct.
After a bit of Googling, here is what I did to correct the clock inaccuracy problem:
Modify the kernel boot options by editing [/boot/grub/grub.conf] and adding the line "divider=10 clocksource=acpi_pm" (for 32-bit) or "notsc divider=10" (for 64-bit) after the appropriate kernel line, as below.
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/hda5
# initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-308.20.1.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-308.20.1.el5 ro root=LABEL=/ selinux=0 notsc divider=10
initrd /initrd-2.6.18-308.20.1.el5.img
title CentOS (2.6.18-274.17.1.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-274.17.1.el5 ro root=LABEL=/ selinux=0
initrd /initrd-2.6.18-274.17.1.el5.img
Now to configure NTP, you might need to install it first with yum install ntp
The following is the [/etc/ntp.conf]. Note that you should normally change 0.centos.pool.ntp.org to something specific to your country, for example, 0.uk.pool.ntp.org, and the same for the other ntp servers here, and in [/etc/ntp/step-tickers] in below. See www.pool.ntp.org/en for more information on the NTP pool and which servers you should use.
tinker panic 0
restrict 127.0.0.1
restrict default kod nomodify notrap
server 0.uk.pool.ntp.org
server 1.uk.pool.ntp.org
server 2.uk.pool.ntp.org
server 3.uk.pool.ntp.org
# Dont use local clock
#server 127.127.1.0 # local clock
#fudge 127.127.1.0 stratum 10
# Drift file.
driftfile /var/lib/ntp/drift
# Key file containing the keys and key identifiers used when operating
# with symmetric key cryptography.
keys /etc/ntp/keys
# Specify the key identifiers which are trusted.
#trustedkey 4 8 42
# Specify the key identifier to use with the ntpdc utility.
#requestkey 8
# Specify the key identifier to use with the ntpq utility.
#controlkey 8
The conf directive "tinker panic 0" instructs NTP not to give up if it sees a large jump in time. This is important for coping with large time drifts and also resuming virtual machines from their suspended state. The directive "tinker panic 0" must be at the top of the ntp.conf file.
It is also important not to use the local clock as a time source, often referred to as the Undisciplined Local Clock. NTP has a tendency to fall back to this in preference to the remote servers when there is a large amount of time drift.
An example of such a configuration is:
server 127.127.1.0
fudge 127.127.1.0 stratum 10
Comment out both lines.
Now for the step tinker file. This is to get the time to synk up at a reboot and not rely on the hardware. So add / edit the file [/etc/ntp/step-tickers]:
0.uk.pool.ntp.org
1.uk.pool.ntp.org
2.uk.pool.ntp.org
3.uk.pool.ntp.org
Now everything is ready for the CentOS to look after it's self we just need to set the time correctly.
If you want to get the time closer set the time with the date command:
e.g. for 18th December 2012 at 10:00 am use
date 1218100012
This will stop ntp getting in a flap when the time is a long way off , and makes the correction quicker.
Then set the synchronise the time manually:
ntpd -qSet the hardware clock to the newly synchronised time:
hwclock --systohcSet up ntpd to automatically run and synchronise the time, as below:
chkconfig ntpd onNow reboot the server and everything should be OK.
Just to add on a windows 2008 server use
w32tm /config /syncfromflags:manual /manualpeerlist:0.pool.ntp.org,1.pool.ntp.org,2.pool.ntp.org,3.pool.ntp.orgto get it to check the time and
w32tm /config /update
w32tm /resync
w32tm /stripchart /computer:time.windows.com /samples:3 /dataonlyto check the time
Subscribe to:
Posts (Atom)
