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
Oct 07

Using dCharts in Vaadin 7

I wanted a decent charting library to use in one of my FOSS projects which was created using Vaadin 7.1.2. Since Vaadin charts, the default choice for that purpose under Vaadin 7 needs a license to use it, I  switched my attention towards dCharts (https://vaadin.com/directory#addon/dcharts-widget). So I added the following maven dependency which is listed in the Vaadin site to my project and built it.

 XML |  copy code |? 
1
<dependency>
2
   <groupId>org.vaadin.addons</groupId>
3
   <artifactId>dcharts-widget</artifactId>
4
   <version>1.7.0</version>
5
</dependency>

But when I ran the project in the application server, I got the following error.

12:27:18,947 WARN [org.jboss.as.server.deployment] (MSC service thread 1-6) Class Path entry vaadin-server-7.0.7.jar in "/content/ui-0.1.war/WEB-INF/lib/dcharts-widget-1.7.0.jar" does not point to a valid jar for a Class-Path reference.

 12:27:18,951 WARN [org.jboss.as.server.deployment] (MSC service thread 1-6) Class Path entry vaadin-shared-7.0.7.jar in "/content/ui-0.1.war/WEB-INF/lib/dcharts-widget-1.7.0.jar" does not point to a valid jar for a Class-Path reference.

 12:27:18,957 WARN [org.jboss.as.server.deployment] (MSC service thread 1-6) Class Path entry vaadin-theme-compiler-7.0.7.jar in "/content/ui-0.1.war/WEB-INF/lib/dcharts-widget-1.7.0.jar" does not point to a valid jar for a Class-Path reference.

 12:27:18,961 WARN [org.jboss.as.server.deployment] (MSC service thread 1-6) Class Path entry vaadin-client-compiled-7.0.7.jar in "/content/ui-0.1.war/WEB-INF/lib/dcharts-widget-1.7.0.jar" does not point to a valid jar for a Class-Path reference.

 12:27:18,963 WARN [org.jboss.as.server.deployment] (MSC service thread 1-6) Class Path entry vaadin-themes-7.0.7.jar in "/content/ui-0.1.war/WEB-INF/lib/dcharts-widget-1.7.0.jar" does not point to a valid jar for a Class-Path reference.

 12:27:18,965 WARN [org.jboss.as.server.deployment] (MSC service thread 1-6) Class Path entry commons-lang3-3.1.jar in "/content/ui-0.1.war/WEB-INF/lib/dcharts-widget-1.7.0.jar" does not point to a valid jar for a Class-Path reference.

 12:27:18,966 WARN [org.jboss.as.server.deployment] (MSC service thread 1-6) Class Path entry commons-codec-1.7.jar in "/content/ui-0.1.war/WEB-INF/lib/dcharts-widget-1.7.0.jar" does not point to a valid jar for a Class-Path reference.

Looking at the error, it was evident that dCharts was looking at the wrong set of jars. So here’s what I did to overcome this problem.

First of all, checkout the dCharts code from http://source.dussan.org/dcharts . Then change the com.vaadin.vaadin value in the pom to 7.1.2 . Then rebuild the dCharts projects (mvn clean install).

Now open your Vaadin project. Go to the place in the pom where you added your dCharts dependency and replace it with the following.

 XML |  copy code |? 
1
<dependency>
2
            <groupId>org.dussan.vaadin</groupId>
3
            <artifactId>dcharts</artifactId>
4
            <version>1.7.0</version>
5
        </dependency>
6

Now rebuild your Vaadin project (mvn clean install). Everything should work fine!.

p.s –

Don’t forget to add your chart to the UI using addComponent() method to make the chart visible!.

Share Button