### “Sitemakin and Cloner” Documentation by “Kent Elchuk” v1.4

# “Sitemakin and Cloner”

Created: 01/12/2014
By: Kent Elchuk
Email: kent@lampload.com

Thank you for purchasing Site Constructor and Cloner. If you have any questions that are beyond the scope of this help file, please feel free to email via my user page contact form here. Thanks so much!

## Table of Contents

1. Start
2. Changelog
3. Overview
4. Usage
5. Customization
6. CSS Styling
7. Raspberry Pi Specifics
8. Cloning Tips
9. FAQ
10. Credits

### B) Changelog - top

v1.4 September 2015

Added custom page session control in header_edit.php.

v1.3 June 2015

Modified installation folder for auto installation.

v1.0 December 2014

First release of Sitemakin and Cloner

### C) Overview - top

Convert any HTML template to a CMS in minutes!
Fast enough to host anywhere....including your home!

### D) Usage - top

The simple setup takes only minutes!

1. Unzip the file.
2. Move the installation to the desired folder.
3. Setup a Database. The examples uses the name raspberry_blog, but, yours can be any name you want. After that, dump the blogifie_constructor.sql file into the database. This can be imported into your database within seconds using phpMyAdmin.
4. Option A: Easy Installation. Open the installation folder (ie) example.com/installation. Fill in the simple fields and Submit.
5. Option B: Manual Installation Open public.inc.php and change the user and password for the raspberry_blog database. Or, open up the installation folder. Remember to remove the installation folder whether you use it or not. At this point, you can also rename htaccess.txt to .htaccess.

Congratulations, you now have an up and running installation.

All detailed videos for using the Sitemakin and Cloner can be found in the help file located in the main menu. Internet and web server are required.

Other topics include:

- Setup Files
- Create, Edit, Delete a Page:
  Option A
- Create, Edit, Delete a Page:
  Option B
- View Sitemap
- Clone Your Website
- Upload Images
- Manage Comments
- Manage SEF URLS
- View Sitemap
- Clone Your Website
- Zip Your Website

### E) Customization - top

The template contains various css files located within the css folder.
The CMS styling can be altered by changing the css file shown below.

- css/style-everywhere.css

The tutorial on the help.php page will show how you can manage your cms and clone!

### F) CSS Styling - top

The template contains various css files located within the css folder.
Many alterations can be performed by changing the css file shown below.

- css/style-everywhere.css

### G) Raspberry Pi Home Server - top

You may need to add the zip extension to Linux as shown below:

    sudo pecl install zip

2) Add extension=zip.so to php.ini likely located at: /etc/php5/cgi/php.ini. To open the file, you can type sudo nano filename where filename is the file name you want to open.
3) Change folder permissions so you can write files.
a) Add the user pi to the group www-data using one of the commands below:

    sudo useradd -g www-data pi

or

    sudo usermod -a -G www-data  pi

b) Can check if user belongs to group by using this command:

    sudo check groups : id pi

c) Change ownership for Sitemakin files.

    sudo chown -R pi:www-data /var/www/sitemakin

d) Let anyone in group have rewrite privilege.

    sudo chmod -R g+rw /var/www/sitemakin

### H) Cloning With HTTRACK - top

With Sitemakin and Cloner, it comes with its own tools to clone your website that you will make with this CMS.
However, we added a supplemental cloning tool that enables you to clone other websites. For example, you may want to clone an outdated Joomla 1.5 or Wordpress website to make static HTML files with all images and Javascript so that you can re-theme it with a template from Themeforest and make it usable once again with that modernized theme which likely loads much faster than the previous website installation.

This method will use a Linux package called httrack. Although this tutorial is geared towards Debian based servers, HTTRACK also installs quickly and simply on Centos and detailed info can be found here.
Below are a list of commands to install and use httrack with Debian based Linux operating systems like Raspbian and Ubuntu.

### Debian Based Systems

1)

    sudo apt-get update

2)

    sudo apt-get install zip

3)

    sudo apt-get install httrack

4) Cloning Options:
a) Command Line usage

    sudo httrack http://example.com/  -O "/websites/example.com"  -%v -%e0

b) Using cloner.php
i) You need to be able to use the shell_exec() PHP function. If you have shell access, you can enable it to use on a specified folder or remove it from a blacklist by editing the loaded php.ini file. With shared hosting, you can ask if they will enable it for you. If you cannot use your web hosting account, you can setup a LAMP server at home on another PC, using Linux installed in VirtualBox which is free, or connect a Raspberry Pi to your router. The $35-$50 Raspberry Pi is the phenomenal micro PC designed for learning. It can even power websites hosted at home.
ii) You must allow www-data to become a super user and allow it to use the packages without a password. So, open up that /etc/sudoers file and give Apache permission to use the desired service(s). For this example, we will use the services httrack and zip. The line is shown below.
www-data ALL=NOPASSWD: /usr/bin/httrack,/usr/bin/zip
iii) Just add the url and submit. Site is zipped up and stored in /home/pi folder. To open the file, type nano /etc/sudoers.

### Centos Systems

Centos installation info can be found here.
Once it is installed, PHP needs permission to run the service. Here are the last steps.
You can open cloner.php and change the code to something like this working sample:

        shell_exec('/usr/local/bin/httrack http://' . $url . '/  -O "/home/sitemakin/websites/
            ' . $url . '"  -%v -%e0 2>&1;');

After that, open up /etc/sudoers and add a line that allows the account user to run the httrack service. I am showing the line below.

    username ALL=NOPASSWD: /usr/local/lib/httrack,/usr/local/bin/httrack

Now, when you open the folder /home/username/websites/ you will see the new clone.
Here is a simple may to open the new cloned folder with the Linux shell:

    cd *example.com

### Windows Systems

1. Download and install httrack for windows found here.
2. Open cloner.php and change the code to something like this working sample.
Change:

    shell_exec('sudo httrack http://' . $url . '/  -O "/home/pi/' . $url . '"  -%v -%e0 2>&1;');

Change to:

    exec('C:\Users\username\Documents\AAA\WinHTTrack\httrack.exe http://' . $url . '/  -O "C:\xampp\htdocs\CLONES\\' . $url . '"  -%v -%e0 2>&1;');

Important:
By default, httrack install to Program Files. That white space between 'Program' and 'Files' on Windows will cause issues. So, you can copy the entire WinHTTrack folder to a path that has no whitespace. In this case, it was copied into the Documents\AAA folder.
By default, you will be able to use the service now, but, it could time out when cloning a website.
An example of a timeout is:
Fatal error: Maximum execution time of 30 seconds exceeded
To alter the timeout setting,
1. Open the file:
c:\xamp\php\php.ini
2. Change:
max_execution_time=30
Change to:
max_execution_time=120
3. Save the file and restart Apache. See setup, cloning and quick usage in action.

### I) FAQ - top

1. New pages are not being made or do not show up in the browser.
   Most Cpanel and Web Hosting accounts will allow the generation for new pages with Sitemakin and Cloner. On Debian based home servers like Ubuntu, Linux Mint and Raspbian, and Virtual machines like Virtualbox, you must have the user belonging to the www-data group and you must permit the users of that group to be able to do this. The Linux commands are shown below.
   a) Make sure all files have proper ownership. In the example, the user is username. But, you would obviously use the appropriate user for your files.

       sudo chown -R username:www-data /var/www/sitemakin

   b) Add user to group. The username will be yours.

       sudo useradd -g www-data username

   c) Allow all group members to be able to write.

                   sudo chmod -R g+rw /var/www/sitemakin

The tutorial on the help.php page will show how you can manage your cms and clone!

### J) Credits - top

I've used the following images, icons or other files as listed.

- Kent Elchuk
- Template by HTML5.net

Once again, thank you so much for purchasing this PHP script. As I said at the beginning, I'd be glad to help you if you have any questions relating to this theme. No guarantees, but I'll do my best to assist. If you have a more general question relating to the PHP script on ThemeForest, you might consider visiting the forums and asking your question in the "Item Discussion" section.

Kent Elchuk

Go To Table of Contents