How to deploy TomatoCMS on localhost environment?

Posted by admin at 15:47:57 04-01-2010
3907

After releasing TomatoCMS, some developers informed me that they could not deploy on localhost. So, I decide to post new guide which shows you step by step to do this. This guide was implemented on Windows operating system with Apache 2.2.1, PHP 5.2.10, MySQL 5.0.83.

Step 1: Download TomatoCMS

Download TomatoCMS from http://www.tomatocms.com/download.php

The downloaded file have name in format TomatoCMS_vXX_revYYY.zip where XX is the version number and YYY is revision number.

At the time of writing, the TomatoCMS version is TomatoCMS_v2.0_rev519.

Step 2: Configure Apache:

- Extract the downloaded file into a folder on your local disk, Ctomatocms, for example.

 

- Open your Apache virtual host configuration file located at Your_Apache_Installed_Folder\conf\extra\httpd-vhosts.conf.

Add the following lines to this file:

Listen 80
NameVirtualHost *:80
<VirtualHost *:80>
  DocumentRoot "C:/tomatocms"
    <Directory "C:/tomatocms">
    AllowOverride All
    Options -Indexes FollowSymLinks
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>

In this case, I assume that the website will run on port 80. If this port has been used by other site or service, please change 80 to other number.

Note: Make sure that the virtual host is enable by Apache. The line

Include conf/extra/httpd-vhosts.conf

from Apache configuration file - Your_Apache_Installed_Folder\conf\httpd.conf - have to be uncommented as follow:

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

Step 3: Create MySQL database

You can use any MySQL client tool to create and import data. The following guide was implemented by command line in DOS.

- Go to DOS command, log in to MySQL:

C> mysql -u -root -p

Enter the MySQL password of root account

- Create the database named tomato_cms:

mysql> CREATE DATABASE `tomato_cms` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

- Create an MySQL user and grant previleges:

mysql> GRANT USAGE ON tomato_cms.* TO 'tomato'@'%' IDENTIFIED BY '123456';
mysql> GRANT ALL PRIVILEGES ON tomato_cms.* TO 'tomato'@'%';
mysql> FLUSH PRIVILEGES;

Here, we create a MySQL user named tomato with password '123456' (without quote)

- Exit the MySQL:

mysql> exit;

- Go to the install folder of tomatocms and execute command to import the database schema and some initial data:

C> cd Ctomatocms\install
C> mysql -u root -p tomato_cms < tomato_cms_db.sql

Use your MySQL client tool to ensure that the database has been created successfully.

Step 4: Configure TomatoCMS

If you configured Apache and created MySQL database exactly as above, you don't have to perform any configurations.

But, assume that you run website on port that differ from 80, or use other MySQL account, you have to do this step.

 

Open file app.ini located in folder Ctomatocms\app\config and change the value of following settings to your value:

master.server1.port and slave.server2.port to the port that MySQL listen (default value is 3306),

master.server1.dbname and slave.server2.dbname to MySQL database name (default value is tomato_cms)

master.server1.username and slave.server2.username to MySQL user name

master.server1.password and slave.server2.password to MySQL password

url and server.static to the full URL of website (http://localhost/ by default)

 

Restart Apache web server, go to the http://localhost to see your website.

 

 

IMPORTANT NOTE:

In some operating system like Linux or Mac OS, TomatoCMS requires writing permisson to few files, folders. The full list is:

  • app/config/layout.ini
  • app/templates
  • data
  • temp
  • upload

If you still can not deploy TomatoCMS after follow the guide above, please leave a message in comment form below. Thanks so much!

TomatoCMS Team

Comments

Collapse
Write your comment:

About

This is official blog of TomatoCMS, an open source CMS powered by Zend Framework, jQuery and 960 grid.

Poll

Collapse
How do you know about TomatoCMS?
  • Google
  • RSS channels
  • PHP developer forums
  • Other
© Copyright 2009 TomatoCMS Core Team