Posts tagged CentOS
These instructions on how to mount an Amazon EBS volume apply to CentOS Linux specifically but with little modification can be applied to all Linux distributions. By attaching EBS volumes (aka. disks) to your instance you can get around the majority file space issues that might encounter when hosting popular websites or those which contain a lot of data (e.g. image galleries, music sites, podcasts, etc.)
- Note down the instance id of the instance you want to add more storage to
- In your AWS account go to the volumes link (under Elastic Block Store) click the Create Volume Button and choose how big you want this device to be.
- Attach the new EBS volume to your instance by right clicking it and choosing Attach Volume. Select the instance id from the list that you noted down in step 1. and give the new device a name to reference it on the instance, e.g. /dev/sdf
- Login into your instance on the command line and do and run (# represents the command prompt):
# ls /dev
You should see that /dev/sdf has been created for you
- Format /dev/sdf by running:
# mkfs.ext3 /dev/sdf
It will warn you that this an entire device. You should type y to allow the process to continue unless you want to create specific partitions on this device
- Create a directory to mount your new drive as on the filesystem, for example we’ll use /files:
# mkdir /files
- Add a reference in the fstab file to mount the newly formatted drive onto the /files directory by running the following command:
# echo "/dev/sdb /files ext3 noatime 0 0" >> /etc/fstab
- Mount the drive by running:
# mount /files
- Check your drive has mounted correctly with the expected amount of file space by running:
# df -h /files
It really is that simple, within a few cli commands you can simply add 1GB to 1TB of storage at the drop of a hat!
Questions? Leave me a comment and I’ll do my best to answer them for you
To set to UK time (i.e. respect BST) run the following on the command line:
ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime
More here: To set to UK time (i.e. respect BST)
I have a dual boot Windows Vista / Linux Laptop and recently I needed to access the Linux partitions from within Windows to copy data between the operating systems.
So I did a bit of searching on the net and had trouble finding a tool/page describing how to do it with an LVM (Logical Volume Manager) partition, all tools seemed to just work with plain old ext2 or ext3 file systems with no mention of others.
This is a problem with at least CentOS 5.1 (Red Hat Enterprise) and probably all modern Linux distributions as there seems to be a move towards the LVM methodology for all operating systems - understandably so when you read what it's all about from wikipedia: http://en.wikipedia.org/wiki/Logical_volume_management
But then I noticed that Explore2FS from chrysocome.net actually also supports LVM2 as well as ext2 / ext3, and it works great!
All I had to do was download (at the time of writing) explore2fs 1.08beta9 extract it from the archive and run it - job done! I can get to my standard Linux files (and more actually) with ease from within windows through an explorer style interface. Just what I needed!
The guy(s) who developed Explore2FS are also working on another tool called Virtual Volumes but this really is a beta (at the time of writing) and I couldn't get this to work in a useful way what so ever BUT this should be a winner when it works too!
So now it just remains for me to setup ntfs support in CentOS 5.1 and I can go both ways - woohoo!
After having no end of issues with the proprietary flash media server 2 from Adobe I decided to give installing the Red5 open source version a go instead.
I have to say I was fairly impressed with just how easy it was to get running without having to do any of the faffing around that was required to get FMS2 running.
Here is the process in a nutshell:
- Download and install the Java Development Kit (jdk) from here (I used the rpm version of JDK 6 Update 2): http://java.sun.com/javase/downloads/index.jsp
- Download and extract Apache ant from here: http://archive.apache.org/dist/ant/binaries/apache-ant-1.6.5-bin.tar.gz
- Copy the extracted apache-ant-1.6.5 folder to /usr/local/ant
- Setup the environment variables to include the path for java and ant by typing the following at the shell prompt:PATH=$PATH:$HOME/bin:/usr/local/ant/bin
export PATHThen also remember to add this toÂ /etc/profile so the settings don't get lost the next time you login
- Download and extract the Red5 server from here: http://osflash.org/red5
- cd to theÂ Red5 directory you just extracted and type the following at the shell prompt toÂ allow java to retrieve the files it needs from the net and compile and run the server as a background process (the module retrieval is automatic and only has to be done once):ant server &Â
- Then that's it it's running. In my case I needed to kill the ant/java processes running the server after the java modules were initially retrieved and the server built for the first time, but the second time it was fineÂ even though it did take about 30 seconds to fully startup - this may just be a glitch onÂ my system as IÂ have a lotÂ of other stuff also going on.
- The final step is to test it. This can be done by moving the contents of the webapps/root/demos/ folderÂ from theÂ extracted Red5 directory to a webserver somewhere (I don't think it hast to be the same machine) and then viewing the list of demos in the index.html file.I started off by using the port tester to make sureÂ the demo apps could actually connect to the server on the ports they were meant to (basically rtmp port 1935) and then moved onto testing the video streaming app and then tried a proper live broadcast through the server using theÂ simpleBroadcaster app to two friends who were logged on using the simple subscriber app. All worked well especially as far as the video was concerned though the audio was a little crackly on my live broadcast - this could just be the quality of home connections however.The onlyÂ last not is just a simple reminder that when running theÂ test apps you'll need to specify the server they need to connect to - theÂ apps are setup to accessÂ rtmp://localhost/[APP_NAME] but if you're not running these apps as a local user you will need to change localhost to the name or ip of the serverÂ Red5 is installed on
So far I'm quite happy with Red5 as a free (very important) alternative to FMS2, but should you be looking for a commercial product as this is not quite up your streetÂ (that is a cheaper than FMS2)Â then take a look at this instead: http://www.wowzamedia.com/index.html
Wowza only requires java to run and is like a very polishedÂ commercial version of the Red5 server (it wasÂ actually through installing Wowza that I worked out what to do with the web apps for Red5 - having had no previous experience in flash streaming other than literally installing FMS2)Â which has a very reasonable price tag in comparison to the cost of FMS2
Just before I go I just need to mention the map below - Red5 ask you to add yourself to their user map if you're using the software so I have - you can find me in Brighton, England