Auto start Sphinx searchd after reboot on Linux
By default, after you install and configure Sphinx, you will find that once your OS restarts, search will not be working. That is because searchd is not setup to auto start. The following will solve that problem.
Create file /etc/init.d/searchd.
sudo vi /etc/init.d/searchd
Copy the following into searchd.
#!/bin/bash
case "${1:-''}" in
'start')
/usr/local/bin/searchd
;;
'stop')
/usr/local/bin/searchd --stop
;;
'restart')
/usr/local/bin/searchd --stop && /usr/local/bin/searchd
;;
*)
echo "Usage: $SELF start|stop|restart"
exit 1
;;
esac
Add execute to the file
sudo chmod -x /etc/init.d/searchd
Register with auto start
sudo update-rc.d searchd defaults
Replacing OpenGeo Suites on Windows with GeoServer on Linux
After our initial installation of OpenGeo Suites for WMS service on Windows, we encountered some stability issues that could not be resolved. We could have hired some high priced consultants to debug the issue but we opted for a lighter weight infrastructure.
Our initial system specs:
- Windows Server 2008
- 4GB ram
- Quad core
- Open Geo Suites running as Windows application
Our slim and fast system specs:
- Ubuntu 10.04
- 512MB ram
- Quad core
- GeoServer running as java process
So far so good. All layers are loading super fast. We will see how the stability issue is resolved. At least we are using a lot few resources now which makes scaling out to a cluster of GeoServers much more affordable.
Running stored procedures on MSSQL via any language on Linux
If you need to run store procedures on Microsoft SQL Server on perl, php, ruby, etc., you need to configure /etc/freetds/freetds.conf with the server connection information. Specifically, specify the tds version to be 8.0. Something like the following.
/etc/freetds/freetds.conf
[Server80]
host = domain.com
port = 1433
tds version = 8.0
Connection to the server via php would look like this.
$link = mssql_connect("Server80", "user", "pass");
Scaling down from MS to open source
We just moved a service that was running on the Microsoft stack (Windows Server 2008, .NET, MSSql Server, IIS) to an open source stack (Ubuntu Server, php, Codeigniter framework, apache2, postgres).
We now run the service on a cloud server with dual cpu and 256MB ram (Yes, that's megabytes).
The old server ran on dual core with 2GB of ram.
A four letter word can ruin your day
halt + Amazon EC2 + Instance Store = A bad day
I did a stupid thing while on vacation. Decided to clone an EC2 server and executed halt from commandline without checking to see if the server was using Instance Store. Whoops, Amazon showed the server as terminating...terminated... ahhhhh.
After having to rebuild the server while on vacation, I have learned a valuable lesson.
sendmail[2525]: My unqualified host name (servername) unknown
If you see these messages in your syslog, your sendmail is not configured correctly with the domain name. If you are sending from a fully qualified domain, add it to the local-host-names file. In Ubuntu, it would be /etc/mail/local-host-names. Make sure it reads something like this.
localhost
[domain.com]
[server name]
Now in the /etc/hosts, make sure it reads the following.
127.0.0.1 [domain.com] [server name] localhost
...
Then
sudo /etc/init.d/sendmail restart
and the error should not continue filling the syslog.
Changing Mysql data directory require change to AppArmor
After a bit of googling and hair-pulling, I realized that if I just changed the datadir directive in my.cnf will cause mysql start to fail on Ubuntu. The other thing is to add permissions to apparmor for mysql to access the new data directories.
Steps
1. sudo vi /etc/apparmor.d/usr.sbin.mysqld
2. Add
/newdir/ r,
/newdir/** rwk,
3. sudo /etc/init.d/apparmor restart
4. sudo /etc/init.d/mysql restart
If that still does not work, check the nix permissions to be sure mysql is owner and group for the new directory recursively.
chown -R mysql:mysql “new datadir path”
Ubuntu 9.10 Karmic slow Firefox
There is a bug in the IPv6 lookup in Karmic that is making any application requesting IPv6 while a NAT is not configured to respond to IPv6 respond very slowly. It is still a bug not solved at this time. Buta solution for Firefox is given here as a work around for now.
VMware Server must be reconfigured when there is a kernel upgrade
If the linux kernel is upgraded, vmware will not load http://localhost:8222. It requires a reconfigure when this happens. Do the following.
sudo /usr/bin/vmware-config.pl
Forget your mysql root password?
This following line saved my butt when something happened and my root password was no longer working.
sudo dpkg-reconfigure mysql-server-5.0
It will allow you to reset your root password without messing with the data or any other configuration in my.cnf.