Skip to content

Posts tagged ‘Web’

19
Aug

Pelican: Another Way for Madplanet.com Inc. Site?

Lately Bluehost.com gives me some grief and so I am thinking about changing my provider.
So I started to think that maybe this would be a good opportunity to also switch from WordPress to an easier setup.
What I would like to do is to use Markup to write by posts and pages but also wanted to see
if it is possible to avoid having to deal with a DB. Not that I hate to use a DB but backing
up the data and exporting the content is not that simple. But then again what should I use and is it ready worth the effort.

Then I found this page from [http://www.macdrifter.com/2012/08/pelican-guide-moving-from-wordpress-and-initial-setup.html|Macdrifter] talking about Pelican which would just do that.
But instead of plunging right into it I wanted to do an intermediary step by having the Site
first running on my local Mac (Apache, Python already there) and when it is working as expected
I will go ahead and push the content from my Mac to the ISP.

First step was to just get Pelican installed and up and running before going ahead.
Afterwards I would recreate Madplanet.com’s website on my local Mac so that I don’t have
to bother my ISP or damage the installation. From there I will migrate the content over
and when it is done I will push the content out and pull the plug on the old site.

Pelican Installation

To my surprise the installation and configuration of Pelican was straight forward:

sudo -s
easy_install markdown
easy_install pelican
easy_install pygments

mkdir /Library/WebServer/Documents/pelican

pelican-quickstart

Now don’t waste too much time on the questions. Just answer what you can and leave the rest
blank or accept the defaults. It is only generating a configuration file for most parts.

The only important thing is that the location for pelican is at the previously created
directory (/Library/WebServer/Documents/pelican). You can select any directory you
like but this is the default given by Apple and so I used this.

Apache configuration

The Apache Configuration can be different on every computer and so here I only describe
the simplest solution to set Pelican to be the root document root. For that I just set
the Apache Document Root to the Pelican’s Output directory:

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/Library/WebServer/Documents/pelican/output"

and then define that Directory:

<Directory "/Library/WebServer/Documents/pelican/output">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks MultiViews

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all

</Directory>

Last two steps are to check if the configuration is OK and then restart the Apache server:

sudo apachectl -t
sudo apachectl restart

See Pelican in Action

Before we can go ahead we need to generate the site in Pelican. For that we go to the
project’s home directory (/Library/WebServer/Documents/pelican) and use make to generate
the site:

cd /Library/WebServer/Documents/pelican
make pelican

Finally we can open the site with this url: localhost.

Conclusion

I am not done here by a long shot. First I need to have both the WordPress and the Pelican
site running on my Apache Server and then I need to export my WordPress site and install it
locally. But for now that’s all.

– Andy