venerdì 27 agosto 2010

Install Trac on Linux Fedora 13

Hands on how to install Trac on Fedora 13.

From root, install Trac and fcgid module for apache:
# yum install trac 
# yum install mod_fcgid

Create a test project, I take /tmp/test as my project folder:
# trac-admin /tmp/test initenv

And try it: start the server and navigate to http://localhost:8000/:
# tracd --port 8000 /tmp/test

It work, I hope :)
Create the folter for apache:
# trac-admin /srv/trac/zonablog deploy /tmp/test2
# mv /tmp/test2/htdocs/  /tmp/test/
# mv /tmp/test2/cgi-bin/ /tmp/test/
# rm -rf /tmp/test2
# chown apache.apache -R *

Edit this file /etc/httpd/conf.d/trac.conf.
Comment all content or remove and insert the row below:
 <Directory /tmp/test/>  
  Order allow,deny                                                                                      
  Allow from all                                                                                       
 </Directory>  
 ScriptAlias /trac/ /tmp/test/cgi-bin/trac.fcgi/  
 DefaultInitEnv TRAC_ENV /tmp/test/  

Move your logo image in /tmp/test/htdocs/logo.jpg
And modifi the /tmp/test/conf/trac.ini in section [header_logo]:
[header_logo]
...
src = site/logo.jpg*
...

Restart apache:
# /etc/init.d/httpd restart

navigate to http://localhost/trac

I hope you have saved some time :)
Domenico

mercoledì 25 agosto 2010

Install memcached and memcache PHP extension on Linux Fedora 13

From root, install memcached server and start it:
# yum install memcached  
# /etc/init.d/memcached start  
install php pear and memcache extension:
# yum install php-devel  
# yum install php-pear  
# echo "extension=memcache.so" > /etc/php.d/memcache.ini  
restart apache
# /etc/init.d/httpd start  
and test with php page that you can found in the memcache's distribution http://pecl.php.net/package/memcache (attention that you have to modify the php source to redefine you memcached server instance $MEMCACHE_SERVERS[] = 'localhost:11211';)

martedì 24 agosto 2010

Enable log SQL and SLOW SQL on MySQL

Open /etc/my.cnf and under [mysqld] section insert:

 [mysqld]
...
 # * Logging and Replication  
 #  
 # Both location gets rotated by the cronjob.  
 # Be aware that this log type is a performance killer.  
 log = /var/lib/mysql/log/sql.log  
 log_slow_queries = /var/lib/mysql/log/sql.slow.log  
 long_query_time = 2  

And restart mysqld instance.