Tuesday, May 11, 2010

SOLVED: Http 500 error caused by .htaccess in CMS Ubuntu

A recent move of my server from a public server to a self hosted server in Ubuntu had turned into a problem solving challenge.  I had build a new Ubuntu server with webmin as a hosting manager.  A current live version of Joomla was moved over to this server, and all of a sudden the SEF stopped working.  I am currently a user of SH404 with JoomFish, and everything worked before.  Now I got 500 error even in the admin screen.  I made sure the naming convention is right, .htaccess was typed correctly.  The main error was that by default apache does not turn on mod_rewrite, to do that in a Ubuntu or Redhat server all you have to do is type

sudo a2enmod rewrite
 
and restart the apache server by typing 

sudo /etc/init.d/apache2 restart

This should fix all those errors when migration a CMS to a new Ubuntu server.

Enjoy

Monday, May 10, 2010

How to load MYSQL Database from Command Line in Linux and XAMPP

To load a Mysql file from the command line to a certain database you can use the following command


mysql -u root -p joomla < backup.mysql


This works in linux environment where joomla is your database name.  Best to be in the same directory as the mysql file and you can load it without typing the path to the file.


If you are hosting in your own Xampp in Windows, there is also a way to load your mysql file from the command line, in my example I would assume that you have installed Xampp in 


c:\Xampp,


 thus the directory for mysqld would be


c:\Xampp\mysql\bin


then if you put your mysql file in the same directory, you can load it directory from that directory if you haven't had your path set.  Type


mysql --user root --password joomla < backup.mysql


It will prompt you for a password then your mysql will be loaded depending on how big your backup is. you could add a -f flag if your database is very big, it will prevent it from stopping if there is error. 


mysql -f --user root joomla < backup.mysql


Enjoy

Monday, May 03, 2010

How to connect to Tomato VPN in Windows 7 and Vista

I have recently upgrade my main laptop from XP to windows 7, I was updating my Tomato OpenVPN setup as well.  My recent blog entry shows instructions on how to setup OpenVPN server from the tomato router.  A lot has changed since then.  For me now it's Windows 7 and OpenVPN windows installer now comes with a GUI, you don't have to install it yourself.  The installation went well, however after I set everything up and I tried to connect I got this error message.


The requested operation requires elevation.

ERROR: Windows route add command failed [adaptive]: system() returned 



I can connect to my server, however I can't add the route to my Tomato router, therefore my traffic does not route through the Tomato VPN server.  


For those who are experiencing the same error, I found it on requires a simple fix.  First you have to configure the GUI such that it works with your ovpn and your static.key file.  Instead of using the connect.ovpn file from anywhere, you can connect by using the GUI which came with the installer.  The trick is to run the GUI as administrator, this can fix this error and I can connect to the VPN server.  


One trick is to run OpenVPN as a service and run as administrator, you can also make your computer connect automatically each time you logon.