RSS
 

Archive for the ‘guide’ Category

Change the Date and Timezone in Centos

14 Apr

Log into your server then retrieve the current date and timezone by typing in

date

all timezone information is stored at /usr/share/zoneinfo you can browse to this by typing

cd /usr/share/zoneinfo

you should see a list of all the available timezones including folders for countries which have multiple time zones eg. America

so to change the time zone just enter the following

ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime

If you then want to manually set the time to 30/03/2008 09:57, the format to enter the date is ‘mmddhhmmyyyy’

033009572008

The following command will update your hardware clock

hwclock –systohc

And now when you type in ‘date’ you should see an up to date clock

 
No Comments

Posted in guide, linux

 

Setting up VSFTPD

29 Mar

The virtual machine I used was a centos 5 linux distribution, I then installed VSFTP

1. Install VSFTPD

[root@localhost]# yum install vsftpd

2. Make sure vsftpd starts on bootup

[root@localhost]# chkconfig vsftpd on

3. Switch of anonymous ftp access

[root@localhost]# vi /etc/vsftpd/vsftpd.conf

then change the line to

anonymous_enable=no

4. You can change the greeting you see when you connect to the ftp server by changing the line

tpd_banner= New Banner Here

5. Create a user group and shared directory. In this case, use /var/www/vhosts and a user group name of ftp-users for the remote users

[root@localhost]# groupadd ftp-users
[root@localhost]# mkdir /var/www/vhosts

6. Make the directory accessible to the ftp-users group.

[root@localhost]# chmod 775 /var/www/vhosts
[root@localhost]# chmod 775 /var/www

7. Add users, and make their default directory /var/www/vhosts

[root@localhost]# useradd -g ftp-users -d /var/www/vhosts user1

8. Change the permissions of the files in the /var/www/vhosts directory for read/write only access by the group

[root@localhost]# chown root:ftp-users /var/www/vhosts*

9. Restart the VSFTPD service using

[root@localhost]# service vsftpd restart

10. Make sure you are not blocking ftp ports to the server (ftp requires port 21 to be open)

system-config-securitylevel

11. After configuring the vsftpd server on an Amazon ec2 server , I was not able to connect to vsftpd in one server from my ftp client. It throws the error:

500 OOPS: vsf_sysutil_recv_peek

The solution for this problem is to load capability module:

# modprobe capability

12. If you are having trouble connecting with an FTP client (such as FileZilla) and receiving an error like below

Error: Could not read from socket: ECONNRESET – Connection reset by peer
Error: Disconnected from server
Error: Failed to retrieve directory listing

Then make sure you change the connection settings in the client to ‘active’ rather than ‘default’

 
 

Guide : Mount a linux directory from windows

28 Aug

From windows right click on the folder you want to share with your VMWare Web Server and share this as ‘www’ you will want to create a user and password within windows, I normally run with the username as ‘linux’ and password as ‘linux’

NOTE: NTFS drives are only read only when mounted from Linux, alternatively create a FAT partition and use this so that you can write files to your windows machine from Linux.

Open up your fstab file in linux

‘vi /etc/fstab’

then press ‘*’ then ‘a’ to start editing

add a line at the bottom as follows

share a directory including a username and password for the user

//192.168.79.1/www /mnt/www cifs rw,user=linux,password=linux 0 0

 
No Comments

Posted in VMware, guide

 

Guide : Change hosts file in windows

28 Aug

Browse to

c:/windows/system32/drivers/etc

open in notepad/wordpad

hosts

add under 127.0.0.1 localhost

ipaddressofvmwareserver webserver(or name of development domain)

reboot windows for changes to take affect

 
No Comments

Posted in guide

 

T3G Sierra 580 Wireless Card connecting with Ubuntu 7.04

20 Aug

This guide is for users of Ubuntu Feisty Fawn 7.04 on the Telecom New Zealand network

first plug in your Sierra Wireless 580 T3G Data Card
then install kppp

sudo apt-get install kppp

then start kppp

kppp

click on configure and add a new account call it ‘telecom’, add the phone number as ‘#777′ and the authentication as ‘PAP’.

Then add a new modem call it ‘telecom’ and select ‘/dev/tty/USB0′.
You are now ready to connect the username is ‘mobile@jamamobile’ (same for all users) and the password is ‘telecom’(same for all users) and click on connect

 
No Comments

Posted in guide, linux

 

Guide : Installing Skype on Ubuntu Feisty

17 Aug

sudo gedit /etc/apt/sources.list

add the following line

deb http://download.skype.com/linux/repos/debian/ stable non-free

sudo apt-get update

sudo apt-get install skype

 
 

Guide : Install VMWare Server on Ubuntu Feisty

17 Aug

sudo gedit /etc/apt/sources.list

add the line

deb http://archive.canonical.com/ubuntu feisty-commercial main

sudo apt-get update

sudo apt-get install vmware-server vmware-tools-kernel-modules

 
 

Guide : Ubuntu and Backing up to Amazon S3

08 Aug

I have been looking for a good method to back up to Amazon’s S3 service. I have used the ‘S3 Firefox Organizer’ although this seems a bit cumbersome at times and does not give much feedback.

I have since installed s3sync

you need to have ruby installed as well as openssl-ruby, so using aptget I installed these

sudo apt-get install ruby

sudo apt-get install libopenssl-ruby

Extract s3sync somewhere on your computer and then create a file in this directory called s3config.yml and put your key and secret key that you have obtained from Amazon in this file, there is an example file in the directory to help out here.

You will need to create a bucket (somewhere to save your files) on your AmazonS3 Service so browse to the newly extracted folder and run the commands below to list the buckets in your account and also create a bucket

s3cmd.rb listbuckets

s3cmd.rb createbucket BucketName

You can then backup to AmazonS3 service with a command such as

s3sync.rb -r directory bucketname:nameofbackup

There are some other useful commands which can be obtained in the readme files.

 
 

Guide : VMWare Share Folders with Windows from Ubuntu

27 Jul

Make sure Samba is installed on Ubuntu

sudo apt-get install samba

Create a new Samba User

sudo smbpasswd -a USERNAME

Then edit the samba configuration file

sudo gedit /etc/samba/smb.conf

Then add the following to the bottom of the file

security = user
[NAMEOFSHARE]
path = DIRECTORYPATH
valid users =USERNAMEAS ABOVE
read only = No
create mask = 0777
directory mask = 0777

Then restart Samba

sudo /etc/init.d/samba restart

Then you need to configure the network connection of the VMWare instance, so edit the settings of the VMWare instance, I had the Ethernet Connection set as NAT.

It is then just a matter of starting windows, open ‘My Network’ and then the ‘Entire Network’ and you should see the share available for use.

 
 

Guide : MySQL Importing and Exporting

24 Jul

Importing a SQL File from the command line

mysql -u USER -p DBNAME < FILENAME.sql

Exporting a SQL File from the command line

mysql -u USER -p DBNAME > FILENAME.sql

 
No Comments

Posted in guide, mysql