Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Sunday, 8 November 2015

Find to take Backup MySQL Databases and Web server Files to a FTP Server on Linux/CentOs





This is a simple backup solution for people who run their own web server and MySQL database server on a dedicated or VPS server. Most dedicated hosting provider provides backup service using NAS or FTP servers. These service providers will hook you to their redundant centralized storage array over private VLAN. Since, I manage couple of boxes, here is my own automated solution. If you just want a shell script, go here (you just need to provided appropriate input and it will generate FTP backup script for you on fly, you can also grab my php script generator code).

Making Incremental Backups With tar

You can make tape backups. However, sometime tape is not an option. GNU tar allows you to make incremental backups with -g option. In this example, tar command will make incremental backup of /var/www/html, /home, and /etc directories, run:
# tar -g /var/log/tar-incremental.log -zcvf /backup/today.tar.gz /var/www/html /home /etc
Where,
  • -g: Create/list/extract new GNU-format incremental backup and store information to /var/log/tar-incremental.log file.

Making MySQL Databases Backup

mysqldump is a client program for dumping or backing up mysql databases, tables and data. For example, the following command displays the list of databases:
$ mysql -u root -h localhost -p -Bse 'show databases'
Output:
Enter password:
brutelog
cake
faqs
mysql
phpads
snews
test
tmp
van
wp
Next, you can backup each database with the mysqldump command:
$ mysqldump -u root -h localhost -pmypassword faqs | gzip -9 > faqs-db.sql.gz

Creating A Simple Backup System For Your Installation

The main advantage of using FTP or NAS backup is a protection from data loss. You can use various protocols to backup data:
  1. FTP
  2. SSH
  3. RSYNC
  4. Other Commercial solutions
However, I am going to write about FTP backup solution here. The idea is as follows:
  • Make a full backup every Sunday night i.e. backup everything every Sunday
  • Next backup only those files that has been modified since the full backup (incremental backup).
  • This is a seven-day backup cycle.

Our Sample Setup

   Your-server     ===>       ftp/nas server
IP:202.54.1.10   ===>       208.111.2.5
Let us assume that your ftp login details are as follows:
  • FTP server IP: 208.111.2.5
  • FTP Username: nixcraft
  • FTP Password: somepassword
  • FTP Directory: /home/nixcraft (or /)
You store all data as follows:
=> /home/nixcraft/full/mm-dd-yy/files - Full backup
=> /home/nixcraft/incremental/mm-dd-yy/files - Incremental backup

Automating Backup With tar

Now, you know how to backup files and mysql databases using the tar and mysqldump commands. It is time to write a shell script that will automate entire procedure:
  1. First, our script will collect all data from both MySQL database server and file system into a temporary directory called /backup using a tar command.
  2. Next, script will login to your ftp server and create a directory structure as discussed above.
  3. Script will dump all files from /backup to the ftp server.
  4. Script will remove temporary backup from /backup directory.
  5. Script will send you an email notification if ftp backups failed due to any reason.
You must have the following commands installed (use yum or apt-get package manager to install ftp client called ncftp):
  • ncftp ftp client
  • mysqldump command
  • GNU tar command
Here is the sample script:
  1. #!/bin/sh
  2. # System + MySQL backup script
  3. # Full backup day - Sun (rest of the day do incremental backup)
  4. # Copyright (c) 2005-2006 nixCraft <http://www.cyberciti.biz/fb/>
  5. # This script is licensed under GNU GPL version 2.0 or above
  6. # Automatically generated by http://bash.cyberciti.biz/backup/wizard-ftp-script.php
  7. # ---------------------------------------------------------------------
  8. ### System Setup ###
  9. DIRS="/home /etc /var/www"
  10. BACKUP=/tmp/backup.$$
  11. NOW=$(date +"%d-%m-%Y")
  12. INCFILE="/root/tar-inc-backup.dat"
  13. DAY=$(date +"%a")
  14. FULLBACKUP="Sun"
  15. ### MySQL Setup ###
  16. MUSER="admin"
  17. MPASS="mysqladminpassword"
  18. MHOST="localhost"
  19. MYSQL="$(which mysql)"
  20. MYSQLDUMP="$(which mysqldump)"
  21. GZIP="$(which gzip)"
  22. ### FTP server Setup ###
  23. FTPD="/home/vivek/incremental"
  24. FTPU="vivek"
  25. FTPP="ftppassword"
  26. FTPS="208.111.11.2"
  27. NCFTP="$(which ncftpput)"
  28. ### Other stuff ###
  29. EMAILID="admin@theos.in"
  30. ### Start Backup for file system ###
  31. [ ! -d $BACKUP ] && mkdir -p $BACKUP || :
  32. ### See if we want to make a full backup ###
  33. if [ "$DAY" == "$FULLBACKUP" ]; then
  34. FTPD="/home/vivek/full"
  35. FILE="fs-full-$NOW.tar.gz"
  36. tar -zcvf $BACKUP/$FILE $DIRS
  37. else
  38. i=$(date +"%Hh%Mm%Ss")
  39. FILE="fs-i-$NOW-$i.tar.gz"
  40. tar -g $INCFILE -zcvf $BACKUP/$FILE $DIRS
  41. fi
  42. ### Start MySQL Backup ###
  43. # Get all databases name
  44. DBS="$($MYSQL -u $MUSER -h $MHOST -p$MPASS -Bse 'show databases')"
  45. for db in $DBS
  46. do
  47. FILE=$BACKUP/mysql-$db.$NOW-$(date +"%T").gz
  48. $MYSQLDUMP -u $MUSER -h $MHOST -p$MPASS $db | $GZIP -9 > $FILE
  49. done
  50. ### Dump backup using FTP ###
  51. #Start FTP backup using ncftp
  52. ncftp -u"$FTPU" -p"$FTPP" $FTPS<<EOF
  53. mkdir $FTPD
  54. mkdir $FTPD/$NOW
  55. cd $FTPD/$NOW
  56. lcd $BACKUP
  57. mput *
  58. quit
  59. EOF
  60. ### Find out if ftp backup failed or not ###
  61. if [ "$?" == "0" ]; then
  62. rm -f $BACKUP/*
  63. else
  64. T=/tmp/backup.fail
  65. echo "Date: $(date)">$T
  66. echo "Hostname: $(hostname)" >>$T
  67. echo "Backup failed" >>$T
  68. mail -s "BACKUP FAILED" "$EMAILID" <$T
  69. rm -f $T
  70. fi
More Details Click
          Autherby-cyberciti.biz

Take Backup MySQL Databases and Web server Files to a FTP Server on Linux/CentOs





This is a simple backup solution for people who run their own web server and MySQL database server on a dedicated or VPS server. Most dedicated hosting provider provides backup service using NAS or FTP servers. These service providers will hook you to their redundant centralized storage array over private VLAN. Since, I manage couple of boxes, here is my own automated solution. If you just want a shell script, go here (you just need to provided appropriate input and it will generate FTP backup script for you on fly, you can also grab my php script generator code).

Making Incremental Backups With tar

You can make tape backups. However, sometime tape is not an option. GNU tar allows you to make incremental backups with -g option. In this example, tar command will make incremental backup of /var/www/html, /home, and /etc directories, run:
# tar -g /var/log/tar-incremental.log -zcvf /backup/today.tar.gz /var/www/html /home /etc
Where,
  • -g: Create/list/extract new GNU-format incremental backup and store information to /var/log/tar-incremental.log file.

Making MySQL Databases Backup

mysqldump is a client program for dumping or backing up mysql databases, tables and data. For example, the following command displays the list of databases:
$ mysql -u root -h localhost -p -Bse 'show databases'
Output:
Enter password:
brutelog
cake
faqs
mysql
phpads
snews
test
tmp
van
wp
Next, you can backup each database with the mysqldump command:
$ mysqldump -u root -h localhost -pmypassword faqs | gzip -9 > faqs-db.sql.gz

Creating A Simple Backup System For Your Installation

The main advantage of using FTP or NAS backup is a protection from data loss. You can use various protocols to backup data:
  1. FTP
  2. SSH
  3. RSYNC
  4. Other Commercial solutions
However, I am going to write about FTP backup solution here. The idea is as follows:
  • Make a full backup every Sunday night i.e. backup everything every Sunday
  • Next backup only those files that has been modified since the full backup (incremental backup).
  • This is a seven-day backup cycle.

Our Sample Setup

   Your-server     ===>       ftp/nas server
IP:202.54.1.10   ===>       208.111.2.5
Let us assume that your ftp login details are as follows:
  • FTP server IP: 208.111.2.5
  • FTP Username: nixcraft
  • FTP Password: somepassword
  • FTP Directory: /home/nixcraft (or /)
You store all data as follows:
=> /home/nixcraft/full/mm-dd-yy/files - Full backup
=> /home/nixcraft/incremental/mm-dd-yy/files - Incremental backup

Automating Backup With tar

Now, you know how to backup files and mysql databases using the tar and mysqldump commands. It is time to write a shell script that will automate entire procedure:
  1. First, our script will collect all data from both MySQL database server and file system into a temporary directory called /backup using a tar command.
  2. Next, script will login to your ftp server and create a directory structure as discussed above.
  3. Script will dump all files from /backup to the ftp server.
  4. Script will remove temporary backup from /backup directory.
  5. Script will send you an email notification if ftp backups failed due to any reason.
You must have the following commands installed (use yum or apt-get package manager to install ftp client called ncftp):
  • ncftp ftp client
  • mysqldump command
  • GNU tar command
Here is the sample script:
  1. #!/bin/sh
  2. # System + MySQL backup script
  3. # Full backup day - Sun (rest of the day do incremental backup)
  4. # Copyright (c) 2005-2006 nixCraft <http://www.cyberciti.biz/fb/>
  5. # This script is licensed under GNU GPL version 2.0 or above
  6. # Automatically generated by http://bash.cyberciti.biz/backup/wizard-ftp-script.php
  7. # ---------------------------------------------------------------------
  8. ### System Setup ###
  9. DIRS="/home /etc /var/www"
  10. BACKUP=/tmp/backup.$$
  11. NOW=$(date +"%d-%m-%Y")
  12. INCFILE="/root/tar-inc-backup.dat"
  13. DAY=$(date +"%a")
  14. FULLBACKUP="Sun"
  15. ### MySQL Setup ###
  16. MUSER="admin"
  17. MPASS="mysqladminpassword"
  18. MHOST="localhost"
  19. MYSQL="$(which mysql)"
  20. MYSQLDUMP="$(which mysqldump)"
  21. GZIP="$(which gzip)"
  22. ### FTP server Setup ###
  23. FTPD="/home/vivek/incremental"
  24. FTPU="vivek"
  25. FTPP="ftppassword"
  26. FTPS="208.111.11.2"
  27. NCFTP="$(which ncftpput)"
  28. ### Other stuff ###
  29. EMAILID="admin@theos.in"
  30. ### Start Backup for file system ###
  31. [ ! -d $BACKUP ] && mkdir -p $BACKUP || :
  32. ### See if we want to make a full backup ###
  33. if [ "$DAY" == "$FULLBACKUP" ]; then
  34. FTPD="/home/vivek/full"
  35. FILE="fs-full-$NOW.tar.gz"
  36. tar -zcvf $BACKUP/$FILE $DIRS
  37. else
  38. i=$(date +"%Hh%Mm%Ss")
  39. FILE="fs-i-$NOW-$i.tar.gz"
  40. tar -g $INCFILE -zcvf $BACKUP/$FILE $DIRS
  41. fi
  42. ### Start MySQL Backup ###
  43. # Get all databases name
  44. DBS="$($MYSQL -u $MUSER -h $MHOST -p$MPASS -Bse 'show databases')"
  45. for db in $DBS
  46. do
  47. FILE=$BACKUP/mysql-$db.$NOW-$(date +"%T").gz
  48. $MYSQLDUMP -u $MUSER -h $MHOST -p$MPASS $db | $GZIP -9 > $FILE
  49. done
  50. ### Dump backup using FTP ###
  51. #Start FTP backup using ncftp
  52. ncftp -u"$FTPU" -p"$FTPP" $FTPS<<EOF
  53. mkdir $FTPD
  54. mkdir $FTPD/$NOW
  55. cd $FTPD/$NOW
  56. lcd $BACKUP
  57. mput *
  58. quit
  59. EOF
  60. ### Find out if ftp backup failed or not ###
  61. if [ "$?" == "0" ]; then
  62. rm -f $BACKUP/*
  63. else
  64. T=/tmp/backup.fail
  65. echo "Date: $(date)">$T
  66. echo "Hostname: $(hostname)" >>$T
  67. echo "Backup failed" >>$T
  68. mail -s "BACKUP FAILED" "$EMAILID" <$T
  69. rm -f $T
  70. fi
More Details Click
          Autherby-cyberciti.biz

Cron Job To Backup Data on Linux Automatically both Centos

Just add cron job as per your requirements:
13 0 * * * /home/admin/bin/ftpbackup.sh >/dev/null 2>&1

Description:


The cron daemon is a long running process that executes commands at specific dates and times. To schedule one-time only tasks with cron, use at or batch. For commands that need to be executed repeatedly (e.g. hourly, daily or weekly), use crontab, which has the following options:
crontab filename Install filename as your crontab file.
crontab -e Edit your crontab file.
crontab -l Show your crontab file.
crontab -r Remove your crontab file.
MAILTO=user@domain.com Emails the output to the specified address.
The crontab command creates a crontab file containing commands and how often cron should execute them. Each entry in a crontab file consists of six fields, specified in the following order:

    minute(s) hour(s) day(s) month(s) weekday(s) command(s)
The fields are separated by spaces or tabs. The first five are integer patterns and the sixth is the command to be executed. The following table briefly describes each of the fields:

Field Value Description
minute 0-59 The exact minute that the command sequence executes.
hour 0-23 The hour of the day that the command sequence executes.
day 1-31 The day of the month that the command sequence executes.
month 1-12 The month of the year that the command sequence executes.
weekday 0-6 The day of the week that the command sequence executes. Sunday=0, Monday = 1, Tuesday = 2, and so forth.
command Special The complete command sequence variable that is to be executed.
Each of the patterns from the first five fields may either be an asterisk (*) (meaning all legal values) or a list of elements separated by commas. An element is either a number or two numbers separated by a minus sign (meaning an inclusive range). Note that the specification of days may be made by two fields (day of the month and day of the week). If both are specified as a list of elements, both are followed. For example:

    MAILTO=user@domain.com
    0 0 1,15 * 1 /big/dom/xdomain/cgi-bin/scriptname.cgi
The cron daemon would run the program scriptname.cgi in the cgi-bin directory on the first and fifteenth of each month, as well as on every Monday. To specify days by only one field, the other field should be set to *. For example:

    MAILTO=user@domain.com
    0 0 * * 1 /big/dom/xdomain/cgi-bin/scriptname.cgi
The program would then only run on Mondays.
If a cron job specified in your crontab entry produces any error messages when it runs, they will be reported to you via email.
You may create crontab files in notepad (being sure to upload them in ASCII) or you may create them from the command line (via SSH) by simply typing:

    mcedit cronfile.txt
For more information, consult the man pages. man pages are the directions and tutorials available to you right at the command line. Type any of the following lines to open the relevant tutorials ([Enter] means to hit the Enter (return) key):

    man 5 crontab [Enter]
    man 1 crontab [Enter]
    man cron [Enter]
    man at [Enter]
    man batch [Enter]
    man 1 cron [Enter]
Note:Your crontab file must end with a line feed - in other words, make sure to press [Enter] after the last line in the file.


Try It!

Now that you have read an overview of cron, test your skills by following the steps below. Once completed, you should have a cron file of your own! Step 1: Create a simple text file using Notepad or any simple text editor that contains the following text:

    MAILTO=yourusername@yourdomain.com [Enter]
    58 23 * * * /big/dom/xdomain/cgi-bin/yourscript.pl
    [Enter]
Notes for Step 1

  1. You may create this file using your CNC File Manager by navigating to the /big/dom/xdomain/ directory and clicking 'Create New File' or any other simple text editor such as Notepad.
  2. [Enter] should not actually be typed. [Enter] means hit the "Enter" (return) key to begin the next line and to add a blank line feed at the end of the last line of your cron file. It is important to always remember to do this.
  3. MAILTO: Replace the email address with a valid email address of your own. This will ensure that when your cron runs, any output from the script, such as an error message, will be emailed to you.
  4. The second line tells your server when to run this script. In this example, the script will be run at 11:58 PM Eastern Time every day of the year.
  5. It is very important that you double-check the script path to ensure it is correct and remember the file names are CaSe-SeNsiTive.
Step 2: Name the text file (example: cronfile.txt).
The cronfile name may be replaced with any name you choose. For instance, if you are running a cron to trigger an email reminder script, it could be called reminder.txt. Many choose to simply call it cronfile.txt. Step 3: Upload the file in ASCII.
Any standard FTP client or your account's CNC upload feature will work for this. The file must be uploaded in ASCII mode and it is recommended that it be placed in your /big/dom/xdomain/ directory. It may be placed anywhere in your account but to prevent browser access (security risks) it is strongly recommended to place it above your /www directory.
Step 4: Connect to your account via SSH and issue the following command:

    crontab /big/dom/xdomain/cronfile.txt
The above tells the server's crontab where the file is located and that you wish to make it active. Make sure the path to the file is the actual path to where the file was placed. If successful, you will be returned to the command bash line. If not, an error will be displayed.
IMPORTANT NOTES
Removing/Stopping the Cron: Deleting the cronfile.txt file from your account will not stop the cron. You may remove this file at any time, however since the server's crontab already has the contents, the cron will still run once it has been made active.
To turn the cron off, you must connect to your account via SSH and issue the following command:

    crontab -r
The crontab -r will deactivate the cronjob and remove the file contents from the server.
Security Note: If the script the cron is set up to run is in the /cgi-bin/ or /www/ directory, it may be run at any time by anyone with browser access. If the crontab is all that should run the script and you do not want the public to be able to run the script, then you will need to place the script in a directory above the /cgi-bin/ and /www/ directories such as: /big/dom/xdom/user/cronscripts/scriptname
                                          More Details Click

Find to setup cron Job To Backup Data on Linux Automatically both Centos

Just add cron job as per your requirements:
13 0 * * * /home/admin/bin/ftpbackup.sh >/dev/null 2>&1

Description:


The cron daemon is a long running process that executes commands at specific dates and times. To schedule one-time only tasks with cron, use at or batch. For commands that need to be executed repeatedly (e.g. hourly, daily or weekly), use crontab, which has the following options:
crontab filename Install filename as your crontab file.
crontab -e Edit your crontab file.
crontab -l Show your crontab file.
crontab -r Remove your crontab file.
MAILTO=user@domain.com Emails the output to the specified address.
The crontab command creates a crontab file containing commands and how often cron should execute them. Each entry in a crontab file consists of six fields, specified in the following order:

    minute(s) hour(s) day(s) month(s) weekday(s) command(s)
The fields are separated by spaces or tabs. The first five are integer patterns and the sixth is the command to be executed. The following table briefly describes each of the fields:

Field Value Description
minute 0-59 The exact minute that the command sequence executes.
hour 0-23 The hour of the day that the command sequence executes.
day 1-31 The day of the month that the command sequence executes.
month 1-12 The month of the year that the command sequence executes.
weekday 0-6 The day of the week that the command sequence executes. Sunday=0, Monday = 1, Tuesday = 2, and so forth.
command Special The complete command sequence variable that is to be executed.
Each of the patterns from the first five fields may either be an asterisk (*) (meaning all legal values) or a list of elements separated by commas. An element is either a number or two numbers separated by a minus sign (meaning an inclusive range). Note that the specification of days may be made by two fields (day of the month and day of the week). If both are specified as a list of elements, both are followed. For example:

    MAILTO=user@domain.com
    0 0 1,15 * 1 /big/dom/xdomain/cgi-bin/scriptname.cgi
The cron daemon would run the program scriptname.cgi in the cgi-bin directory on the first and fifteenth of each month, as well as on every Monday. To specify days by only one field, the other field should be set to *. For example:

    MAILTO=user@domain.com
    0 0 * * 1 /big/dom/xdomain/cgi-bin/scriptname.cgi
The program would then only run on Mondays.
If a cron job specified in your crontab entry produces any error messages when it runs, they will be reported to you via email.
You may create crontab files in notepad (being sure to upload them in ASCII) or you may create them from the command line (via SSH) by simply typing:

    mcedit cronfile.txt
For more information, consult the man pages. man pages are the directions and tutorials available to you right at the command line. Type any of the following lines to open the relevant tutorials ([Enter] means to hit the Enter (return) key):

    man 5 crontab [Enter]
    man 1 crontab [Enter]
    man cron [Enter]
    man at [Enter]
    man batch [Enter]
    man 1 cron [Enter]
Note:Your crontab file must end with a line feed - in other words, make sure to press [Enter] after the last line in the file.


Try It!

Now that you have read an overview of cron, test your skills by following the steps below. Once completed, you should have a cron file of your own! Step 1: Create a simple text file using Notepad or any simple text editor that contains the following text:

    MAILTO=yourusername@yourdomain.com [Enter]
    58 23 * * * /big/dom/xdomain/cgi-bin/yourscript.pl
    [Enter]
Notes for Step 1

  1. You may create this file using your CNC File Manager by navigating to the /big/dom/xdomain/ directory and clicking 'Create New File' or any other simple text editor such as Notepad.
  2. [Enter] should not actually be typed. [Enter] means hit the "Enter" (return) key to begin the next line and to add a blank line feed at the end of the last line of your cron file. It is important to always remember to do this.
  3. MAILTO: Replace the email address with a valid email address of your own. This will ensure that when your cron runs, any output from the script, such as an error message, will be emailed to you.
  4. The second line tells your server when to run this script. In this example, the script will be run at 11:58 PM Eastern Time every day of the year.
  5. It is very important that you double-check the script path to ensure it is correct and remember the file names are CaSe-SeNsiTive.
Step 2: Name the text file (example: cronfile.txt).
The cronfile name may be replaced with any name you choose. For instance, if you are running a cron to trigger an email reminder script, it could be called reminder.txt. Many choose to simply call it cronfile.txt. Step 3: Upload the file in ASCII.
Any standard FTP client or your account's CNC upload feature will work for this. The file must be uploaded in ASCII mode and it is recommended that it be placed in your /big/dom/xdomain/ directory. It may be placed anywhere in your account but to prevent browser access (security risks) it is strongly recommended to place it above your /www directory.
Step 4: Connect to your account via SSH and issue the following command:

    crontab /big/dom/xdomain/cronfile.txt
The above tells the server's crontab where the file is located and that you wish to make it active. Make sure the path to the file is the actual path to where the file was placed. If successful, you will be returned to the command bash line. If not, an error will be displayed.
IMPORTANT NOTES
Removing/Stopping the Cron: Deleting the cronfile.txt file from your account will not stop the cron. You may remove this file at any time, however since the server's crontab already has the contents, the cron will still run once it has been made active.
To turn the cron off, you must connect to your account via SSH and issue the following command:

    crontab -r
The crontab -r will deactivate the cronjob and remove the file contents from the server.
Security Note: If the script the cron is set up to run is in the /cgi-bin/ or /www/ directory, it may be run at any time by anyone with browser access. If the crontab is all that should run the script and you do not want the public to be able to run the script, then you will need to place the script in a directory above the /cgi-bin/ and /www/ directories such as: /big/dom/xdom/user/cronscripts/scriptname
                                          More Details Click

Thursday, 1 May 2014

Free Linux Server Configuration


Free Linux Server Configuration 









I can do Linux server Configuration in Bangalore


* Secure remote access for remote management
* Upgrading
* User management
* File system
* Networking, including Samba (for Windows networking)
* Server software (web, database, LAMP, FTP, NFS, email)
* Firewall
* Software management
* Job scheduling with cron
* ......Etc

      if you need any clarifications please contact mallikarjunareddy86@gmail.com

Tuesday, 28 January 2014

Install And Configure CSVN on Linux

Install And Configure CSVN  on Linux
Requirements:
1.Java 1.6(JRE) or later (Java 7) must be installed.
2.Python 2.4 to 2.6 must be installed.

install CollabNet Subversion Edge:
1.Create user
    $adduser csvn
2.Switch to the folder where you want to install CollabNet Subversion Edge
    $ cd /opt
3. Untar the file you downloaded from CollabNet.
downlaod from website: http://www.collab.net/downloads/subversion
    $ tar zxf CollabNetSubversionEdge-x.y.z_linux-x86.tar.gz
    $ cd csvn
    $ sudo -E bin/csvn install

4.addition to configuring
    vi /opt/csvn/data/conf/csvn.conf

configure this two lines
JAVA_HOME = JAVA_HOME=/usr/java/default      and
RUN_AS_USER = csvn

5. Start the server
    $ bin/csvn start

The default administrator login is:

      Address: http://localhost:3343/csvn
      Username: admin
      Password: admin

6. Optional. Configure the Apache Subversion server to start automatically when
      the system boots.
     
      $ cd csvn
      $ sudo bin/csvn-httpd install
     

Friday, 20 December 2013

How to install Openpanel on linux

Installation
To install OpenPanel, add the following lines to your /etc/apt/sources.list:

deb http://download.openpanel.com/deb/ precise main
deb-src http://download.openpanel.com/deb/ precise main

where <distribution> should be replaced by the code name for your distribution. e.g. lenny, squeeze or wheezy for Debian, or lucid, maverick, natty, oneiric or precise for Ubuntu.
Then start the installation with the following commands. Make sure you execute these commands as user root. If you’re not root, type sudo -i first.

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4EAC69B9
apt-get update
aptitude install openpanel-suggested

If exim4 is currently installed on your system, aptitude will suggest removing it. If so, aptitude will ask you to confirm this. Enter y when asked to do so.
During installation, you may be asked about the configuration for postfix. Set it to ‘internet site’ with all defaults.
If the apt-key step fails, try:

 wget -O- http://openpa.nl/key | apt-key add -

If the install-step fails, try repeating aptitude install -f to resolve iffy dependencies.
After installation you will need to set the password for the openpanel-admin user before you can log in through the gui. The installation procedure may ask you for a password. If not, start openpanel-cli (as root) and enter the following command:

When the setup is done, you need to set the admin password (without brackets):

sudo openpanel-cli
update user openpanel-admin password=< YOURPASS >
exit

If the above step fails, try the following (due to a bug) (also log in with these credentials afterwards, not openpanel ;) ):

openpanel-cli
create user username password=password name_customer="Full Name" emailaddress="emailaddress"
exit

Please note that the "create" line is on 2 lines, it ends with the emailaddress!

Now you can launch OpenPanel in your browser (Accept the untrusted certificate, as there is no SSL certificate for this machine):
https://< IP OF NAS >:4089
login: openpanel-admin
pass: < YOURPASS >

Find to create Pure-FTPd Account on Linux

Pre-Installation

Install Pure-FTPd

  1. In a Linux shell run the following:
#apt-get install pure-ftpd-common pure-ftpd

  1. Now we need to create a new system group for pureftpd:
#groupadd ftpgroup

  1. Now we add a user for the group and give that user no permission to a home directory or a shell:
#useradd -g ftpgroup -d /dev/null -s /etc ftpuser

Create a new user

Lets create our first FTP user. In this example our user will be "Ramesh":
#pure-pw useradd Ramesh -u ftpuser -g ftpgroup -d
/home/pubftp/Ramesh -N 10

  1. In the above command we gave him a limit of 10 MB disk space with the option "-N 10". Now you have to enter Ramesh's new password twice.
  2. By default your users will be saved in /etc/pure-ftpd/pureftpd.passwd, but first we have to update the pureftpd Database:
#pure-pw mkdb

  1. The "Database" here is simply a binary file but it is ordered and has an index for quick access.

User Information

  1. To get some user details enter the following to get a complete list of all pureftpd users:
#pure-pw list

  1. If you want to show information about a specific user:
#pure-pw showRamesh

  1. This will show you detailed information about the user "Ramesh".
  2. You will notice that the line "Directory: /home/pubftp/Ramesh/./" has a trailing ./ but you shouldn't worry as this is simply the chroot for the user, which means he can't go "above" his directory.

Resetting a password

  1. If you forget the password for a user, you can reset it as follows:
#pure-pw passwdRamesh

  1. After a password reset update your database:
#pure-pw mkdb



Creating an Pure-FTPd Account on Linux

Pre-Installation

Install Pure-FTPd

  1. In a Linux shell run the following:
#apt-get install pure-ftpd-common pure-ftpd

  1. Now we need to create a new system group for pureftpd:
#groupadd ftpgroup

  1. Now we add a user for the group and give that user no permission to a home directory or a shell:
#useradd -g ftpgroup -d /dev/null -s /etc ftpuser

Create a new user

Lets create our first FTP user. In this example our user will be "Ramesh":
#pure-pw useradd Ramesh -u ftpuser -g ftpgroup -d
/home/pubftp/Ramesh -N 10

  1. In the above command we gave him a limit of 10 MB disk space with the option "-N 10". Now you have to enter Ramesh's new password twice.
  2. By default your users will be saved in /etc/pure-ftpd/pureftpd.passwd, but first we have to update the pureftpd Database:
#pure-pw mkdb

  1. The "Database" here is simply a binary file but it is ordered and has an index for quick access.

User Information

  1. To get some user details enter the following to get a complete list of all pureftpd users:
#pure-pw list

  1. If you want to show information about a specific user:
#pure-pw showRamesh

  1. This will show you detailed information about the user "Ramesh".
  2. You will notice that the line "Directory: /home/pubftp/Ramesh/./" has a trailing ./ but you shouldn't worry as this is simply the chroot for the user, which means he can't go "above" his directory.

Resetting a password

  1. If you forget the password for a user, you can reset it as follows:
#pure-pw passwdRamesh

  1. After a password reset update your database:
#pure-pw mkdb



How to create FTP Account on Linux.



Create a FTP user group. eg: ftpaccounts
#/usr/sbin/groupadd ftpaccounts

Add a new user to this group, and set the default path of that user to /home/user/.
#/usr/sbin/adduser -g ftpaccounts -d /home/user/ testuser

Set a password for the newley created user.
#passwd testuser

Set ownership of /home/user to the testuser and ftpaccounts.
#chown testuser:ftpaccounts /home/user

Give Read/Write access to testuser and all members in ftpaccounts
#chmod 775 /home/user

Edit /etc/vsftpd/vsftpd.conf file and make sure 'local_enable=YES' is uncommented.

Restart the vsftpd service.
#/etc/init.d/vsftpd restart

Creating an FTP Account on Linux



Create a FTP user group. eg: ftpaccounts
#/usr/sbin/groupadd ftpaccounts

Add a new user to this group, and set the default path of that user to /home/user/.
#/usr/sbin/adduser -g ftpaccounts -d /home/user/ testuser

Set a password for the newley created user.
#passwd testuser

Set ownership of /home/user to the testuser and ftpaccounts.
#chown testuser:ftpaccounts /home/user

Give Read/Write access to testuser and all members in ftpaccounts
#chmod 775 /home/user

Edit /etc/vsftpd/vsftpd.conf file and make sure 'local_enable=YES' is uncommented.

Restart the vsftpd service.
#/etc/init.d/vsftpd restart