Dec 26

Fixing “Authentication is needed to run /usr/bin/dropbox as the super user” error in Linux

Following is a screenshot of the problem. 

Screenshot on

Screenshot on “Authentication is needed to run /usr/bin/dropbox as the super use”

Fixing this problem is easy. Find where your dropbox executable is using the following command.

 Bash |  copy code |? 
1
which dropbox

In my case it is /bin/dropbox. Open the file as root using a text editor. Then find the following lines.

 Python |  copy code |? 
1
PARENT_DIR = os.path.expanduser("/var/lib/dropbox")
2
DROPBOXD_PATH = "%s/.dropbox-dist/dropboxd" % PARENT_DIR

You’ll notice that DROPBOXD_PATH is incorrect due to PARENT_DIR pointing to an invalid dropbox installation location. Now all you have to is to point PARENT_DIR to the correct place. Since my dropbox installation is in ~/.dropbox-dist/ and I am the only user in the system using dropbox, I edited the entry as follows. Edit the entry as it suits for you.

 Python |  copy code |? 
1
PARENT_DIR = os.path.expanduser("~")

Now save the file and try running the dropbox start -i using your user account (not root). It will work without any problems.

Share Button
Dec 23

A Comprehensive Guide To Run Yii Framework On XAMPP In Linux

Yii is professional PHP framework best for developing Web 2.0 applications. This guide elaborates on how to set up the Yii framework in XAMPP under a Linux environment.

First you need to download and install XAMPP as indicated in the XAMPP guide in http://www.apachefriends.org/en/xampp-linux.html. Then you need to get write permissions to the /opt/lampp/htdocs folder (where all the websites will be stored). First look at who is owning /opt/lampp/htdocs .

 Bash |  copy code |? 
1
ls -ld /opt/lampp/htdocs

This should return something like

 Bash |  copy code |? 
1
drwxr-xr-x. 5 root root 4096 Dec 22 22:55 /opt/lampp/htdocs

drwxr-xr-x. denotes the file permissions of the folder. The part root root specifies the owner of the directory and the owning group of the directory. Let’s first change the owning group of the folder. Let’s create a group called www and change the group ownership of the folder to www.

 Bash |  copy code |? 
1
sudo groupadd www
2
sudo chgrp -R www /opt/lampp/htdocs

Now a ls -ld should return something like the following

 Bash |  copy code |? 
1
drwxr-xr-x. 5 root www 4096 Dec 22 22:55 /opt/lampp/htdocs

Now the XAMPP server should be configured to run using the group www. Open the /opt/lampp/etc/httpd.conf file.

 Bash |  copy code |? 
1
sudo vim /opt/lampp/etc/httpd.conf

Then find the entry,

 Bash |  copy code |? 
1
User daemon
2
Group daemon

(yours might be slightly different). Change the User entry to your user name and Group entry to www. Now you need to set the permissions of the /opt/lampp/htdocs folder.

 Bash |  copy code |? 
1
sudo chmod 2775 /opt/lampp/htdocs
2
usermod -aG www <username>

You’ll need to logout and log in to the system since group memberships are read at login time. But before doing that, let’s carry out another task that will require a logout. We need to add PHP to our PATH. So open your .bashrc as follows.

 Bash |  copy code |? 
1
vim /home/<username>/.bashrc

Then add the following lines to the end of that file.

 Bash |  copy code |? 
1
##Adds XAMPP bin to PATH
2
export PATH=/opt/lampp/bin:$PATH

Now logout and login. Then extract the Yii framework to a folder named yii in the /opt/lampp/htdocs folder, start the XAMPP server and go to the address http://localhost/yii/requirements/index.php to check whether Yii is working. Then to create a Yii application, follow the following commands. I have used the test name blog.

 Bash |  copy code |? 
1
cd /opt/lampp/htdocs/
2
php ./yii/framework/yiic webapp blog

After completing the creation, visit http://localhost/blog/ to verify the functionality of the created Yii application…!.

References :

  1. http://superuser.com/questions/268987/cant-create-any-folder-in-htdocs-on-ubuntu
  2. http://stackoverflow.com/questions/14318699/xampp-virtual-host-access-denied
  3. http://www.yiiframework.com/forum/index.php/topic/1838-install-yii-on-xampp-on-linux/page__p__10296__hl__yii+linux+in+tallation#entry10296
  4. http://www.yiiframework.com/doc/blog/1.1/en/start.testdrive
Share Button
Jun 08

How to install zeromq (0MQ) in Ubuntu with Java bindings

403 Forbidden

Forbidden

You don't have permission to access /devformatter/branches/langs/autoconf.php on this server.


Apache Server at svn.wp-plugins.org Port 80
403 Forbidden

Forbidden

You don't have permission to access /devformatter/branches/langs/autoconf.php on this server.


Apache Server at svn.wp-plugins.org Port 80
403 Forbidden

Forbidden

You don't have permission to access /devformatter/branches/langs/autoconf.php on this server.


Apache Server at svn.wp-plugins.org Port 80
403 Forbidden

Forbidden

You don't have permission to access /devformatter/branches/langs/autoconf.php on this server.


Apache Server at svn.wp-plugins.org Port 80
403 Forbidden

Forbidden

You don't have permission to access /devformatter/branches/langs/autoconf.php on this server.


Apache Server at svn.wp-plugins.org Port 80
403 Forbidden

Forbidden

You don't have permission to access /devformatter/branches/langs/autoconf.php on this server.


Apache Server at svn.wp-plugins.org Port 80
403 Forbidden

Forbidden

You don't have permission to access /devformatter/branches/langs/autoconf.php on this server.


Apache Server at svn.wp-plugins.org Port 80
403 Forbidden

Forbidden

You don't have permission to access /devformatter/branches/langs/autoconf.php on this server.


Apache Server at svn.wp-plugins.org Port 80
403 Forbidden

Forbidden

You don't have permission to access /devformatter/branches/langs/autoconf.php on this server.


Apache Server at svn.wp-plugins.org Port 80
403 Forbidden

Forbidden

You don't have permission to access /devformatter/branches/langs/autoconf.php on this server.


Apache Server at svn.wp-plugins.org Port 80
403 Forbidden

Forbidden

You don't have permission to access /devformatter/branches/langs/autoconf.php on this server.


Apache Server at svn.wp-plugins.org Port 80
403 Forbidden

Forbidden

You don't have permission to access /devformatter/branches/langs/autoconf.php on this server.


Apache Server at svn.wp-plugins.org Port 80
403 Forbidden

Forbidden

You don't have permission to access /devformatter/branches/langs/autoconf.php on this server.


Apache Server at svn.wp-plugins.org Port 80

I tested this in Ubuntu 13.04, but essentially this should work in any Ubuntu distribution. First install the libtool, autoconf, automake, uuid-dev, e2fsprogs packages.

  |  copy code |? 
1
sudo apt-get install libtool autoconf automake uuid-dev e2fsprogs

Then clone the 0mq source using,

  |  copy code |? 
1
git clone git://github.com/zeromq/libzmq.git

Then go in to the libzmq directory and run the following commands in order.

  |  copy code |? 
1
./autogen.sh
2
./configure
3
make
4
sudo make install
5
ldconfig -v

Then run the following command and check the output.

  |  copy code |? 
1
ls -al /usr/local/lib/libzmq.*

The output should be similar to,

  |  copy code |? 
1
-rw-r--r-- 1 root root 7082022 ජූනි 7 14:16 /usr/local/lib/libzmq.a
2
-rwxr-xr-x 1 root root 947 ජූනි 7 14:16 /usr/local/lib/libzmq.la
3
lrwxrwxrwx 1 root root 15 ජූනි 7 14:16 /usr/local/lib/libzmq.so -> libzmq.so.3.0.0
4
lrwxrwxrwx 1 root root 15 ජූනි 7 14:16 /usr/local/lib/libzmq.so.3 -> libzmq.so.3.0.0
5
-rwxr-xr-x 1 root root 2876918 ජූනි 7 14:16 /usr/local/lib/libzmq.so.3.0.0

Now you should install the Java bindings for 0mq (in order to use omq from Java of course!). First check whether the JAVA_HOME environment variable is correctly set using,

  |  copy code |? 
1
echo $JAVA_HOME

This should output the location that you have installed Java. If it’s giving an empty output, then set it manually using

  |  copy code |? 
1
export JAVA_HOME=/<!--DVFMTSC-->location/to/your/java/installation<!--DVFMTSC-->
2

In my case the command is,

export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_17

Then clone the java bindings for 0mq using,

  |  copy code |? 
1
git clone https://github.com/zeromq/jzmq.git

now go inside the jzmq folder. Now same as before, run the following commands in order.

  |  copy code |? 
1
./autogen.sh
2
./configure
3
make
4
sudo make install

Now run the following command to verify the installation.

  |  copy code |? 
1
ls -al /usr/local/lib/*jzmq* /usr/local/share/java/*zmq*

The output should be like the following.

  |  copy code |? 
1
-rw-r--r-- 1 root root 535266 ජූනි 7 14:40 /usr/local/lib/libjzmq.a
2
-rwxr-xr-x 1 root root 998 ජූනි 7 14:40 /usr/local/lib/libjzmq.la
3
lrwxrwxrwx 1 root root 16 ජූනි 7 14:40 /usr/local/lib/libjzmq.so -> libjzmq.so.0.0.0
4
lrwxrwxrwx 1 root root 16 ජූනි 7 14:40 /usr/local/lib/libjzmq.so.0 -> libjzmq.so.0.0.0
5
-rwxr-xr-x 1 root root 242784 ජූනි 7 14:40 /usr/local/lib/libjzmq.so.0.0.0
6
-rw-r--r-- 1 root root 40618 ජූනි 7 14:40 /usr/local/share/java/zmq.jar

Notice the last line, that’s the newly created jar that connects to 0mq. Now you can use 0mq inside a Java programme.

Troubleshooting

If you get any of the following errors (which I got) when building the jar, export the mentioned system variables in the terminal to resolve them.

error

checking for javah… no

configure: error: cannot find javah

solution

  |  copy code |? 
1
export JAVAH=/<!--DVFMTSC-->location/to/your/java/installation/bin/javah

ex – export JAVAH=/usr/lib/jvm/jdk1.7.0_17/bin/javah

error

checking for jar… no

configure: error: cannot find jar

solution

  |  copy code |? 
1
export JAR=/location/to/your/java/installation/bin/jar
2

ex – export JAR=/usr/lib/jvm/jdk1.7.0_17/bin/jar

(Most of the content of this guide is based up on https://github.com/mslinn/zeromq-demo#ubuntu )

Share Button