This article applies to Red Hat, Fedora, CentOS, AWS Linux distros.
For enabling, disabling and listing system services, use the script called chkconfig.
List all services
List a specific service
chkconfig --list httpd
Turn a service on for specific levels
chkconfig httpd on --level 2,3,5
Disable a service
chkconfig httpd off
For stopping, starting and restarting a service, use the script called service.
service httpd stop
service httpd start
service httpd restart
The Amazon EC2 Linux instances come without a swap file. The steps below show how to add a swap file to an EC2 Linux server.
dd if=/dev/zero of=/mnt/swapfile bs=1M count=4096
chown root:root /mnt/swapfile
chmod 600 /mnt/swapfile
To make these changes permanent (reboot proof). Add the following line to /etc/fstab
/mnt/swapfile swap swap defaults 0 0
Java 7 Setup
# First verify the version of Java being used is not Oracle JDK.
# Get the latest JDK 7 from Oracle http://www.oracle.com/technetwork/java/javase/downloads/
# Install Java
sudo rpm -i jdk-7u71-linux-x64.rpm
# Check if the default java version is set to Oracle jdk
# If not then lets create one more alternative for Java for Oracle JDK
sudo /usr/sbin/alternatives --install /usr/bin/java java /usr/java/jdk1.7.0_71/bin/java 20000
# Set the Oracle JDK as the default java
sudo /usr/sbin/alternatives --config java
# Verify if change in SDK was done.
Download Cassandra from http://cassandra.apache.org/download/
- Unzip/Untar the file apache-cassandra-2.1.0-bin.tar.gz
- Copy the Cassandra folder apache-cassandra-2.1.0 to /usr/share
- Edit the file /usr/share/apache-cassandra-2.1.0/conf/cassandra.yaml if necessary
- Make sure /var/lib/cassandra has sufficient space
Start cassandra using the command:
So you have purchased an SSL certificate from GoDaddy and now you want to deploy it on the Amazon Load Balancer. This article assumes you generated the CSR before buying the certificate following the steps described here
In the AWS web console, go the “Load Balancers” section. Select your ELB and click on the “Listeners” tab. Now add a new listener for HTTPS.
Click on the “Change” link the “SSL Certificate” column. You will see the following screen.
Certificate Name: Enter the name you want to give this certificate.
Private Key: This private key is the one you generated when generating the CSR. If you followed the steps here, it is called server.key. This file will now have to be altered to create an Amazon supported private key. This can be done using openssl as follows.
openssl rsa -in server.key -out decrypted-server-key.pem
Now copy the contents of the file decrypted-server-key.pem and paste them into the “Private Key” section.
Public Key Certificate: This is the file that you got from GoDaddy, it you look something like “yourdomain.crt”. You now must get it into the Amazon supported form. This can be done using openssl as follows.
openssl x509 -inform PEM -in yourdomain.crt
Copy the entire output of the command above and past it into the “Public Key Certificate” section.
Thats it. Click on “Save” and you are done.
- Create an EBS volume using the AWS console (WEB UI)
- Using the AWS console, attach the EBS volume to running instance. The attached volume may get assigned to
/dev/sdf (EC2’s external name for this particular device number).
- Format file system
/dev/xvdf (Ubuntu’s internal name for this particular device number):
sudo mkfs.ext4 /dev/xvdf
- Mount file system (with update to /etc/fstab so it stays mounted on reboot):
sudo mkdir -m 000 /vol
echo "/dev/xvdf /vol auto noatime 0 0" | sudo tee -a /etc/fstab
sudo mount /vol
For more info: http://stackoverflow.com/questions/11535617/add-ebs-to-ubuntu-ec2-instance