How to install & Configure MySQL server on CentOS 5 x64 -
1. Login as root user to server.
2. Execute following commands from shell:
# yum install mysql mysql-server mysql-devel
This command will check system configuration and calculates the dependencies required to run MySQL. It will display the list of packages need to be installed and in the end:
……
Total download size: 35 M
Is this ok [y/N]: y
Press ‘y’ like above. This will install mysql server and mysql client on you machine.
3. Now mysql is installed on your server. Now if you execute the following command to connect to mysql (like me)
# mysql
And error message like this below is printed :
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)
Then it means mysql is not running. You need to start the the mysql service first. So execute following command:
# /etc/init.d/mysqld start
It will print the following message:
Starting MySQL: [ OK ]
It means everything is fine. MySQL is up and running and ready to connect on default port 3306.
4. Now you can connect to mysql from shell prompt. Execute following command:
# mysql
You might get this error message:
ERROR 1045 (28000): Access denied for user ‘root’@'localhost’ (using password: NO)
Now you might think that you have not provided password that is why above error message. So you try again using -p option like this
# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user ‘root’@'localhost’ (using password: NO)
Oops error message again. The MySQL is installed with blank password, so you must be wondering what went wrong. But you need to check with which user name mysql has been installed. (In my case MySQL is installed with default user ‘mysql’).
You need to check ‘/etc/my.cnf’ file and check following ‘user’ property in ‘mysqld’ section:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
So like above ‘mysql’ is default user with blank password. Now you can connect as follow (As password is blank so hit enter when asked to enter password.):
# mysql -u mysql -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.0.77 Source distribution
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
mysql>
5. OK. Good going till now. When you try to execute “use mysql;” command and if you get error message like this -
ERROR 1045 (28000): Access denied for user ”@’localhost’ (using password: NO)
Then you must be wondering what the hell happened. I mean even If not root then atleast mysql user should have been able to execute all the SQL statements like - create database, alter database, or even a simple use or select statement, but it is not happening. Somehow it seems that mysql user has no priviledges. Now follow below points.
6. Stop mysql server by executing following command:
# /etc/init.d/mysqld stop.
Once you get the success message go to step 7.
7. Start MySQL in safe with skipping grant tables that stores the password. Execute following command:
# mysqld_safe –skip-grant-tables
8. Now connect to mysql server as root user :
# mysql –user=root
9. Now change the password by executing following commands and then exit:
# mysql > update user set Password=PASSWORD(’new-password’) where user=’root’;
# mysql > flush privileges;
# mysql > exit;
Here new-password should have value which you want to have for root user while connecting to MySQL server.
10. Now Reconnect to mysql-server using ‘new-password’ you set in step 9:
# mysql -u mysql -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.0.77 Source distribution
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
mysql>
Now you can do what you want to do. Bingo! That completes the MySQL installation and Configuration.
Softwares Used:
openLDAP (Windows edition)
LDAP Browsers(Jxplorer, LDAPsoft admin tools, Softerra LDAP admin etc)
Download Softwares:
1. You can download openLDAP windows edition from the following location:
http://www.userbooster.de/en/download/openldap-for-windows.aspx
2. you can download browsers from the locations given below:
Softerra LDAP admin: http://www.ldapadministrator.com/download.htm
LDAPsoft admin tool: http://ldapadmin.sourceforge.net/download/ldapadmin.html
JXPLORER: http://jxplorer.org/
Installing openLDAP:
1. Follow the instructions and choose your host as “localhost” or an “IP address”
2. Choose the port and SSL-port as you may want to use or can let it by default to 389 and 636 respectively.
3. Select a database for directory you want to use: BDB or LDAP (we have used BDB i.e berkely’s DB)
4. NEXT -> choose a password for your root directory, by default it would be “secret”
5. NEXT-> install-> Finish.
Using an LDAP Browser:
Note: Any of the Browsers except JXPLORER because it causes problem on updating everytime. We are not able to fix it at our end, may be you are lucky
For this blog, we have used “LDAPsoft LDAP admin”
1. Start the server using command: “slapd –d 1″ from the directory where OpenLDAP is installed
2. Install LDAPsoft LDAP admin
3. Open “LDAPsoft LDAP admin” and create new connection to LDAP.
4. Specify the connection name - it could be any friendly name you may want to use
5. Specify the Hostname as “localhost” or “IP Address” as set at the time of installing OpenLDAP
6. Specify the port you are using for LDAP
7. Choose the version of LDAP (in Protocol drop-down) you are using as “LDAP v3″
8. Specify the Base DN as “dc=maxcrc,dc=com” or you may choose to click on “Fetch Base DNs” button to automatically fetch the Base DNs
9. You may want to test the connection by clicking on “Test Connection” button
10. Got to NEXT and select “Simple Authentication” method. For this, you will be needed to provide Bind DN and Password which would be “cn=Manager, dc=maxcrc, dc=com” and “secret” respectively. The Bind DN can also be populated by clicking on the button, which is on the right hand side of the Bind DN text field.
12. NEXT->Finish.
Now you have a complete connection with openLDAP and you can create your own OUs and CNs .
|
Comparison Parameter |
Liferay |
Drupal |
Comments |
General |
|||
|
About the Product |
· Completely Open Source · Most popular enterprise portal server · Suitable for building internet/intranet portals, social networking sites and front end for enterprise level web applications |
· Completely Open source · CMS solution · Suitable for building static, dynamic web sites and social networking applications |
|
|
Available Versions |
Available in community and enterprise editions both. |
Available in community and enterprise editions both. |
|
|
License |
Available in business friendly MIT-License |
Available in GPL |
|
|
Platforms Supported |
Full support for Windows, Linux, Solaris, Mac and other platforms. |
Full support for Windows, Linux, Solaris, Mac and other platforms. |
|
|
Databases Supported |
There is an abstraction layer of Hibernate and support for multiple databases like My SQL, SQL Server, Oracle, IBM DB2 in a seamless manner |
MySQL supported, support to additional databases can be added though. |
|
|
Technology Stack |
Based on Java/J2EE. Additional frameworks/Libraries are Spring, Hibernate, Spring MVC, Velocity/Freemarker Template engines are used. |
Based on PHP Technology Stack. Supports MVC architecture and frameworks like smarty. |
|
|
Learning Curve Involved |
Learning curve is high, as it’s an enterprise level portal solution. |
Learning curve is high. |
Learning curve from the development perspective. From usability perspective both products are quite easy to use. |
Features |
|||
|
CMS |
Basic CMS capabilities |
Full Fledged CMS |
|
|
DMS |
Basic DMS Capabilities |
No DMS component |
|
|
Multi Tenancy |
Extra ordinary support for Multi Tenancy |
Limited support for Multi tenancy. |
|
|
Social Networking Support |
Very good support for social networking features. |
Very good support for social networking features. |
|
|
Ease of Customization |
Difficult to customize |
Difficult to customize |
|
Enterprise Features |
|
|
|
|
Architecture |
Modular and cake layered architecture, full support for MVC, SOA and RESTFUL apis |
Modular Architecture, Comparable to MVC, No SOA, Restful Architecture |
|
|
Performance |
Enterprise level product and offers optimized performance. |
Known performance issues |
|
|
Security |
Highly Secured |
Highly Secured |
|
|
Stability |
Highly Stable |
Stable |
|
|
Scalability |
Highly scalable solution |
Scalability is difficult to improve. |
|
|
Ease of Integration |
Easy integration with third party tools. |
Based on open standards and RESTFUL apis, hence easy to integrate with third parties |
|
|
Migration to other platforms |
Offers easy migrations and upgrades |
|
|
|
Community and support |
Community is not very strong, less help available on forums. |
Very strong community and lot of help is available. |
|
|
Product Maturity |
Quite matured product, currently 6.0 is the latest liferay edition. |
Quite matured product, currently 6.0 is the latest liferay edition. |
|
First of all extract your theme into a folder and open it to see all the files.
If your theme has only one sidebar, then most probably you will NOT find a functions.php file in your theme folder. In that case you will have to create this file yourself.
Create a new blank functions.php file or open existing file and put this code into that file:-
<?php
if ( function_exists(’register_sidebars’) )
register_sidebars(2);
?>
These lines of code actually tells Wordpress to register two sidebars for your theme . If the functions.php file already present in your theme folder then you just have to edit the number according your requirement and save the file.
You can change this number if you want more sidebars. Now, when you go to your Wordpress admin section, you will see two sidebars listed there. You can drag your widget items into any of the sidebars.
Now If your theme has only one sidebar, try to locate a file called sidebar.php in your theme folder.
we are trying to modify the theme for two sidebars, let’s rename sidebar.php to sidebar1.php and make a new blank file called sidebar2.php.
Put this code into sidebar2.php and save the file :-
<div>
<ul>
<?php if ( function_exists(’dynamic_sidebar’) && dynamic_sidebar(2) ) : else : ?>
<?php endif; ?>
</ul>
</div>
Both these sidebars need to be called from the index.php file in order to include them in your theme.
In your index.php file search <?php include (TEMPLATEPATH . ‘/sidebar.php’); ?>
Edit this code and change the words sidebar.php to sidebar1.php.
Now take a look at the index.php file carefully and find a suitable place to insert the second sidebar. This might involve modifying your layout or adding new divs. Once you find a suitable place, place the following code there :-
<?php include (TEMPLATEPATH . ‘/sidebar2.php’); ?>
Save the index.php file and now preview your theme.
I have noticed that several people are searching for “How to set page title, Meta keyword/description in Cakephp 1.3” so this is a quick tip for them: -
You can change the title of the page from the controllers function using $pageTitle in CakePHP 1.2.
Your layout needs to include the “$title_for_layout” variable, at least between the <title> and </title> tags in the head of the HTML document.
<?php
class RecipesController extends AppController {
function quickSave() {
$this->pageTitle = ‘My search engine optimized title’;
}
?>
You can also set the page title from the view .CTP file using
$this->pageTitle (‘Algoworks.com’);
But, this has been removed in cakephp 1.3.
Yes it’s possible to set it from controller action, but what about
static pages for Pages controller? Pages controller has only one
action ‘display’. So setting title from controller doesn’t “work” for
many pages!
But.. I found the solution to set title from view (in .ctp file):
<?php $this->viewVars['title_for_layout']=”Page title” ?>
<?php $this->viewVars['meta_keywords']=”Page Keyword” ?>
<?php $this->viewVars['meta_description']=”Page Description” ?>
And Your layout needs to include
<meta name=”keywords” content=”<?php echo $meta_keywords; ?>”>
<meta name=”description” content=”<?php echo $meta_description; ?>”>
lines, at least between the <title> and </title> tags in the head of the HTML document.
Hello All,
Finally after researching for hours we got the solution to call a model inside a helper class. we hope this helps you.
In a method of your helper class just use : $this->ModelName=& ClassRegistry::init(’ModelName’);
And now $this->ModelName has all the property of the model.
Do let us know if you are unable to use the same.
Happy Algo-blogging.
Hello All,
This is something interesting to implement.
Are you bored with .ctp extension in cakephp view file and want to have something interesting which helps to make coding even faster in cake, here is the solution to make .ctp extinsion change to .php
In your controller just add “ var $ext = ‘.php’ ” and make all your template files as .php insted of .ctp.
For example.
class UsersController extends AppController {
var $name = ‘Users’;
var $helpers = array(’Html’, ‘Form’,'Session’,'Javascript’);
var $components = array (’Auth’, ‘Cookie’, ‘RequestHandler’);
var $ext = ‘.php’;
function index() {
// Do something
}
}
Now create a file in app/views/users/index.php
The only use as far as i see of doing this is to make the coding editor friendly as the editor understand .php extension and not .ctp
Hope this tutorial helped you
Thanks and happy Algo blogging
Open source CMS systems are the CMS systems that are available with complete source code and can be customized to fit the needs of your business.
Parameters to identify you need a CMS:-
• You need to change the content regularly
• You need to manually update the content
• There are multiple users managing the content
• A lot of time is spent in content update
• You have multiple versions of the same content
• You have multi-lingual content
• Same content is available at multiple locations and is inconsistent
Benefits of Open Source CMS
• No upfront cost and cheaper to implement – You do not need to pay any licensing cost which can be heavy sometimes. You might need to get a few customizations done based on requirement and would need to pay a development team for that.
• Complete flexibility of development and customization – You can customize the CMS based on your requirements and tweak the code/design as your need.
• Easy to find development teams and users worldwide– There are a lot of software service vendors available who specialize in open source CMS development.
• Features/extensions available- You can find a lot of features developed over the CMS and available for free or for some nominal fee.
• Ease of use: - You can get the CMS customized to be used in the way you would like to use it.
Drawbacks of Open Source CMS
• No direct support – There is no support available, you would need to depend on your technical team.
• Dependence on IT team – You would need to be more dependent on an IT team.
• Security Risks – As the code is available to everyone there are security holes that hackers can misuse.
• Documentation - Open source systems are not very well documented.
Algoworks believes in Open source CMS development and specializes in implementation, customization, support and migration from existing systems to Alfresco, Joomla, Drupal, Typo3, DNN CMS systems.
Hello friends getting lightbox/modalbox in to the application is really an addon to the site.
Here are few simple steps to get lightbox/modalbox working on your cakephp site.
change the ‘ControllerName’ as per your need.
Likeways you can show any page in a light box or modalbox.
Do let us know in case of any issue.
If you want to add fields in registration form on joomla 1.0 its easy because there you can easily add new variables in user class, but joomla 1.5 architecture is much different from 1.0 . So you can follow given steps to add new fields in joomla 1.5:
Step 1: Add new fields in user table in database.
example:
ALTER TABLE jos_users ADD occupation VARCHAR (100) NO NULL AFTER name;
and
ALTER TABLE jos_users ADD position VARCHAR (100) NO NULL AFTER occupation;
Step 2: Modify the user class to include the new files in libraries/joomla/table/user.php
Example: Add new variables in user class as given below
var $occupation = null;
var $position = null;
Step 3:Now you can modify the code (default.php) which displays the registration page on Root Folder/components/com_user/view/register/tmpl/default.php
Example:
<tr>
<td width=”30%” height=”40″>
<label id=”myoccupation” for=”occupation”><?php echo JText::_( ‘Occupation’ ); ?>: </label> </td>
<td>
<input type=”text” name=”occupation” id=”occupation” size=”40″ value=”<?php echo $this->user->get( ‘occupation‘ );?>” class=”inputbox required” maxlength=”50″ /> * </td>
</tr>
Now your new fields are available on your registration form.
enjoy…..