Register
It is currently Sat Sep 20, 2014 6:02 pm

Install WordPress


All times are UTC - 6 hours


Post new topic Reply to topic  [ 1 post ] 
Author Message
 PostPosted: Sun Apr 11, 2010 2:03 pm   

Joined: Sat Apr 03, 2010 1:47 pm
Posts: 6
I wrote this script to download, install and setup WordPress. You only have to go to the installation URL to finalize with Blog Title and your email.

Code:
#! /bin/bash

wget http://wordpress.org/latest.tar.gz

echo ""
echo "********************************"
echo "***** WORDPRESS DOWNLOADED *****"
echo "********************************"
echo ""

tar zxf wordpress-*.tar.gz

echo ""
echo "********************************"
echo "***** WORDPRESS  EXTRACTED *****"
echo "********************************"
echo ""

rm wordpress-*.tar.gz

mv wordpress/* ./

rmdir wordpress

read -r -p "What is your MySQL Database Hostname? " mysqlhost

if [ -z $mysqlhost ] ; then
  mysqlhost=localhost
fi

read -r -p "What is your MySQL Database Name? " mysqldb
read -r -p "What is your MySQL Database Username? " mysqluser
read -rs -p "What is your MySQL Database Password? " mysqlpass

sed -e "s/localhost/"$mysqlhost"/" -e "s/putyourdbnamehere/"$mysqldb"/" -e "s/usernamehere/"$mysqluser"/" -e "s/yourpasswordhere/"$mysqlpass"/" wp-config-sample.php > wp-config.php
echo ""

cat << EOF > .htaccess
# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

AddHandler php5-script .php
EOF

echo ""
echo "*******************************"
echo "***** WORDPRESS COMPLETED *****"
echo "*******************************"
echo ""
echo "Go to installation URL to finalize."


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP