Wednesday, March 9, 2011

Install your own Video chat room CentOS AMIs

wget http://download.camfrog.com/get.php?type=fasl

[root@rajat ]# yum localinstall camfrogserver-5.0-4.noarch.rpm --nogpgcheck
Loaded plugins: langpacks, presto, refresh-packagekit
Adding en_US to language list
Setting up Local Package Process
Examining camfrogserver-5.0-4.noarch.
rpm: camfrogserver-5.0-4.noarch
Marking camfrogserver-5.0-4.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package camfrogserver.noarch 0:5.0-4 set to be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package           Arch       Version     Repository                       Size
================================================================================
Installing:
 camfrogserver     noarch     5.0-4       /camfrogserver-5.0-4.noarch     3.8 M

Transaction Summary
================================================================================
Install       1 Package(s)

Total size: 3.8 M
Installed size: 3.8 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : camfrogserver-5.0-4.noarch                               1/1
Certificate generated successfully, cert file name: /etc/camfrogserver.d/cert.pem, configuration file /etc/camfrogserver.d/cf_server.conf updated

***

Thank you for installing Camfrog Advanced Server for Linux.

Before you start Camfrog Server for the first time you must agree to the Camfrog Terms Of Service (TOS) and EULA at /etc/camfrogserver.d/CamfrogTOS.txt.
The TOS may be updated.  Please visit http://www.camfrog.com/terms.phtml for the most current TOS.
If you disagree with the Camfrog EULA or Terms of Service do not start Camfrog Server and uninstall it immediately.

***

The default config file is located in /etc/camfrogserver.d/cf_server.conf.sample

For the /etc/rc.d/init.d/camfrogserver startup script configuration settings please check /etc/sysconfig/camfrogserver.

Use the "service camfrogserver start" command to start server.


Installed:
  camfrogserver.noarch 0:5.0-4                                                 

Complete!
[root@rajat ]# cd /etc/camfrogserver.d
#cp cf_server.conf.sample cf_server.conf
#vi cf_server.conf
SSL_certificate_param=SiChE8xIyj3coZIATfXvf
# Enable remote access protocol. You can control your server using Windows-base$
remote_control_enabled=on
# Username/password for remote console access (full server management)
remote_control_login=rajat
remote_control_password=rajat

Port to open at AWS Management Console
6000:6010 tcp
5000:15000 udp
6005 udp
5999 tcp

[root@rajat camfrogserver.d]# service camfrogserver restart
Shutting down Camfrog server:                              [  OK  ]
Starting up Camfrog server daemon:                         [  OK  ]
[root@rajat camfrogserver.d]#

Now download Camfrog Advanced Server to your PC, and  Install it

Open Camfrog Advanced Server > Server Options > Change Server :)



Wednesday, February 16, 2011

Swap file in RedHat /CentOS /Fedora

$ dd if=/dev/zero of=/swapfile0 bs=1024 count=524288

Setup the swap area on the file you created.

$ mkswap /swapfile0

Enable the file for swapping

$ swapon /swapfile0

Permanently enable the swap file on boot.
Add the following lines to /etc/fstab.

/swapfile0 swap swap defaults 0 0
          

Check that the swap file is working the the free command. Also,
reboot too to make sure the swap file works on restart and that
/etc/fstab was correctly configured.

Disable SSH root login


Here is the step by step procedure to disable/deny direct root login via SSH

1. Login to the server as Root
2. Edit /etc/ssh/sshd_config

    Look for the line,

  PermitRootLogin=Yes
 
and then change the value of it to,

  PermitRootLogin=No 

3. Restart the sshd service and make sure its turned on
    service sshd restart        or     /etc/init.d/sshd restart
   
    service sshd status

Recover Bad Superblock in RedHat / CentOS /Fedora Filesystem


If  you get a ¨Damaged Superblock¨ error message at filesystem (fsck) check in Linux Server, Usually fsck will not be able to repair the file system due to bad super block. In these situations, we can recover the damaged super block from the backup. 

Solution:


There are backups of the Superblock located on several positions and we can restore them with a simple command in a Linux server


By default in Linux, the file system creates the backup of  super block in the following locations:

193, 3276, 9804, 16840, 22976 and 29912.


Note: 193 is only on older systems  in many cases. 3276 is the most current position for the first backup

When you get this "damaged superblock or bad superblock error" and if  you get a root-prompt in a recovery console, then issue the following command:

# e2fsck -b 3276 /dev/sda5

Now the System will check the filesystem with the information stored in that backup superblock and if the check was successful it will restore the backup to position 0.

If this is not successful, then try using the other copy of Superblock backup (Refer the backup location of superblock above)