Linux: March 2008 Archives
This is another one of those "I know this, but I can never remember how" type things.
I'm currently reconfiguring a machine on the other side of the globe, so I want to get it to work to IST instead of EST.
A quick google brought up a rather complex way of doing it which sounded really wrong to me, so I refined my query and found the sane solution in the Ubuntu documentation.
Simply run the following command as root (or using "su"):
dpkg-reconfigure tzdata
And just follow the instructions.
No silly reboots or other craziness required.
To keep your server's time in sync with the rest of civilisation setup a cronjob to poll an ntp server once every 24 hours:
/usr/sbin/ntpdate yourfavouritentpserveraddress
Problem solved :)
I'm currently reconfiguring a machine on the other side of the globe, so I want to get it to work to IST instead of EST.
A quick google brought up a rather complex way of doing it which sounded really wrong to me, so I refined my query and found the sane solution in the Ubuntu documentation.
Simply run the following command as root (or using "su"):
dpkg-reconfigure tzdata
And just follow the instructions.
No silly reboots or other craziness required.
To keep your server's time in sync with the rest of civilisation setup a cronjob to poll an ntp server once every 24 hours:
/usr/sbin/ntpdate yourfavouritentpserveraddress
Problem solved :)
Until yesterday evening I had never had any reason to configure multiple services on the same port, so I'd never had any reason to delve into the configuration changes to make this happen.
In order to get this working you have to have more than one IP address available.
In my case I have 3 assigned to the server in question. The main IP is used for serving most of the sites, while I had one assigned to it for running a particular service.
Up until now Apache was happily listening on all IP addresses / interfaces so the Apache configuration directives were quite simple. Simple is always best, so long as it works. The more complicated you make it the more likely you are to run into issues.
In the original Apache config I was using virtual hosts that relied more on DNS than apache to decide what was being served:
<VirtualHost *:80>
The "*" means that it is listening on all IP addresses / interfaces for connections.
Moving a service to a specific IP means that the configuration has to be changed to avoid conflicts, so all the Apache VirtualHosts need to be told which IP to use:
<VirtualHost xxx.xxx.xxx.xxx:80>
where you replace the "xxx" with the IP you are using.
In my innocence I presumed that this would fix everything up, but I hadn't counted on one small but important thing. Apache was configured at a higher level to listen to ALL Ips and interfaces.
The Listen directive is now required, as I'm using the latest available version of Apache for my OS:
The one which dictates which ports to use and which IPs those ports are assigned to is aptly named ports.conf
The default setting is:
To force it to only use a couple of your IPs you need to explicitly tell it which ones to use:
With that final change made I was able to get both servers up and running on the same machine using the same port, but different IPs.
Now if only I could get the service to work the way I wanted it to I'd be happy
In order to get this working you have to have more than one IP address available.
In my case I have 3 assigned to the server in question. The main IP is used for serving most of the sites, while I had one assigned to it for running a particular service.
Up until now Apache was happily listening on all IP addresses / interfaces so the Apache configuration directives were quite simple. Simple is always best, so long as it works. The more complicated you make it the more likely you are to run into issues.
In the original Apache config I was using virtual hosts that relied more on DNS than apache to decide what was being served:
<VirtualHost *:80>
The "*" means that it is listening on all IP addresses / interfaces for connections.
Moving a service to a specific IP means that the configuration has to be changed to avoid conflicts, so all the Apache VirtualHosts need to be told which IP to use:
<VirtualHost xxx.xxx.xxx.xxx:80>
where you replace the "xxx" with the IP you are using.
In my innocence I presumed that this would fix everything up, but I hadn't counted on one small but important thing. Apache was configured at a higher level to listen to ALL Ips and interfaces.
The Listen directive is now required, as I'm using the latest available version of Apache for my OS:
The Listen directive instructs Apache to listen to only specific IP addresses or ports; by default it responds to requests on all IP interfaces. Listen is now a required directive. If it is not in the config file, the server will fail to start. This is a change from previous versions of Apache.On Ubuntu (and probably Debian, though I can only guess) Apache's configuration files are split up into manageable chunks which reside in /etc/apache2
The Listen directive tells the server to accept incoming requests on the specified port or address-and-port combination. If only a port number is specified, the server listens to the given port on all interfaces. If an IP address is given as well as a port, the server will listen on the given port and interface.
Multiple Listen directives may be used to specify a number of addresses and ports to listen to. The server will respond to requests from any of the listed addresses and ports.
The one which dictates which ports to use and which IPs those ports are assigned to is aptly named ports.conf
The default setting is:
Listen 80As no IP address is specified the server will listen to any available.
<IfModule mod_ssl.c>
Listen 443
</IfModule>
To force it to only use a couple of your IPs you need to explicitly tell it which ones to use:
Listen xx.xx.xxx.xxx:80You can add IPv4 or IPv6 addresses in with ease.
Listen xx.xx.xxx.xxx:80
<IfModule mod_ssl.c>
Listen 443
</IfModule>
With that final change made I was able to get both servers up and running on the same machine using the same port, but different IPs.
Now if only I could get the service to work the way I wanted it to I'd be happy
I downloaded a copy of Firefox 3 (beta) for linux earlier this evening to see how it was. I've been having very annoying issues with Firefox 2 on Ubuntu locking up randomly, so I was hoping to see if the new version would help.
Unfortunately there isn't an official Ubuntu release as yet, but you can easily use the standard download for linux.
I'm trying desperately to be impressed and find something to "wow" about, but so far it's left me completely underwhelmed.
If anything its "enhancements" are simply annoying.
They're mostly aesthetic and may simply be a case of them being different to what I'm used to.
As you start typing in an address into the toolbar it tries to "suggest" addresses from your "history" but in so doing it takes up loads of screen estate and invariably gets it wrong.
Of course it's a beta release, so you'd have to be really dumb to expect it to work properly! Beta software is meant to have bugs. Ideally they should be squashed before the software is made available to the general public.
Whether I'll keep playing around with this version or revert to the older one is something I'm not 100% sure about just yet.. We'll see
Unfortunately there isn't an official Ubuntu release as yet, but you can easily use the standard download for linux.
I'm trying desperately to be impressed and find something to "wow" about, but so far it's left me completely underwhelmed.
If anything its "enhancements" are simply annoying.
They're mostly aesthetic and may simply be a case of them being different to what I'm used to.
As you start typing in an address into the toolbar it tries to "suggest" addresses from your "history" but in so doing it takes up loads of screen estate and invariably gets it wrong.
Of course it's a beta release, so you'd have to be really dumb to expect it to work properly! Beta software is meant to have bugs. Ideally they should be squashed before the software is made available to the general public.
Whether I'll keep playing around with this version or revert to the older one is something I'm not 100% sure about just yet.. We'll see

