Jul 10

WE-USB, my (or Kahaf’s) first project is now up and running. You may visit it at http://www.we-usb.com

Quote for their homepage:

WE-usb is a free virtual memory stick service for you to simply store or share your personal photos, videos and documents online.

As stated above, the project was developed and delivered on behalf of Kahaf (software development startup).

It should be noted that I did the backend development for the site (in Ruby on Rails — RoR). Thanks to Gary and Nadeem for their cooperation during the course of the project.

written by ishaq

Jul 10

Recently I was trying to configure apache2 to act as a proxy to mongrel (Ruby on Rails), so I added the following directives to my httpd.conf

<virtualhost *>

    ServerName test.example.com
    <proxy *="">
        Order allow,deny
        Allow from all
    </proxy>
    # Proxy directives
    ProxyPass /phpmyadmin ! # don't want proxy forwarding for phpMyAdmin
    ProxyPass / http://localhost:3000/
    ProxyPassReverse / http://localhost:3000/
    ProxyPreserveHost on

    # Logfiles
    ErrorLog  /var/log/apache2/test.example.com.error.log
    CustomLog /var/log/apache2/test.example.com.access.log combined

</virtualhost>
</pre>
However, as soon as I used to restart apache after adding this code, it always threw 503 - Service Unavailable. The error log showed a number of lines like this one:
<pre>[Thu Jul 09 11:37:13 2008] [error] (13)Permission denied: proxy: HTTP: attempt to connect to 127.0.0.1:3000 (*) failed

In short it has to do something with permissions in SELinux which doesn’t allow httpd to connect to network and the solution is this command:

# /usr/sbin/setsebool httpd_can_network_connect 1

Thanks to the help found here and here.

written by ishaq