Archive

Posts Tagged ‘XAMPP’

Setting up FTP permissions in XAMPP for Linux

May 16th, 2009

XAMPP for Linux (aka LAMPP) package contains proftpd server, which is quite a stable and highly configurable FTP server. It is GPL-licensed, capable of serving large files,  supports hidden directories, virtual hosts and per-directory “.ftpaccess” files, Advanced features like multiple authentication methods and upload/download ratios etc.

proftpd uses a single main configuration file which is located in “/opt/lampp/etc/proftpd.conf”. LAMPP configures the ftp server with a user called “nobody”, which is a fake account and doesn’t really exist. The password for this user can be changed by running the security utility of LAMPP i.e. “/opt/lampp/lampp security”.

When you create or upload files, there’ll be a default set of permissions applied to these files, that restricts access to other users. If you open the directory you’ve created in Nautilus, you can’t read/edit the contents. You can change these default set of permissions by editing the proftpd.conf file. You can also change the default directory of the ftp login.

sudo gedit /opt/lampp/etc/proftpd.conf

Change the directory to whatever you want to be redirected to when you login to ftp server.
# Normally, we want files to be overwriteable.
<Directory /home/ashok/xampp/*>
  AllowOverwrite        on
</Directory>

# only for the web servers content
DefaultRoot /home/ashok/xampp

To change the file permissions, find the line
# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask                022

Umask is the method used by proftpd, which is like an opposite to chmod. CHMOD 777 adds all permissions to files and directories (adds read, write capabilities) where as UMASK 777 removes all permissions from the files and directories. So, if you want the uploaded/created files to be accessed by everyone else, you have to use umask 000. More info about these permissions at: link

Your Ad Here

Ashok TT - How To, TT - Linux, TechTalk , ,

Running XAMPP on startup in Ubuntu

May 14th, 2009

Step 1: sudo gedit /etc/rc.local

Step 2: At the beginning of the file, add /opt/lampp/lampp start

XAMPP for linux (LAMPP) will now start automatically upon login.

Ashok TT - How To, TechTalk ,

Changing default directories of XAMPP on Ubuntu Jaunty Linux

May 10th, 2009

This post deals with changing the default directory of Apache in XAMPP.

Changing the Apache Directory:

Step 1: sudo gedit /opt/lampp/etc/httpd.conf

Step 2: Search for [ DocumentRoot "/opt/lampp/htdocs" ] without the brackets

Step 3: Change it to [ DocumentRoot "/whatever/directory/you/want" ]. Don’t put a / at the end of the path

Step 4: Search for [ ]

Step 5: Change it to [ ]

Step 6: Copy the files in /opt/lampp/htdocs/ to /whatever/directory/you/want

Restart the XAMPP server, and you’re all ready to go.

Ashok TT - How To, TechTalk ,

Connect to XAMPP MySQL using MySQL GUI Tools

May 10th, 2009

When you’re running XAMPP, using MySQL GUI tools (Contains MySQL Administrator and MySQL Query Browser) with default options throws the following error during the establishment of connection:

MySQL Error Nr. 2002 Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock

This is because XAMPP installs all the modules of Apache, MySQL etc in /var/opt whereas the tools look for default installation directory i.e. /var/run/…

You can find the sock file of XAMPP MySQL in /opt/lampp/etc/my.cnf. The default location for XAMPP MySQL is “/opt/lampp/var/mysql/mysql.sock“. In MySQL Administrator’s “Connect to…” dialog box, press the button “Details” and enter “/opt/lampp/var/mysql/mysql.sock” without the quotes in the “Connect Using Socket File” field.

Save this instance so that you can use this configuration automatically the next time you try to connect.

Ashok TT - How To, TechTalk ,