SME Site Maker

From SME Server
Revision as of 10:30, 20 October 2007 by PicsOne (talk | contribs) (→‎Changelog)
Jump to navigation Jump to search
Important.png Note:
Please feel free to modify or add info to this HowTo, and make corrections in typos, because I don't speak English very good. Also to script, you can fix some typos and beautify the code.


Purpose

This script is designed to help you when create a new web site under /opt directory. If you want to create a site under an ibay, do not use this script. The main purpose is to automate the time consuming (and sometimes confusing) process of installing an application to the /opt directory. If you do not use SMESiteMaker you must create the dir, conf files, and DB configs manually from the command line. With SMESiteMaker, you only have to answer the questions in the wizard.

The script creates the basic environment for your site, such as directory, permissions, apache configuration, add, replace or leave databases and user, and restart the pertinent services. Of course you can edit the final config file (under /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/99SMESiteMaker_yourconfname) to add your own parameters, but generally default is ok.

Usage

First, download from SMESM to any location in your SME.

Then untar the script. In this example I use v1.7:

tar xzvf SMESiteMaker_v1.7.tar.gz

Enter to SMESiteMaker dir.

cd SMESiteMaker

and finally execute the script

sh SMESiteMaker

or

./SMESiteMaker

The script gives you information and prompts for answers at each step.

Removal

If you make a mistake or want to revert the changes, first remove the directory you choose to locate your site under /opt. Then remove the file /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/99SMESiteMaker_yourconfname. If you create a DB then remove DB and User if they are new and no longer needed.

Finally expand template and restart the service:

expand-template /etc/httpd/conf/httpd.conf
/etc/init.d/httpd-e-smith restart

Adding functionality?

If you improve or add new functions to the script, please update this wiki page and upload the new version at Bugzilla:2975.

Comments & Support

Please, use this thread in the forum for questions or comments: SME SM Forum thread


Changelog

# Author: Normando Hall (PicsOne)
# nhall@unixlan.com.ar
#
# Status
# Version: 2.0
# 20/10/2007  (d/m/Y)
#
#
# Changelog
#
# 2.0 (reloaded) (by Normando Hall)
# Remove SME6 compatibility
# Fix root dir perms
# Improve instructions and visual
# Generate index.html for test and info purposes
# Fix some bugs
# Rename the script to smesm
# Secure some script functions
#
# 1.7 (by Normando Hall)
# Fix some bugs with MySQL database and users already exists
# Set debug output to /opt
# Added SME6 support
# Improve some functions
# Stylize prompt
#
# 1.5 (by Normando Hall)
# Fix some bugs with CGI dir
# Added full mysql support
#
# 1.1 (by Normando Hall)
# Added php open_basedir restriction
# Set debug variable
#
# 1.0 (by Normando Hall)
# Initial release