Archive for the ‘web development’ Category
bob on June 16th, 2008
Make sure before installing Ruby, zlib is installed in PHP. You can do this by running a simple script with this code.
<?php phpinfo(); ?>
Now you are ready for installation.
cd /usr/local/src
wget ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.2.tar.gz
tar xvzf ruby-1.8.2.tar.gz
cd ruby-1.8.2
./configure
make
make install
ruby rubytest.rb
If the installaiton is successful, then you will get a message “test succeeded”.
Install Ruby Gems
cd /usr/local/src
wget http://rubyforge.org/frs/download.php/5207/rubygems-0.8.11.tgz
tar xvzf rubygems-0.8.11.tgz
cd rubygems-0.8.11
ruby setup.rb all
This step involves execution of `ruby setup.rb` with arguments `config / setup / install` all together
gem query –local
OR
gem q -L
Listing all installed gems
Install Rails
gem install rails OR # (Enter Y for all dependencies)
gem install rails –include-dependencies
Install FastCGI
wget http://fastcgi.com/dist/fcgi-2.4.0.tar.gz
tar -xvzf fcgi-2.4.0.tar.gz
cd fcgi-2.4.0
./configure
make
make install
Install mod_fastcgi
wget http://www.fastcgi.com/dist/mod_fastcgi-2.4.2.tar.gz
tar -xvzf mod_fastcgi-2.4.2.tar.gz
cd mod_fastcgi-2.4.2
/path/to/apxs -o mod_fastcgi.so -c *.c
/path/to/apxs -i -a -n fastcgi mod_fastcgi.so
In Apache’s httpd.conf, add this line.
Include /path/to/httpd/conf/fastcgi.conf
Now, add this text to fastcgi.conf
cat > /path/to/httpd/conf/fastcgi.conf
User apache
Group apache
<IfModule mod_fastcgi.c>
FastCgiConfig -idle-timeout 900
AddHandler fastcgi-script .fcgi .fpl .rb
FastCgiIpcDir /tmp/fastcgi_ipc/
FastCgiSuexec /usr/sbin/suexec # To make FastCGI run as suexec. Use path to suexec
</IfModule>
Ctrl + D
mkdir /tmp/fastcgi_ipc/
chown -R apache.apache /tmp/fastcgi_ipc
chmod 700 /tmp/fastcgi_ipc/
service httpd restart
NOTE : In some systems, the ownership of fastcgi_ipc is done by Apache itself, but its safe to include these steps in your routine.
Related files: /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/dispatches/dispatch.fcgi # OR ~USER/<app_name>/public/dispatch.fcgi # Log file declaration & all
Install gem bindings
To install gem bindings for Fastcgi and MySQL
gem install fcgi
gem install mysql
Testing
1. Install Test Application
cd ~USER
rails testapp # Create a test application named ‘testapp’
cd testapp/
./script/generate controller test
cd ~USER/httpdocs
ln -s ~USER/testapp/public rails # In order to access the test application ‘~USER/testapp/public’ from the browser
In order to allow symlinks, enter the following in to ~USER/httpdocs/.htaccess
Options Indexes +FollowSymLinks
Now you have to set the correct ownership and permissions for the test application. here is the cample; example:
cd ~USER
chown -R USER.psacln testapp
chmod -R 755 testapp
chown -R USER.psacln httpdocs/rails
chmod -R 755 httpdocs/rails
Create Test Pages
cd ~USER
cd ~USER/testapp/app/controllers
Create a file called test_controller.rb and put in the following code:
cat > test_controller.rb
class TestController < ApplicationController
def hi
render :text => ‘Hi world’
end
def hello
end
def index
render :text => ‘Hi! This is the Index.’
end
end
Ctrl + D
Now create the test page.
cat > ~USER/testapp/app/views/test/hello.rhtml # The test page
<html>
<head>
<title>Hello World</title>
</head>
<body>
<h1>Hello from Rails!</h1>
<p>The current time is <%= Time.now %></p>
</body>
</html>
Ctrl + D
Now just access the URL: http://yourdomain/rails/test/hi
NOTE:- Make sure change ownership of the test pages you created.
Now, You have installed Ruby On Rails
bob on March 28th, 2008
Name Platform Supported databases Latest release Licenses
Apache Lenya Java, XML, Apache Cocoon 2.0 Apache License
b2evolution PHP MySQL 1.10.3 “Key West” GPL
BLOG:CMS PHP MySQL GPL
blosxom Perl Flat-file database 2.0 MIT
Bricolage Perl PostgreSQL 1.10.3 BSD
CivicSpace PHP MySQL 0.8.3 Open source, detail unknown
CMSimple PHP Flat-file database 3.0.1 Affero
Contrexx Open Source edition PHP MySQL 1.2 Free for non-commercial use
Cyclone3 Perl, XUL, JavaScript, C, Java MySQL and any Perl DBI 3.0 GPL
Daisy Java, XML, Apache Cocoon MySQL 2.1 Apache License
Dokuwiki PHP Flat-file database 2007-06-26 GPL
DotClear PHP MySQL Beta version 2.0 supports PostgreSQL 1.2.7.1 GPL
DotNetNuke ASP.NET Microsoft SQL Server 4.8.1 BSD
Drupal PHP MySQL or PostgreSQL 6.1 GPL
e107 PHP MySQL 0.7.11 GPL
Exponent PHP MySQL/PostgreSQL 0.96.6 GPL
eZ Publish PHP MySQL/PostgreSQL/Oracle/Microsoft SQL Server 4.0.0 GPL
Fedora Java MySQL or Oracle 2.2 Educational Community License
Habari PHP MySQL or SQLite 0.4.1 Apache License
ImpressCMS PHP MySQL 1.0 GPL
Jahia Java HyperSonic SQL, PostgreSQL, MySQL, Oracle 5.0.3 JCDDL & JSSL
Joomla! PHP MySQL 1.5.2 GPL
KnowledgeTree Document Management System PHP MySQL 3.5 GPL
Lyceum PHP MySQL 1.0.2 GPL
Magnolia Java JCR 3.5.4 GPL
Mambo PHP MySQL 4.6.3 GPL
MediaWiki PHP MySQL, PostgreSQL 1.12 GPL
Midgard CMS PHP (Midgard framework) MySQL 1.8.4 LGPL
MODx PHP MySQL 0.9.6.1 GPL
MoinMoin Python Flat-file database 1.6.2 GPL
Movable Type Perl, mod_perl, FastCGI MySQL or MS SQL server or Oracle or PostgreSQL or SQLite 4.1 GPL
Nucleus CMS PHP MySQL 3.32 GPL
Nuxeo CPS Python ZODB 3.4.3 GPL
Nuxeo EP Java PostgreSQL, MySQL, Oracle, SQL Server, Ingres 5.1.3 LGPL
OneCMS PHP MySQL 2.5 GPL
OpenACS TCL AOLserver PostgreSQL/Oracle 5.1.5 GPL
OpenCms Java MySQL, Oracle, PostgreSQL, SQL Server, DB2, HSQL 7.0.4 LGPL
phpCMS PHP Flat-file database 1.2.2 GPL
PHP-Fusion PHP MySQL 6.01.13 GPL
PHP-Nuke PHP MySQL 8.0 GPL
phpWCMS PHP MySQL 1.3.3 GPL
phpWebSite PHP MySQL or PostgreSQL 1.1.0 LGPL
PhpWiki PHP Flat-file database/MySQL/PostgreSQL etc. GPL
PmWiki PHP Flat-file database 2.1.27 GPL
PostNuke PHP MySQL .764 GPL
PyLucid Python MySQL, PostgreSQL, SQLite 0.8.0 GPL
Radiant Ruby MySQL, PostgreSQL, SQLite 0.6.4 MIT
Scoop Perl on mod_perl MySQL 1.1.8 GPL
Serendipity PHP + Smarty SQLite, PostgreSQL, MySQL, MySQLi 1.2 BSD
SilverStripe PHP MySQL 2.2.1 BSD
SiteFrame PHP + Smarty MySQL 5.0.2 Creative Commons
Slash Perl on mod_perl MySQL GPL
SPIP PHP MySQL 1.9.2 GPL
TangoCMS PHP MySQL 1.0.8-Osprey GNU/GPL 2
Textpattern PHP MySQL 4.0.6 GPL
TGS PHP MySQL 0.3.2 GPL
TikiWiki PHP MySQL and others using ADOdb 1.9.10.1 LGPL
TWiki Perl Perl DBI compatible 4.1.2 GPL
Typo Ruby on Rails MySQL, PostgreSQL, SQLite MIT
TYPO3 PHP MySQL, PostgreSQL, Oracle 4.1.5 GPL
Quick.Cms.Lite PHP Flat-file database 2.0 GPL
WebGUI Perl on mod_perl MySQL GPL
whCMS PHP MySQL 0.102 GPL
WordPress PHP MySQL 2.3.3 GPL
Xaraya PHP with XHTML/XML/XSLT MySQL, PostgreSQL, SQLite using ADOdb and Microsoft SQL Server with Creole 1.1.3 GPL
XOOPS PHP MySQL 2.0.18 GPL
XOOPS Cube PHP MySQL 2.1.3 BSD
Zena Ruby MySQL alpha MIT
Freecms PHP MySQL .0.1 GPL
bob on March 15th, 2008
Here are 4 reasons why you should care about Web standards; however the benefit is much more than what illustrated here while you make your website web standards compliance.
1. Search Engine Optimization Initiative
The search engine spiders find easier to index site, and the clean and valid code, Also the Google sitemaps protocol has become a de-facto Web standard. Standards help users by reducing load time, search engines prefer websites that are built with accessibility in mind.
2. Accessibility
Accessibility is the practice of making website content available to everyone, including users with disabilities. As an additional benefit to making site content more accessible to specific audience, Accessible websites avoid putting important information in images, make good use of alt tags, avoid using PDFs for everything, limit the use of JavaScript and tables, and more.
3. Lower Total Cost of Ownership
Websites that are built upon standards are easier to update and maintain in the long run. Semantic code, where the information is marked as to its purpose or meaning rather than its appearance, makes redesigns less costly. Bandwidth costs for high-traffic websites can be significantly reduced due to the smaller file sizes usually achievable with table less code (ESPN rebuilt their website and estimated a savings of 2 Terabytes per day in bandwidth).
4. Cross-browser, Cross-platform, Cross-device Compatibility
By building websites to adhere to standards, your chances improve of having your website perform well in multiple web browsers, on multiple operating systems, and even on multiple devices which are trendy these days.
bob on March 12th, 2008
Here is the way you can send HTML email by using the Active Server Pages using the following code.
<%
Dim htmlMess ‘ THIS STORES THE HTML CODE
‘ PLEASE TAKE CARE ABOUT YOUR DOUBLE QUOTES
htmlMess = “<html><head><title>HTML message in Email</title>”
htmlMess = htmlMess & “<style>”
htmlMess = htmlMess & “h1{font-family : Arial; font-size : 16pt; font-weight : bold; color: #000000;}”
htmlMess = htmlMess & “p{font-family : Arial; font-size : 10pt; color: black; text-align : justify;}</style></head>”
htmlMess = htmlMess & “<body bgcolor=’#ffffff’>”
htmlMess = htmlMess & “<h1>My HTML Message from an ASP Page!</h>”
htmlMess = htmlMess = & “<p>This message has been written in HTML format.</p></body></html>”
‘ FIRST I’LL SHOW HOW TO DO IT IN CDONTS, AND THEN IN SMTP
Dim oSendMailer
‘ CDONTS BEGINS
Set oSendMailer = Server.CreateObject(”CDONTS.NewMail”)
oSendMailer.To = “ToEmail”
oSendMailer.From = “FromEmail”
oSendMailer.Subject = “Subject Matter”
‘ THE FOLLOWING ARE THE EXTRA SETTINGS:
oSendMailer.BodyFormat = 0
oSendMailer.MailFormat = 0
oSendMailer.Body=htmlMess
oSendMailer.Send
set oSendMailer = nothing
‘ CDONTS ENDS
‘ SMTP BEGINS
Set oSendMailer = Server.CreateObject(”SMTPsvg.Mailer”)
oSendMailer.FromAddress = “FromAddress”
oSendMailer.FromName = “FromName”
oSendMailer.AddRecipient “Recipient Name”, “RecipientEmail”
oSendMailer.RemoteHost = “mail.yourdomain.com”
oSendMailer.Subject = “Subject Matter”
oSendMailer.ContentType=”Text/HTML”
oSendMailer.BodyText = htmlMess
oSendMailer.SendMail
set oSendMailer = nothing
‘ SMTP ENDS
%>