Follow me
Twitter
Posts
Comments

I do it barely and for me it’s kinda getting a headache every time I need to do it. I never remember exactly how it needs to be done. So here there are some steps in order to get a specific user using its home dir (usually ~/public_html/) with Apache. It will surely help me in the future and maybe it might help you too. :)

  1. Edit the /etc/httpd/conf/httpd.conf file.
    Change the ‘UserDir disabled’ line to ‘UserDir enabled <username>’.
    Uncomment the ‘UserDir public_html’ line.
    Also uncomment the whole ‘<Directory /home/*/public_html>’ section until the ‘</Directory>’.
  2. Apply the proper permissions:
    # chmod 711 ~<username>
    # chmod 755 -R ~<username>/public_html/
  3. Run the following commands so SELinux wouldn’t bother you:
    # setsebool -P httpd_enable_homedirs true
    # chcon -R -t httpd_sys_content_t ~<username>/public_html   # It looks like it’s not necessary. See dgrift’s comments below.
  4. Extra Tip: It looks like on PHP versions  >= 5.3.0, to allow the short tag ‘<?’ we need to set ‘short_open_tag = On’ in the /etc/php.ini.

Restart the httpd service and after it you should be able to access http://localhost/~<username>/

References:
http://fedoraproject.org/wiki/SELinux/apache
http://albertux.ayalasoft.com/2010/01/30/fedora-12-httpd-userdir-selinux-works/
http://www.yolinux.com/TUTORIALS/LinuxTutorialWebSiteConfig.html

UPDATE 1: Altered ‘setsebool httpd_enable_homedirs true’ into ‘setsebool -P httpd_enable_homedirs true’. Also added comment about the ‘chcon’ command. Thanks, dgrift.

Só pra deixar registrado!

Sem palavras…. ;)

Time definitely flies

It looks like it was yesterday that I firstly flew to EU to meet some Fedora guys at the FUDCon in Brno. At that time, September of 2008, I had just finished my GSoC application and lots of ideas were going around our minds (Me and Dimitris Glezos), mainly about what we should do about Transifex.

My first time in Greece, Dimitris’ country, allowed us to discuss many things, including the redesign of Transifex. I remember we realized we had in our hands an idea that, at least for us, could sound very promising and with lots of potential. We were kinda anxious and unsure on how we should push things on, but we had a shared common feeling -  We need to do something.

Time Flies by Bichuas (E. Carton)

Time Flies by Bichuas (E. Carton)

In a long short history, I came back to Brazil in November of 2008 and 3 months later I was working full time on Transifex as an Indifexian. February of 2009 was a mark for me. At that period, my life was kinda turned up side down, not in a bad way, just in a complete different way. New challenges and horizons  just shown up and it’s been like this until now, 1 year later.

Today we are not anymore 2 crazy guys, locked down in an apartment, ordering food and hacking most of the time during the night.  The team has increased and we are really happy about it. We keep working hard to hit our goals seeking ways to make ‘Translations a click away’. Talking about it, Transifex 0.8alpha is just out, be sure to take a look at the new features. ;)

Happy translations!

Steps with sudo command configured to the current user:

$ sudo yum install postgresql-server python-psycopg2

$ sudo service postgresql initdb
Initializing database: [ OK ]

$ sudo service postgresql start
Starting postgresql service: [ OK ]

$ sudo su – postgres

-bash-4.0$ psql

postgres=# CREATE USER transifex WITH PASSWORD ‘transifex’;
CREATE ROLE

postgres=# CREATE DATABASE transifex OWNER transifex;
CREATE DATABASE

postgres=# \q

-bash-4.0$ exit

$ sudo vim /var/lib/pgsql/data/pg_hba.conf

# “local” is for Unix domain socket connections only
local transifex transifex password # Add this line
local all all ident

$ sudo service postgresql restart

$ psql transifex transifex
Password for user transifex:
psql (8.4.1)
Type “help” for help.

transifex=>

transifex=> \q

# Bellow it assumes the Tx code is under ~/workspace/mainline/ and
# all the dependencies are installed. http://docs.transifex.org/intro/install.html

$ cd workspace/mainline/transifex/

$ vim settings/21-engines.conf

# Database configuration
DATABASE_ENGINE = ‘postgresql_psycopg2′
DATABASE_NAME = ‘transifex’
DATABASE_USER = ‘transifex’
DATABASE_PASSWORD = ‘transifex’

$ ./manage.py syncdb

$ ./manage.py migrate codebases # It shouldn’t be necessary :/

$ ./manage.py migrate

$ ./manage.py loaddata txcommon/fixtures/*

$ ./manage.py runserver 8080

That’s it!

This week we’ve gotten a request from translate.moblin.org for being able to login using unicode chars. They use a custom backend for authentication that allows, for example, Chinese chars in the username. Django seems to handle it pretty well, although the Django Admin Panel complains about it. As a solution, we’ve implemented a way to override the Django admin forms for creating and editing users, using a UnicodeRegexField.

That was a cool stuff. Here is a code example of an admin.py

« Newer Posts - Older Posts »