Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Wednesday, April 8, 2009

Changing the user of Coldfusion on Linux

I made the mistake of setting up Coldfusion 8 on a linux system (centOS) with the user set as 'nobody'. This proved to be a big mistake when it came to using tags like cffile to write to the filesystem. I had a hunt around for some info on how to do this with Adobe suggesting a reinstall of coldfusion

To change the user running coldfusion to the same as the owner of the web directory I completed the following steps.

1. vi /etc/init.d/coldfusion_8 then change the runtime user to the same as the user of your web folder
2. vi /etc/init.d/cfsearch8 then change the runtime user to the same as the user of your web folder
3. vi /opt/coldfusion8/bin/coldfusion then change the runtime user to the same as the user of your web folder
4. chown -R /opt/coldfusion8 name_of_new_runtimeuser

This allowed me to then use cffile to copy files to my server, however I was still running into a minor problem with the image functions of Coldfusion. Thanks to Ben Nadal who has a note on installing a hot fix to solve this problem.

Tuesday, March 10, 2009

Resizing a Amazon EBS Volume

I struggled to find the answer to resizing an existing Amazon Elastic Block Store Volume.

Here is how I resolved this

1. Created a snapshot of the existing volume (log into Amazons Console for this https://console.aws.amazon.com)

2. Create a new volume based on the snapshot

3. Attach this new volume to my Amazon Instance (after detaching the other volume)

4. SSH into my Amazon Instance

5. Enter the following, this checks the integrity of the disk 'e2fsck -f /dev/sdf'

6. Enter the following 'resize2fs /dev/sdf'

7. Mount the volume 'mount /dev/sdf /mnt/data-store'

Tuesday, April 15, 2008

Change the Date and Timezone in Centos

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

Saturday, March 29, 2008

Setting up VSFTPD

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'

Thursday, February 28, 2008

Install Flex 2 Alpha for Linux on Ubuntu

Make sure you have a copy of Eclipse 3.3 Classic (Europa Installed)

Download this from http://www.eclipse.org/downloads/

Create a directory in your home file called eclipse3.3

Extract eclipse into this directory

Make sure you have the latest version of Java Installed (ie. Version 1.6)

and make sure it is set as the default Java sudo update-java-alternatives

Download Flex for Linux http://labs.adobe.com/technologies/flex/flexbuilder_linux/

chmod +x flex* (to allow you to execute the download file)

follow the installation process and select the eclipse installation that you have created above when prompted by the flex installer

Saturday, October 6, 2007

Create a Virtual Server with Apache, VMWare and Blue Dragon

This is a brief guide to creating a VMWare Server that runs Centos Linux, PHP, MySQL, BlueDragon on Apache. It also briefly shows how you can run this so that the files being served in apache are running from a windows machine, which makes it perfect for a testing environment.

To begin

Download Centos5 from ThoughtPolice (www.thoughtpolice.co.uk) and unzip the VMWare image file

Load the file in VMWare Player

Once loaded log in username:root password:thoughtpolice
enter 'yum install apache2' (installs apache)
enter 'yum install mysql-server' (installs mysql server)
enter 'yum install php-mysql' (installs the plug ins for php and mysql'
enter 'system-config-securitylevel' (open port for apache www)

Create and share a windows directory called www and create a user on the windows machine called 'linux' with a password of 'linux'

On the virtual server enter 'mkdir /mnt/www' (creates a directory which you will mount the windows share on)

Then enter 'vi /etc/fstab' and add the line at the bottom of the file by pressing '*' then 'a' and adding //192.168.79.1/www /mnt/www rw,user=linux,password=linux 0 0 (the ip address at the front of this line is the ipaddress of the windows computer)

after this enter 'mount /mnt/www' this should mount successfully, if not you may want to check any firewall settings on the windows machine to make sure it will allow access from the ip address of the vmware server. You can check the ip address on a linux computer by entering (ifconfig)

Download the BlueDragon Script from www.newatlanta.com

Copy in the BlueDragon script to install into the windows shared directory you created
browse to the directory you created earlier on the linux machine 'cd /mnt/www' then copy the Blue Dragon script onto the Linux Machine 'cp bluedragonscript /home' make sure the blue dragon script has execute rights 'chmod +x bluedragonscriptname'

Browse to the home directory 'cd /home' and run the script 'sh bluedragonscript'

Accept all the defaults and make sure you select Apache as the option of webserver

Automatic Startup of BlueDragon 'ln -s /etc/rc.d/init.d/BlueDragon_Server /etc/rc.d/rc3.d/K95bluedragon' and 'ln -s /etc/rc.d/init.d/BlueDragon_Server /etc/rc.d/rc3.d/S95bluedragon'

Create a directory for apache conf files 'mkdir /mnt/www/conf' this is where we will hold .conf files for virtual hosting

Give apache access to your folder 'chgrp -R apache /mnt/www'

Start mysql /etc/init.d/mysqld restart

Set a password for mysql '/usr/bin/mysqladmin -u root password 'password'

Make sure mysql starts on bootup 'chkconfig mysqld on'

Make sure apache starts on bootup 'chkconfig httpd on'

Make sure you download the mysql jar odbc connector file from the mysql website. This needs to be copied into the bluedragon lib directory (/usr/local/NewAtlanata/BlueDragon_Server_70/lib) (make sure the correct permissions exist for this file), you can download it into the windows directory and copy it across from the virtual server.

Download phpMyAdmin from http://www.phpmyadmin.net/home_page/downloads.php copy it across into the directory /var/www/html on the virtual server. Then rename the folder to phpMyAdmin.

Should then be able to browse to this at http://ipaddressofvmaware/phpMyAdmin

The username should be root and the password as password as we set above.

Tuesday, August 21, 2007

T3G Sierra 580 Wireless Card connecting with Ubuntu 7.04

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

Saturday, August 18, 2007

Connect to a remote NFS Server

Enter the following commands on the server you want to share
sudo gedit /etc/exports

Then enter the following replacing the ipaddress I have below with your own, you can remove the last digits of your ipadress an replace with a 0 for anyone to access from that ip range
/pathtoshare 172.16.197.0/255.255.255.0(ro,sync)

Reload the Exports File
sudo exportfs -r

On the client machine set up a directory up to mount to
sudo mkdir /mnt/www

Then edit your fstab file
sudo gedit /etc/fstab

and add
172.16.197.1:/pathtoshareremote /pathtosharelocal nfs rsize=8192,wsize=8192,timeo=14,intr

Friday, August 17, 2007

Guide : Installing Skype on Ubuntu Feisty

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

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

Wednesday, August 8, 2007

Guide : Ubuntu and Backing up to Amazon S3

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.

Wednesday, August 1, 2007

Guide : Starting Eclipse using a different Java Version

The following shortcuts are on Ubuntu Feisty

Create a shortcut with the path as follows

/usr/bin/eclipse -vm /usr/lib/jvm/java-6-sun-1.6.0.00/jre/bin/java


or in the eclipse.ini file add the following

-vm
/usr/lib/jvm/java-6-sun-1.6.0.00/jre/bin/java

Saturday, July 28, 2007

Guide : VMWare Share Folders with Windows from Ubuntu

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.