Thursday, September 5, 2013

You need to start XAMPP as root! [SOLVED]

Hi All,

It is hard to start XAMPP for normal users. XAMPP only start by root user. Here I have given the steps to create XAMPP Control Panel.

By using that XAMPP Control Panel normal user can start the XAMPP.

Steps :

1. Open terminal and login as root user using the root password.
     $ su root

2. Now create xampp-control-panel folder under /usr/local/
    # mkdir /usr/local/xampp-control-panel

3. Now create one script file under the xampp-control-panel folder named as xampp-control-panel.sh
    # vi /usr/local/xampp-control-panel/xampp-control-panel.sh
      [ copy and paste the below two lines in that script file ]
      #/bin/sh
      sudo /opt/lampp/share/xampp-control-panel/xampp-control-panel

4. Now save that file by pressing esc :wq

5. Give 755 permission to that script file.
    # chmod 755 /usr/local/xampp-control-panel/xampp-control-panel.sh

6. Create desktop file named as xampp.desktop under /usr/share/applications/
    # vi /usr/share/applications/xampp.desktop
      [ copy and paste the below lines in the xampp.desktop file ]
      [Desktop Entry]
      Encoding=UTF-8
      Name=Start/Stop XAMPP
      Comment=Launch XAMPP Control Panel
      Exec=/usr/local/xampp-control-panel/xampp-control-panel.sh
      Terminal=true
      Type=Application
      Icon=/opt/lampp/htdocs/favicon.ico
      Categories=Development;
      MimeType=application/xampp;

7. Now save the file by pressing esc :wq

8. Edit /etc/sudoers file to allow the users to start the xampp control panel alone without asking password.
   # vi /etc/sudoers
    [ In that file you can see the line root    ALL=(ALL)    ALL. Just add the below line next to that line ]
    
     username     ALL=NOPASSWD: /opt/lampp/share/xampp-control-panel/xampp-control-panel

9. Replace the username by actual username which you want to give access. If you don't know the username just type cd /home/ as root user in terminal and type ls command. It shows all the usernames which you have created in that system.

10. Now save the file by pressing esc :wq

11. Now XAMPP Control Panel appeared under Development section or Programming section in your system.

Friday, August 9, 2013

How to install MongoDB in XAMPP in Linux?

Hi,

Use the below steps to install MongoDB in XAMPP in Linux OS.


Install MongoDB in XAMPP in Linux.

Steps :

1. Download and install XAMPP devel package first. If you installed XAMPP in /opt folder then use the below command or You can replace /opt/ to the path where you installed XAMPP.

# tar xvfz xampp-linux-devel-1.x.x.tar.gz -C /opt/

2. Then install autoconf, automake and gcc if it is not installed in your system.

# yum install autoconf automake gcc -y

3. Then use the below command to install mongodb extension in xampp

# /opt/lampp/bin/pecl install mongo

4. Then edit php.ini file in xampp and add the mongo.so extension

# vi /opt/lampp/etc/php.ini

extension="mongo.so"

:wq

5. Now restart the xampp using the below command.

# /opt/lampp/lampp restart

6. Now use the below command to install mongo and run the mongo service.

# yum --disablerepo=* --enablerepo=fedora,updates install mongodb mongodb-server
# service mongod start
# chkconfig mongod on

Thursday, August 1, 2013

bash: autojump_add_to_database: command not found

Linux terminal shows the below error when .bashrc file does not exist in user's home folder.

Somebody may delete the .bashrc file unknowingly.

Error : bash: autojump_add_to_database: command not found

To solve this issue.

1. Open terminal.
2. $ vi .bashrc
3. Copy and Paste the below script


# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

# User specific aliases and functions

4. Save the file.
5. Now that bash error gets vanished.

If it is not work then you can copy the contents of .bashrc file from another user in that same system and paste it in user who faced this issue.

Script to shutdown all Linux machines in network

Use the below shell script to shutdown all Linux systems in LAN.

This shell script will be useful for system admins.


#!/bin/sh
read -p "Do you want to shutdown all systems? (y/n)" OUT
if [ "$OUT" = "y" ] || [ "$OUT" = "Y" ]; then
sys_ip="11 12 13"
for i in $sys_ip; do
if ping -c 1 "192.168.2.$i">/dev/null 2>&1; then
ssh root@192.168.2.$i init 0
else
echo "192.168.2.$i system is already down"
fi
done
elif [ "$OUT" = "n" ] || [ "$OUT" = "N" ]; then
 echo "Okay. No problem. You can shutdown it later."
else
 echo "You have entered wrong character. Enter only y or n."
fi

Saturday, January 5, 2013

HTTP Status 417 Error

Sometimes your applications shows "HTTP Status 417 Error".
The reason is Http use the “Expect: 100- continue” Header.
Firewall or proxy blocks this header when you use those applications.
If you are using squid enabled proxy or firewall, do the below steps to enable this header in proxy.
1. Open Terminal
2. Type the below steps in terminal
  • Login as root user ( By type "su root" command in terminal. Give root password then press enter)
  • vi /etc/squid/squid.conf ( To edit the squid.conf file )
  • If you don't know the location of squid.conf file type the below command in terminal.
  • "find / -name squid.conf ". It will show the location of squid.conf file. Then do the second step to edit the squid.conf file.
  • Add this line " ignore_expect_100 on " in squid.conf file.
  • Then Press esc :wq then press enter ( To save and quit the file )
  • Then restart the service using the below command
  • service squid restart (or)
  • /etc/init.d/squid restart
3. Now your application works fine

Cannot Open dndlog.conf file

In Vmware Workstation, sometimes the dndlog.conf file will be deleted automatically.
The reason for deletion is, you may close the virtual machine abrubtly when the Operating System is in process.
It's not a big issue.
The following steps are used to solve this issue.

In Windows XP : 

Error :  
Cannot open file "C:\Users\All Users\Application Data\VMware\dndlogs\dndlog.conf": The system cannot find the path specified.

Solution :
1. Open Command Prompt (Press winkey+r and type cmd then press enter) 
2. After that type the below two steps in command prompt
  • mkdir "C:\Users\All Users\Application Data\VMware\dndlogs"
  • echo > "C:\Users\All Users\Application Data\VMware\dndlogs\dndlog.conf"
3. Now open Vmware Workstation and run the OS. It will be working fine.

In Windows 7 : 

Error : 
Cannot open file "C:\ProgramData\VMware\dndlogs\dndlog.conf": The system cannot find the path specified.

Solution :
1. Open Command Prompt (Press winkey+r and type cmd then press enter)
2. After that type the below two steps in command prompt
  • mkdir C:\ProgramData\VMware\dndlogs
  • echo > C:\ProgramData\VMware\dndlogs\dndlog.conf 
3. Now open Vmware Workstation and run the OS. It will be working fine.

In Linux OS :

Error :  
Cannot open file "~/.vmware/dndlogs/dndlog.conf": The system cannot find the path specified.

Solution : 
1. Open the terminal
2. After that type the below two steps in terminal
  • mkdir ~/.vmware/dndlogs
  • touch ~/.vmware/dndlogs/dndlog.conf
3. Now open Vmware Workstation and run the OS. It will be working fine.