Magento, as I have found, is a tad tricky to set-up, most things are easy to resolve, but there are lots of little things that can have you searching around the Internet for while trying to find answers. I thought I would collect the most common issues in a single article.
I am assuming you already have a fully working Ubuntu LAMP stack (Linux, Apache, MySQL and PHP) and are resonably familiar with Linux. This information was based around using Ubuntu Server 8.10 and Magento 1.3.1.
The full Magento system requirements can be found here:-
http://www.magentocommerce.com/system-requirements
Installation instructions
I like to keep a copy of the install and sample data files in my home directory for reinstallation in case of any problems. As described above I then copy the files to the webserver root. What I forgot is that the cp –R command does not copy hidden files, so make sure you copy the .htaccess file separately if this is the case.
The steps I follow for installing Magento are basically as follows:-
- Copy magento install file to temporary directory and unpack
- Copy magento sample data to temporary directory and unpack
- Copy unpacked magento install files to /var/www
- Copy unpacked magento sample media to /var/www/media
- Create database in MySQL
- Copy sample SQL database to mySQL using following command:-
Where user = MySQL user name, dbname = name of database to be used for storing the Magento data and sqldata is the name of the Magento sample data file, which is usually called something like magento-sample-data-1.2.0.
You could also install phpmyadmin for db admin if you have not already done so (if not, do so it is very handy) using:-
You can access it using http://localhost/phpmyadmin. Don’t worry if you can’t see it in your webserver root directory, it is not meant to be there.
Why cant I access Magento admin backend?
Some people have reported problems logging into the admin back end once Magento has been fully installed. I did a search on Google and found that there was a bug where using localhost only as the server hostname did not set the cookies correctly and did not allow you to log in.
I normally log into my test servers using just the server name, and my DNS server then resolves this, however Magento doesn’t seem to like this, and won’t allow you to log in!
So either use a FQDN (i.e. server.domain.local or somesuch) or just edit your hosts file in /etc/hosts and give it a dummy FQDN and it should work.
The page you requested was not found, and we have a fine guess why.
After installation of Magento and ensuring that mod_rewrite is enabled and working on the apache server, if Magento shopping cart still gives you the following error:
Whoops, our bad…The page you requested was not found, and we have a fine guess why.
If so, log into the Magento admin area and navigate to system->cache management. Click the “refresh” button next to “catalog rewrites”. This should resolve the error.
Thanks goes to the site nickbartlett.com for this tip.
How do I enable Magento SEO?
I wanted to use Magento with SEO turned on, with friendly URLs. This requires the use of the Apache rewrite module mod_rewrite. To install this use:-
You will also have to amend Apache to allow the use of .htaccess files. By default the Ubuntu 8.10 Server version of Apache disables this function. Edit the following file:
/var/www/available-sites/default
and find the following section:
<Directory /var/www/> AllowOverride None </Directory>
change it to:
<Directory /var/www/> AllowOverride All </Directory>
Don’t forget to restart Apache using – “sudo /etc/init.d/apache2 restart”.
Finally, login to the Magento admin backend, navigate to System > Configuration and change the option to YES.
Strict Notice: date() [function.date]: It is not safe to rely on the system’s timezone settings. Please use the date.timezone setting
If you get this error, Magento is complaining that you have not set your relevant timezone in the php.ini (located at /etc/php5/apache2) configuration file.
The default setting is as follows:
;date.timezone =
Change this to, for example:
date.timezone = “Europe/London”
Remember to remove the semi-colon! Look at www.php.net for further information on the available timezones and locations available.
Forgotten Admin Password
If for some reason you have forgotten your admin password, and your email pasword option is not working (or you forgot to configure it – oops), you can reset your password in MySQL using the following command:-
UPDATE admin_user SET password=MD5(‘newpassword’) WHERE username=‘admin’;
