Linux

Creating a FTP user , adding ftp user to your Linux

Before adding FTP user you have to install FTP server

Install the FTP server

To install the FTP server, type:
sudo aptitude install vsftpd

Configure FTP server

The FTP server configuration is done by editing the file / etc / vsftpd.conf
To edit this file, do:
gksu gedit /etc/vsftpd.conf

Prohibit anonymous FTP

Change the line:
anonymous_enable=YES
in:
anonymous_enable=NO

Comment out the chroot_list_enable=YES line as well.

Allow local users to connect

Add:
local_enable=YES

This will allow users reported in Ubuntu use the same login/password to access the FTP server.
Allow users to upload files

Add:
write_enable=YES

Select Interface

By default the FTP server will listen on all interfaces. If you want to restrict it only to your local network(10.0.0.x) add the line:
listen_address=10.0.0.1
Given that the LAN IP address of your FTP server is 10.0.0.1

Start FTP server

(Re)start the FTP server so that it takes into account the configuration we just changed.
Type:
sudo /etc/init.d/vsftpd restart

Until now only FTP server is installed

#edit /etc/vsftpd.conf or /opt/etc/vsftpd.conf
Open the vsftpd.conf file and search for chroot_list_enable=YES
Make sure it is YES. Do the same for the following variables
chroot_list_file=/etc/vsftpd.chroot_list or /opt/etc/vsftpd.chroot_list
chroot_list_enable=YES
Save and close the file

Create vsftpd.chroot_list in /etc/ or /opt/etc/
Add the username you want to export to ftp.
IMP: The user must already be a system user with a valid passwd. You must be able to find /home/
If the user you want to add is not a system user then create that user first before editing the above file.
#adduser
#passwd

Restart the vsftpd server using /etc/init.d/vsftpd restart or service vsftpd restart
Now you can log into ftp using the new user.

Joomla FTP setup in ubuntu server

Hi all

I have been struggling so long to configure my FTP layer for joomla but could not find any satisfactory answer…………Then i came up with the following idea to get rid of all the errors and make the webpage secure too

Follow the following steps
1. chmod 777 /location_of_your_joomla_folder/
chmod 777 /var/www/joomla15/
2. install the joomla and check the owner of the configuration.php
3. chown -R www-data /var/www/joomla15
4. The site is now in production stage ………..Once the site is completely created , change back the permission to the original user.

Mounting USB drive in ubuntu server

fdisk -l  /////// to see the list of drives
mkdir /media/external /////// to make the place of mount
sudo mount -t vfat /dev/sdb1 /media/external -o uid=1000,gid=100,utf8,dmask=027,fmask=137 //// to mount USB drive of FAT32 or FAT16
help from https://help.ubuntu.com/community/Mount/USB

To unmount the USB


 umount /media/external/

Enable server to parse the html files as php files on Linux 64bit working on XAMPP

I have been struggling hard to enable server to parse the html files as php files on linux 64 bit working on XAMPP. However there is confusion to which file here is the step by step process

Via httpd.conf

  1. For Linux servers using Apache with XAMPP, find a file called httpd.conf. This file should be in the folder called, “conf” in the Apache program files or should be at location  /opt/lampp/etc/original/ and also at location /opt/lampp/etc/ . Also  It may be on the server as /etc/httpd/conf/httpd.conf
  2. You should change at both of these location.
  3. In httpd.conf, find the line that looks like this:
    •  AddType application/x-httpd-php .php
    if you cannot find the above line look for the line 
    • AddType application/x-compress .Z
    • AddType application/x-gzip .gz .tgz
  4. Add the following line below:
      • AddType application/x-httpd-php .html
    • Or alter the AddType application/x-httpd-php .php to:
      • AddType application/x-httpd-php .php .html
  5. After making these changes, restart your web server. For unix based xampp servers, using this command:
    • /opt/lampp/lampp start

LINUX commands usage with examples

Clear the screen —clear

Login as superuser:—-sudo -s

ls List Command

  • view hidden files—ls -l -a

cp Copy Command

  • Copy single file
    • Command  $ cp addresssOfFileToBeCopied locationOfFolderWhereFileToBeCopied
    • Example:   $ cp home/sudeep/Desktop/configuration.php /opt/lampp/htdocs/joomla/
  • Copy compete directory
    • Command $ cp -r addressOfFolderTobecopied/* locationOfFolderWhereFolderToBeCopied
    • Example   $ cp -r /home/hope/files/* /home/hope/backup

chmod Change permissions

  • Change permissions of complete folder along with the files and folders within the folders
    • Command $chmod 777 -R directoryNameOrPath/
    • Example    $chmod 755 -R home/sudeep/Desktop/joomla/

tar -xvzf extract files

  • extarct the tar files to the specific location
    • Command $tar -xvzf file.tar.gz -C locationWhereFileToBeExtracted
    • Example   $tar -xvzf DBDesigner4.0.5.4.tar.gz -C /home/sudeep/Desktop/ise/

find Command to search a file or folder

  • to search any file or folder in the complete linux file system
    • Command $find / -name fileOrfolderNameToBeSearched
    • Example   $find / -name config.php
  • to search any file or folder at specific location  linux file system
    • Command $find locationWhereYouWantToSearch -name fileOrfolderNameToBeSearched
    • Example   $find /home/sudeep/Desktop/ -name original