Magento
Steps to Install Magento On Ubuntu
In this article, we are going to discuss about How to install Magento on Ubuntu. Magento is a feature-rich, open-source, enterprise-class platform that offers merchants a high degree of flexibility and control over the user experience, catalog, content and functionality of their online store.
Here are the steps to install Magento on ubuntu with sample data.
Create a database :
Use the below command to create a database for magento on ubundu.
mysql -u root -p
mysqladmin -u root -p create magento_test;
mysqladmin -u root -p reload;
GRANT ALL ON magento_test.* TO magento_test@localhost IDENTIFIED BY 'magento_test_password'
Install Magento :
This is almost the same as above, except you don't need to know the directory name. You will only have to replace DBHOST, DBNAME, DBUSER, and DBPASS.
wget http://www.magentocommerce.com/downloads/assets/1.7.0.2/magento-1.7.0.2.tar.gz
tar -zxvf magento-1.7.0.2.tar.gz
wget http://www.magentocommerce.com/downloads/assets/1.6.1.0/magento-sample-data-1.6.1.0.tar.gz
tar -zxvf magento-sample-data-1.6.1.0.tar.gz
mv magento-sample-data-1.6.1.0/media/* magento/media/
mv magento-sample-data-1.6.1.0/magento_sample_data_for_1.6.1.0.sql magento/data.sql
cd magento
chmod -R o+w media var
mysql -h DBHOST -u DBUSER -pDBPASS DBNAME < data.sql
chmod o+w var var/.htaccess app/etc
cd ..
rm -rf magento-sample-data-1.6.1.0/ magento-1.7.0.2.tar.gz magento-sample-data-1.6.1.0.tar.gz magento/data.sql
Go to www.DOMAIN.NAME/magento/ and follow the online installation guide.
Errors may occur during fresh installation :
WARNING: your Magento folder does not have sufficient write information
following is 100% safe to run from the directory where Magento is installed:
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
chmod o+w var var/.htaccess app/etc
chmod 550 mage
chmod -R o+w media
If that is not working, try setting all directories to 777 by doing this:
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 777 {} \;
chmod o+w var/.htaccess
chmod 550 mage
http://www.magentocommerce.com/wiki/groups/227/resetting_file_permissions
Here are the steps to install Magento on ubuntu with sample data.
Create a database :
Use the below command to create a database for magento on ubundu.
mysql -u root -p
mysqladmin -u root -p create magento_test;
mysqladmin -u root -p reload;
GRANT ALL ON magento_test.* TO magento_test@localhost IDENTIFIED BY 'magento_test_password'
Install Magento :
This is almost the same as above, except you don't need to know the directory name. You will only have to replace DBHOST, DBNAME, DBUSER, and DBPASS.
wget http://www.magentocommerce.com/downloads/assets/1.7.0.2/magento-1.7.0.2.tar.gz
tar -zxvf magento-1.7.0.2.tar.gz
wget http://www.magentocommerce.com/downloads/assets/1.6.1.0/magento-sample-data-1.6.1.0.tar.gz
tar -zxvf magento-sample-data-1.6.1.0.tar.gz
mv magento-sample-data-1.6.1.0/media/* magento/media/
mv magento-sample-data-1.6.1.0/magento_sample_data_for_1.6.1.0.sql magento/data.sql
cd magento
chmod -R o+w media var
mysql -h DBHOST -u DBUSER -pDBPASS DBNAME < data.sql
chmod o+w var var/.htaccess app/etc
cd ..
rm -rf magento-sample-data-1.6.1.0/ magento-1.7.0.2.tar.gz magento-sample-data-1.6.1.0.tar.gz magento/data.sql
Go to www.DOMAIN.NAME/magento/ and follow the online installation guide.
Errors may occur during fresh installation :
WARNING: your Magento folder does not have sufficient write information
following is 100% safe to run from the directory where Magento is installed:
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
chmod o+w var var/.htaccess app/etc
chmod 550 mage
chmod -R o+w media
If that is not working, try setting all directories to 777 by doing this:
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 777 {} \;
chmod o+w var/.htaccess
chmod 550 mage
http://www.magentocommerce.com/wiki/groups/227/resetting_file_permissions
PHP CMS Frameworks
November 30, 2014
Read more →
CodeIgniter
Steps to Install CodeIgniter On LinuxMint and Ubuntu
In this article, we are going to discuss about How to install CodeIgniter (CI) on LinuxMint and Ubuntu. CodeIgniter is a powerful PHP framework with a very small footprint, built for PHP coders who need a simple and elegant toolkit to create full-featured web applications. If you're a developer who lives in the real world of shared hosting accounts and clients with deadlines, and if you're tired of ponderously large and thoroughly undocumented frameworks
Step 1:
Download the latest version of CodeIgniter (CI) by Clicking Here
Step 2:
Unzip the downloaded zip file by executing the below command
sudo unzip CodeIgniter_2.2.0.zip
Step 3:
Rename the unzipped folder by executing the below command.
mv CodeIgniter_2.2.0 codeigniter
Step 4:
Move the unzipped renamed folder the www directory.
sudo mv codeigniter /var/www
Step 5:
Run the below URL and check the site is working.
http://localhost/codeigniter
Step 1:
Download the latest version of CodeIgniter (CI) by Clicking Here
Step 2:
Unzip the downloaded zip file by executing the below command
sudo unzip CodeIgniter_2.2.0.zip
Step 3:
Rename the unzipped folder by executing the below command.
mv CodeIgniter_2.2.0 codeigniter
Step 4:
Move the unzipped renamed folder the www directory.
sudo mv codeigniter /var/www
Step 5:
Run the below URL and check the site is working.
http://localhost/codeigniter
PHP CMS Frameworks
November 23, 2014
Read more →
CakePHP
Steps to Install CakePHP on Ubuntu 14.04
In thia article, we are going to discuss about How to install CakePHP on Ubuntu 14.04. CakePHP uses well-known software engineering concepts and software design patterns, as Convention over configuration, Model-View-Controller, Active Record, Association Data Mapping, and Front Controller.
Steps are almost same but in Windows we did that using GUI or in Windows Explorer and in Ubuntu we'll do it through terminal or you can say using commands.
Step 1:
Open the command prompt (terminal) and type the following command
cd /var/www/html
Step 2:
Type the below command to download the cakephp.
$ sudo wget https://codeload.github.com/cakephp/cakephp/legacy.zip/2.5.2
where 2.5.2 is the latest stable version of CakePHP.
Step 3:
Use the following command to unzip the downloaded zip file.
$ sudo unzip 2.5.2
Step 4:
Rename extracted folder.
$ mv cakephp-cakephp-736e999/ cake
where cakephp-cakephp-736e999 is the name of extracted folder.
To run CakePHP on browser use this path localhost/cake.
Step 5:
Go to cake folder.
$ cd cake
And change permissions to app/tmp folder.
$ sudo chown -R root:www-data app/tmp
$ sudo chmod -R 775 app/tmp
Step 6:
To make script writable perform these steps:
$ apache2clt -M
If you see mod_rewrite in the list shown then script is writable. If not then to enable it type this command:
$ a2enmod rewrite
Step 7:
Type cd /etc/apache2
$ sudo nano apache2.conf
Set these lines in the file:
<Directory /var/www>
Option Indexes FollowSymlinks
AllowOverride All
Required all granted
</Directory>
Press ctrl+x, then press y and enter to save the file.
Restart apache:
$ sudo service apache2 restart
Step 8:
Now go to app/Config
$ cd /var/www/html/cake/app/Config
$ sudo mv database.php.default default.php
Refresh localhost/cake page. Now database file is detected but still we have to create a database as it will show could not connect to database.
Step 9:
Open localhost/phpmyadmin on browser. Login using your username and password and create a database named as cake. After this edit database.php file.
$ sudo nano database.php
Set host as localhost, username is your phpmyadmin username, password is your phpmyadmin password and database name.
Refresh localhost/cake page. Now database is detected.
Step 10:
To remove the salt and seed error shown on top of the localhost/cake page we have to edit core.php file.
$ sudo nano core.php
Find this section and replace both the strings with any random strings or you can use these strings also.
/* A random string used in security hashing methods. */
Configure::write('Security.salt', 'fvjhdj8fvn85grg73fbrvfn9fjFGfnhvt758nADG');
/* A random numeric string (digits only) used to encrypt/decrypt strings. */
Configure::write('Security.cipherSeed', '55857485748594575784348784787475');
Then press ctrl+x, press y and enter to save file.
Refresh localhost/cake page. And its done.
Steps are almost same but in Windows we did that using GUI or in Windows Explorer and in Ubuntu we'll do it through terminal or you can say using commands.
Step 1:
Open the command prompt (terminal) and type the following command
cd /var/www/html
Step 2:
Type the below command to download the cakephp.
$ sudo wget https://codeload.github.com/cakephp/cakephp/legacy.zip/2.5.2
where 2.5.2 is the latest stable version of CakePHP.
Step 3:
Use the following command to unzip the downloaded zip file.
$ sudo unzip 2.5.2
Step 4:
Rename extracted folder.
$ mv cakephp-cakephp-736e999/ cake
where cakephp-cakephp-736e999 is the name of extracted folder.
To run CakePHP on browser use this path localhost/cake.
Step 5:
Go to cake folder.
$ cd cake
And change permissions to app/tmp folder.
$ sudo chown -R root:www-data app/tmp
$ sudo chmod -R 775 app/tmp
Step 6:
To make script writable perform these steps:
$ apache2clt -M
If you see mod_rewrite in the list shown then script is writable. If not then to enable it type this command:
$ a2enmod rewrite
Step 7:
Type cd /etc/apache2
$ sudo nano apache2.conf
Set these lines in the file:
<Directory /var/www>
Option Indexes FollowSymlinks
AllowOverride All
Required all granted
</Directory>
Press ctrl+x, then press y and enter to save the file.
Restart apache:
$ sudo service apache2 restart
Step 8:
Now go to app/Config
$ cd /var/www/html/cake/app/Config
$ sudo mv database.php.default default.php
Refresh localhost/cake page. Now database file is detected but still we have to create a database as it will show could not connect to database.
Step 9:
Open localhost/phpmyadmin on browser. Login using your username and password and create a database named as cake. After this edit database.php file.
$ sudo nano database.php
Set host as localhost, username is your phpmyadmin username, password is your phpmyadmin password and database name.
Refresh localhost/cake page. Now database is detected.
Step 10:
To remove the salt and seed error shown on top of the localhost/cake page we have to edit core.php file.
$ sudo nano core.php
Find this section and replace both the strings with any random strings or you can use these strings also.
/* A random string used in security hashing methods. */
Configure::write('Security.salt', 'fvjhdj8fvn85grg73fbrvfn9fjFGfnhvt758nADG');
/* A random numeric string (digits only) used to encrypt/decrypt strings. */
Configure::write('Security.cipherSeed', '55857485748594575784348784787475');
Then press ctrl+x, press y and enter to save file.
Refresh localhost/cake page. And its done.
PHP CMS Frameworks
November 20, 2014
Read more →
Wordpress
Fix Too Many Redirects Loop Error in WordPress
In this article, we are going to discuss about How to fix the too many redirects loop error in WordPress. When you add additional http authentication to the WordPress admin dashboard or the wp-admin directory, there are chances that you get any of the following errorr when trying to access the WordPress wp-admin directory;
The page isn't redirecting properly, This web page has a redirect loop, Error 310 (net::ERR_TOO_MANY_REDIRECTS) or an HTTP 404 error.
This is not a WordPress problem or error, but is an issue related to the configuration of your web server or hosting provider. If you do encounter such error, you can solve the issue by adding 1 line to the WordPress root .htaccess file. Follow the below step by step procedure to solve such issue:
ErrorDocument 401 default
That does the trick. Now your WordPress administrator dashboard is protected with double authentication.
The page isn't redirecting properly, This web page has a redirect loop, Error 310 (net::ERR_TOO_MANY_REDIRECTS) or an HTTP 404 error.
This is not a WordPress problem or error, but is an issue related to the configuration of your web server or hosting provider. If you do encounter such error, you can solve the issue by adding 1 line to the WordPress root .htaccess file. Follow the below step by step procedure to solve such issue:
- Connect to your WordPress website using FTP.
- Download the .htaccess file from the root of your WordPress website.
- Add the below line before the WordPress rules (above the # BEGIN WordPress line)
ErrorDocument 401 default
That does the trick. Now your WordPress administrator dashboard is protected with double authentication.
PHP CMS Frameworks
November 16, 2014
Read more →
YII
Access Rules and Access Control in YII
In this article, we are going to discuss about How use Access Rules and Access Control in YII framework. Yii gives powerful options for limiting access per controller methods / actions. Imagine that in an example controller we have actions index, view, create, update, delete (typical CRUD).
Here is how our access rules should look provided our remote IP is 4.2.2.2 and we want only authorized user 'admin' to access the administrative actions:
public function accessRules() {
return array(
array('allow', // allow all users to perform 'index' and 'view' actions
'actions' => array('index', 'view'),
'users' => array('*'),
),
array('allow', // allow admin users the admin actions
'actions' => array('create', 'update', 'delete'),
'users' => array('admin'),
'ips'=>array('127.0.1.1','4.2.2.2'),
),
array('deny', // deny all users
'users' => array('*'),
),
);
}
The above shows a good practice to limit the access by IP and not only to rely on authorization. This is very important for your website security.
Here is how our access rules should look provided our remote IP is 4.2.2.2 and we want only authorized user 'admin' to access the administrative actions:
public function accessRules() {
return array(
array('allow', // allow all users to perform 'index' and 'view' actions
'actions' => array('index', 'view'),
'users' => array('*'),
),
array('allow', // allow admin users the admin actions
'actions' => array('create', 'update', 'delete'),
'users' => array('admin'),
'ips'=>array('127.0.1.1','4.2.2.2'),
),
array('deny', // deny all users
'users' => array('*'),
),
);
}
The above shows a good practice to limit the access by IP and not only to rely on authorization. This is very important for your website security.
PHP CMS Frameworks
November 13, 2014
Read more →
Drupal
Drupal 7 - Download Adaptive Theme free
Adaptivetheme is a powerful theme framework designed from the ground up to power modern, cross browser/cross device websites using responsive design techniques. Adaptivetheme allows you to set up specific layouts for different device groups - such as desktop, tablet and smartphone - all with zero coding. Its all easy point-and-click configuration.
If you are using Panels try the Browscap CTools module to control the visibility of panel panes in mobile devices or Browscap Block to do the same thing with normal blocks.
Panels, Display Suite and Gpanels are fully supported with many options for displaying panel type layouts in mobile.
Adaptivetheme is blindingly fast - it employs extensive use of drupal_static and other caching techniques to speed up page rendering and delivery. If you're not fast you're last, right?
Adaptivetheme is built around these basic concepts:
If you are using Panels try the Browscap CTools module to control the visibility of panel panes in mobile devices or Browscap Block to do the same thing with normal blocks.
Panels, Display Suite and Gpanels are fully supported with many options for displaying panel type layouts in mobile.
Adaptivetheme is blindingly fast - it employs extensive use of drupal_static and other caching techniques to speed up page rendering and delivery. If you're not fast you're last, right?
Adaptivetheme is built around these basic concepts:
- Responsive design
- Pluggable layout system
- HTML5
- WGAC 2.0 Accessibility
To download the theme Click Here
For Documentation Click Here
PHP CMS Frameworks
November 09, 2014
Read more →
Joomla
Create Secure Joomla Extensions
In this article, we are going to discuss about How to create secure extentions in Joomla. It's no secret that most compromised Joomla sites are exploited through third party extensions. While there are core Joomla exploits too they are much fewer than the endless risks imposed from third party extensions.
In order Joomla extensions to be secure the following important aspects have to be observed:
The first and foremost important statement in any Joomla extension php file is making sure that the file is not accessed directly:
defined('_JEXEC') or die( 'Restricted access' );
The next important statement is making sure the visitor has the necessary privileges to access it. This is especially important when the extension is in the administrator panel. The simplest way to check if the user is authorized to open a sensitive file is:
$user = & JFactory::getUser();
if (!$user->authorize( 'com_users', 'manage' )) {
$mainframe->redirect( 'index.php', JText::_('ALERTNOTAUTH') );
}
If the user is authorized to manage the users then he should be allowed to do anything.
The general rule is, to follow the best practices of Joomla native Model View Controller concept. This ensures that your code will be tidier, easier to maintain and secure.
The essential part in writing a secure Joomla extension is using native Joomla classes and avoiding using your own code for the basic operations such as executing MySQL queries, including files and others. That's why make sure to be acquainted with all the Joomla Framework classes
http://docs.joomla.org/Framework
When studying the native Joomla classes pay special attention to JFilterInput and JFilterOutput. Their methods should be used regularly for filtering user input and output to avoid anything from MySQL injections to XSS flaws.
Finally, always take into consideration that Joomla runs on different environments and what is secure on yours might not be on others. Ensure that RG_emulation, register_globals or even allow_url_include will not allow anyone to tamper with your variables. If you cannot ensure it at least make sure to warn users about potential problems.
The above short secure Joomla extensions guidilines should give you an idea on how to write more secure Joomla extensions.
In order Joomla extensions to be secure the following important aspects have to be observed:
The first and foremost important statement in any Joomla extension php file is making sure that the file is not accessed directly:
defined('_JEXEC') or die( 'Restricted access' );
The next important statement is making sure the visitor has the necessary privileges to access it. This is especially important when the extension is in the administrator panel. The simplest way to check if the user is authorized to open a sensitive file is:
$user = & JFactory::getUser();
if (!$user->authorize( 'com_users', 'manage' )) {
$mainframe->redirect( 'index.php', JText::_('ALERTNOTAUTH') );
}
If the user is authorized to manage the users then he should be allowed to do anything.
The general rule is, to follow the best practices of Joomla native Model View Controller concept. This ensures that your code will be tidier, easier to maintain and secure.
The essential part in writing a secure Joomla extension is using native Joomla classes and avoiding using your own code for the basic operations such as executing MySQL queries, including files and others. That's why make sure to be acquainted with all the Joomla Framework classes
http://docs.joomla.org/Framework
When studying the native Joomla classes pay special attention to JFilterInput and JFilterOutput. Their methods should be used regularly for filtering user input and output to avoid anything from MySQL injections to XSS flaws.
Finally, always take into consideration that Joomla runs on different environments and what is secure on yours might not be on others. Ensure that RG_emulation, register_globals or even allow_url_include will not allow anyone to tamper with your variables. If you cannot ensure it at least make sure to warn users about potential problems.
The above short secure Joomla extensions guidilines should give you an idea on how to write more secure Joomla extensions.
PHP CMS Frameworks
November 05, 2014
Read more →
Joomla
Joomla - Duplicate Meta Description in Google Webmaster Optimization
For most of us who have been using Joomla 1.5 till 2.5, we are still facing the same old school issues of duplicated meta descriptions and title tags as reported in our Google Webmaster tools. As we're already used to this tools, I believed most of us can't sit comfortably as the duplication rate increases with every new pages that we created.
In general and as default, almost all Joomla user especially from the beginner (I'm at this level =)) to intermediate knowledge will experienced this kind of issue. We thought that it was nothing to be alarmed off until you started to feel uneasy on the rising amount of duplicate meta and title in your Google Webmaster report. Not until I watched videos on Matt comments (watch the videos below) on how Google use our meta description and keywords that I start to prioritise the importance of eliminating or reducing the duplication rate.
In this article, we are not going to install anything, just a little hard works. This has been done on my website and the result is satisfactory as the number or duplicate meta reduced from 50 (urrgh,) to 10. Another advice worth mentioned here is that, sometimes the duplicate meta description is caused by 'old link's from your internal pages that still pointed to 'old url' or the duplicate links (I'll explained it in the next post).
Global Configuration
Meta description and keywords should be empty. Leave it blank as mentioned in Joomla documentation. If you haven't read the document, you should better read sometimes.
Hard works Parts
Now, everytime you create a new page, you will need to create a unique meta description and keywords related to each pages. Most user will ignore this part but try to make a good habit of practicing this method. The option to add specific meta description to every pages is located in your article manager at the right side.
Regardless the techniques on how to improve our page ranking, here's some video worth our attention on the topic of whether Google use our meta keywords in search ranking and emphasize the use of 'unique' description by Matt Cutts.
Regarding the use of meta description
Regarding the use of meta keywords
In general and as default, almost all Joomla user especially from the beginner (I'm at this level =)) to intermediate knowledge will experienced this kind of issue. We thought that it was nothing to be alarmed off until you started to feel uneasy on the rising amount of duplicate meta and title in your Google Webmaster report. Not until I watched videos on Matt comments (watch the videos below) on how Google use our meta description and keywords that I start to prioritise the importance of eliminating or reducing the duplication rate.
In this article, we are not going to install anything, just a little hard works. This has been done on my website and the result is satisfactory as the number or duplicate meta reduced from 50 (urrgh,) to 10. Another advice worth mentioned here is that, sometimes the duplicate meta description is caused by 'old link's from your internal pages that still pointed to 'old url' or the duplicate links (I'll explained it in the next post).
Global Configuration
Meta description and keywords should be empty. Leave it blank as mentioned in Joomla documentation. If you haven't read the document, you should better read sometimes.
Hard works Parts
Now, everytime you create a new page, you will need to create a unique meta description and keywords related to each pages. Most user will ignore this part but try to make a good habit of practicing this method. The option to add specific meta description to every pages is located in your article manager at the right side.
Regardless the techniques on how to improve our page ranking, here's some video worth our attention on the topic of whether Google use our meta keywords in search ranking and emphasize the use of 'unique' description by Matt Cutts.
Regarding the use of meta description
Regarding the use of meta keywords
PHP CMS Frameworks
November 02, 2014
Read more →
No more posts to load.
About this blog
PHPCMSFramework.com
Tutorials for WordPress, Laravel, Drupal, Joomla, Symfony & more — including AI-powered PHP guides. Publishing since 2012.
Trending posts
- Building a RAG System in Laravel from Scratch
- Steps to create a Contact Form in Symfony With SwiftMailer
- Build an AI Code Review Bot with Laravel — Real-World Use Case
- Drupal 7 - Create your custom Hello World module
- Create Front End Component in Joomla - Step by step procedure
- CIBB - Basic Forum With Codeigniter and Twitter Bootstrap
- Migrating a wordpress website to Joomla website
- A step by step procedure to develop wordpress plugin
- Magento - Steps to add Custom Tabs to the Product Admin
- Steps to use Wordpress like pager in Drupal
Blog Archive
-
▼
2014
(86)
-
▼
November
(8)
- Steps to Install Magento On Ubuntu
- Steps to Install CodeIgniter On LinuxMint and Ubuntu
- Steps to Install CakePHP on Ubuntu 14.04
- Fix Too Many Redirects Loop Error in WordPress
- Access Rules and Access Control in YII
- Drupal 7 - Download Adaptive Theme free
- Create Secure Joomla Extensions
- Joomla - Duplicate Meta Description in Google Webm...
-
▼
November
(8)