Showing posts with label Configure. Show all posts
Showing posts with label Configure. Show all posts

Monday 4 June 2012

yoyoclouds: Update CentOS

Update CentOS 


There are basically two ways of updating a CentOS machine.. first is by using the GUI and the second, via command line...

Read more here ...

yoyoclouds: Install and Configure Apache Server on CentOS

Install and Configure Apache Server on CentOS Apache Server Apache HTTP Server is an open-source HTTP server for modern ....

Read more here ...

Saturday 2 June 2012

Seeding Torrents with Amazon S3 and s3cmd on Ubuntu

Again a nice post by  . Hope its useful for some of you out there...

Amazon Web Services is such a huge, complex service with so many products and features that sometimes very simple but powerful features fall through the cracks when you’re reading the extensive documentation.

One of these features, which has been around for a very long time, is the ability to use AWS to seed (serve) downloadable files using the BitTorrent™ protocol. You don’t need to run EC2 instances and set up software. In fact, you don’t need to do anything except upload your files to S3 and make them publicly available.

Any file available for normal HTTP download in S3 is also available for download through a torrent. All you need to do is append the string ?torrent to the end of the URL and Amazon S3 takes care of the rest.

Steps

Let’s walk through uploading a file to S3 and accessing it with a torrent client using Ubuntu as our local system. This approach uses s3cmd to upload the file to S3, but any other S3 software can get the job done, too.
  1. Install the useful s3cmd tool and set up a configuration file for it. This is a one time step:
    sudo apt-get install s3cmd s3cmd --configure 
    The configure phase will prompt for your AWS access key id and AWS secret access key. These are stored in $HOME/.s3cmd which you should protect. You can press [Enter] for the encryption password and GPG program. I prefer “Yes” for using the HTTPS protocol, especially if I am using s3cmd from outside of EC2.
  2. Create an S3 bucket and upload the file with public access:
    bucket=YOURBUCKETNAME filename=FILETOUPLOAD basename=$(basename $filename) s3cmd mb s3://$bucket s3cmd put --acl-public $filename s3://$bucket/$basename 
  3. Display the URLs which can be used to access the file through normal web download and through a torrent:
    cat <<EOM web: http://$bucket.s3.amazonaws.com/$basename torrent: http://$bucket.s3.amazonaws.com/$basename?torrent EOM 

Notes

  1. The above process makes your file publicly available to anybody in the world. Don’t use this for anything you wish to keep private.
  2. You will pay standard S3 network charges for all downloads from S3 including the initial torrent seeding. You do not pay for network transfers between torrent peers once folks are serving the file chunks to each other.
  3. You cannot throttle the rate or frequency of downloads from S3. You can turn off access to prevent further downloads, but monitoring accesses and usage is not entirely real time.
  4. If your file is not popular enough for other torrent peers to be actively serving it, then every person who downloads it will transfer the entire content from S3’s torrent servers.
  5.  If people know what they are doing, they can easily remove “?torrent” and download the entire file direct from S3, perhaps resulting in a higher cost to you. So as a work-around just download the ?torrent URL, save the torrent file, and upload it back to S3 as a .torrent file. Share the torrent file itself, not the ?torrent URL. Since nobody will know the URL of the original file, they can only download it via the torrent.You don't even need to share the .torrent file using S3.
SOURCE

Thursday 24 May 2012

Install and Configure MySQL on CentOS

MySQL is the world's most popular open source database.

MySQL Community Edition is freely downloadable version.

Commercial customers have the flexibility of choosing from multiple editions to meet specific business and technical requirements. For more details please refer to the MySQL official website.

INSTALL :


On any CentOS server with open internet, run the below command to install MySQL Community Edition:

yum install mysql-server mysql php-mysql

OR

Download the server and client rpm files from the MySQL Website depending upon the platform(OS) and architecture(32/64bit).

Install both rpm files using below command:

rpm -ivh <<rpm_filenames>>

Example:

rpm -ivh mysql-server-version.rpm mysqlclient9-version.rpm


CONFIGURE :


Once installed, run the below commands to configure MySQL Server:

1.Set the MySQL service to start on boot

chkconfig --levels 235 mysqld on

2. Start the MySQL service

service mysqld start

3. By default the root user will have no password, so to log into MySQL use command:

mysql -u root

4. To exit Mysql Console, enter below command

exit;

SET PASSWORD FOR ROOT :


To set the root user password for all local domains, login and run below commands

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('<<new-password>>');

SET PASSWORD FOR 'root'@'localhost.localdomain' = PASSWORD('<<new-password>>');

SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('<<new-password>>');

(Replace <<new-password>> with actual password)

OR

run below command at linux shell:

mysqladmin -u root password '<<new-password>>'

(Replace <<new-password>> with actual password)

Once password is set, to login to Mysql use below command:

mysql -u root -p

Once you enter the above command, you will be prompted for the root password.

ADD NEW USER :




To add a new user for MySQL login, use the below SQL query. Remember this query must be run from the MySQL prompt.

for localhost:

INSERT INTO user (Host, User, Password, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv, File_priv, Grant_priv, References_priv, Index_priv, Alter_priv, Show_db_priv, Super_priv, Create_tmp_table_priv, Lock_tables_priv, Execute_priv, Repl_slave_priv, Repl_client_priv, Create_view_priv, Show_view_priv, Create_routine_priv, Alter_routine_priv, Create_user_priv, Event_priv, Trigger_priv, ssl_type, ssl_cipher, x509_issuer, x509_subject, max_questions, max_updates, max_connections, max_user_connections) VALUES ('localhost', '<<USERNAME>>', password('<<PASSWORD>>'), 'Y','Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'N', 'N', '', '', '', '', 0, 0, 0, 0);

for anyhostname:

INSERT INTO user (Host, User, Password, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv, File_priv, Grant_priv, References_priv, Index_priv, Alter_priv, Show_db_priv, Super_priv, Create_tmp_table_priv, Lock_tables_priv, Execute_priv, Repl_slave_priv, Repl_client_priv, Create_view_priv, Show_view_priv, Create_routine_priv, Alter_routine_priv, Create_user_priv, Event_priv, Trigger_priv, ssl_type, ssl_cipher, x509_issuer, x509_subject, max_questions, max_updates, max_connections, max_user_connections) VALUES ('%', '<<USERNAME>>', password('<<PASSWORD>>'), 'Y','Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'N', 'N', '', '', '', '', 0, 0, 0, 0);

Replace <<USERNAME>> and <<PASSWORD>> with actual username and password respectively.

Note they must be enclosed in single quotes.


DROP ANY USER :


In case, you want to drop any user use below command:

DROP '<<username>>''@'localhost';

DROP '<<username>>''@'localhost.localdomain';

(Replace <<username>> with actual username)




For more help and commands, refer --> http://www.yolinux.com/TUTORIALS/LinuxTutorialMySQL.html

Friday 18 May 2012

Install JAVA on Linux using rpm files

Steps for installing JAVA (JDK 6) on linux using rpm files:

1. Log into the linux shell and become root user by running the command

su –i

2. Change directory.

cd /opt

3. Please search at http://www.oracle.com/technetwork/java/javase/downloads/index.html for newer versions to download.

You can download to any directory you choose; it does not have to be the directory where you want to install the JDK. Before you download the file, notice its byte size provided on the download page on the web site. Once the download has completed, compare that file size to the size of the downloaded file to make sure they are equal.

To download use one of the below commands, depending on the server's architecture (32/64 bit) :
64 bit:
wget http://download.oracle.com/otn-pub/java/jdk/6u31-b04/jdk-6u31-linux-x64-rpm.bin

32 bit:
wget http://download.oracle.com/otn-pub/java/jdk/6u31-b04/jdk-6u31-linux-i586-rpm.bin



4. Make sure that execute permissions are set in the self-extracting binary.
Enter ls –la to see the permissions for the file.


5. Run below command to grant execute permission to the file:

chmod a+x <<name-of-rpm-file-downloaded-earlier>>
 
For e.g.:
chmod +x jdk-6u25-linux-x64-rpm.bin\?e\=1306317438\&h\=294de0d36f54e28dd65fc8370e3c406d

6. Change directory to the location where you would like the files to be installed. The next step installs the JDK into the current directory.

7. Execute the downloaded file, prepended by the path to it.
For example, if the file is in the current directory, prepend it with "./"  :
./<<name-of-rpm-file-downloaded-earlier>>
For e.g.:

./jdk-6u25-linux-x64-rpm.bin\?e\=1306317438\&h\=294de0d36f54e28dd65fc8370e3c406d



8. The binary code license is displayed, and you are prompted to agree to its terms.



9. Check if java is installed using command

java -version



The java version must be displayed correctly. You may also want to run commands like java or javac to check if installation is proper.

10. Execute below command to test if the JAVA_HOME environment variable is set.

echo $JAVA_HOME

It must display the location where java is installed.

11.  Delete the bin and rpm files if you want to save disk space.

rm -rf sun*