Archive for November, 2012

Redirecting sub-domain to sub-directory

Recently I moved the EWEA blog from the sub-domain into the sub-directory of the EWEA website.

Before: http://blog.ewea.org/
After: http://www.ewea.org/blog/

To handle the redirect I put in the following into /etc/httpd/conf.d/vhosts.conf

<VirtualHost *:80>
# EWEA BLOG
ServerName blog.ewea.org
Redirect 301 / http://www.ewea.org/blog/
RedirectMatch 301 /(.+) http://www.ewea.org/blog/$1
ErrorLog  logs/blog.ewea.org-error_log
CustomLog logs/blog.ewea.org-access_log common
</VirtualHost>

The Redirect clause redirects all the traffic from the sub-domain to the sub-directory.
The RedirectMatch is to remap existing URLs to the sub-directory to avoid broken links.

(Taken from http://stackoverflow.com/questions/9397089/redirect-blog-mydomain-com)

Passwordless ssh for rsync, etc.

First you need to generate an RSA key on the source server.

ssh-keygen -t rsa

By default, the following files are created: /root/.ssh/id_rsa and /root/.ssh/id_rsa.pub.

Go to /root/.ssh/ and rename the files to the following format:

id_rsa –> server_prv_key and id_rsa.pub –> server_pub_key (where “server” is the hostname)

Next copy the contents across to destination server

Copy contents of server_pub_key and paste it into the /root/.ssh/authorized_keys on the destination server.

Now you can ssh without a password from one machine to another

ssh -p 10022 -i "/root/.ssh/server_prv_key" root@destination

Typo3 textarea

The latest version of Typo3 locks the frame of Quixplorer divs so you cannot resize the shape.

By editing this file:

/typo3/templates/template_page_backend.html

And adding:

###TITLE###
###META###
###CSS_INCLUDE###
###CSS_INLINE###
###JS_LIBS###
###JS_INCLUDE###
###JS_INLINE###
###HEADERDATA###
<!--###POSTJSMARKER###-->
<style type="text/css">
textarea {resize: auto;}
</style>
</head>
###BODY###
###JS_LIBS_FOOTER###
###JS_INCLUDE_FOOTER###
###JS_INLINE_FOOTER###
###FOOTERDATA###
</body>
</html>

I was able to unlock the resizing.