Skip to main content

Posts

Showing posts from 2011

allowing public access to amazon s3 bucket

You might need to give public access to bucket contents, for example if you use the bucket to load images for your site. Simple GUI option supplied by Amazon only gives access for a specific files but if you need a whole bucket, you have to use policy.

To edit policy, in GUI go to 'Bucket => Properties => Add Bucket Policy'
And add for example (just change yourbucketname with the name of your bucket: {
    "Version": "2011-10-24",
    "Statement": [
        {
            "Sid": "AddPerm",
            "Effect": "Allow",
            "Principal": {
                "AWS": "*"
            },
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::yourbucketname/*"
        }
    ]
}
save it and policy is applied.

Provided by:SiQ systems, Cloud experts

Upgrading PHP in CentOS 5

CentOS 5.x comes with PHP 5.1, this version is outdated and you probably would want to upgrade it. I used Atomic repository.
You can add it by running following command: wget -q -O - http://www.atomicorp.com/installers/atomic.sh | sh Now you can update PHP: yum update php yum update php-mcrypt (you might also need to update mysql) Verify version of running PHP: php -v And that all modules working as order: php -m Restart Apache, you are all set.

Provided by:SiQ systems, Cloud experts

"SQL Error: 13: Can't create/write to file" on other then /tmp directories (apparmor)

If you get SQL Error: 13 after changing tmpdir parameter in you my.cnf first check permissions in a new directory. If permissions are correct you might be having an issue with AppArmor. AppArmor is a GNU security module for the Linux kernel and it might prevent MySQL from writing to the new directory.Run: aa-status To verify if it`s on. If so you will get something like: profiles are loaded profiles are in enforce mode Edit this file: /etc/apparmor.d/usr.sbin.mysqld and append your new temp directory in the end. #### /usr/sbin/mysqld { ... /new_tmp/ r, /new_tmp/* rw, } Reload AppArmor with: /etc/init.d/apparmor reload Thats it.

Mounting S3 bucket as a file system on Linux (Ubuntu)

In order to mount S3 bucket on Linux you need to install ssh file system (FUSE) libraries first.
Install: aptitude install build-essential libcurl4-openssl-dev libxml2-dev libfuse-dev comerr-dev libfuse2 libidn11-dev libkadm55 libkrb5-dev libldap2-dev libselinux1-dev libsepol1-dev pkg-config fuse-utils sshfs Follow the instantiations in S3fs WIKI: https://code.google.com/p/s3fs/wiki/InstallationNotes It was using http download, not SVN. Create a mount point for the new file system (ex. mkdir /mnt/s3) Mount the file system: ex.: s3fs tmpname -o use_cache=/tmp -o allow_other /mnt/s3 this mount comes with option of using a tmp as a cache for S3 content, you can clean that cache as you feel fit.

You can also add your bucket to /etc/fstab

s3fs#mybucket /mnt/s3 fuse allow_other,url=https://s3.amazonaws.com 0 0

Update for mounting S3 bucket on CentOS 5.5 and other old distros.
CentOS 5.5 comes with old FUSE version 2.7.4 as latest in it`s repository.
You need to manually compile version 2.8.4 be…

Clearos, OpenVPN and mutiwan issue

Just had some problems running OpenVPN in mutiwan mode on ClearOS 5.2 SP1.
Sometime connection got dropped down and user could not reconnect. Problem was solved then i disabled on of the multiwan NICs. What fixed the problem was setting OpenVPN to work in TCP mode instead of UDP. I guess packets were sent using wrong NIC on UDP based connections.
Edit /etc/openvpn/clients.conf
and set "proto tcp"

Provided by:SiQ systems, Cloud experts