Git Product home page Git Product logo

wp-stub's Introduction

WP Stub!

Boilerplate code used to kick-start WordPress projects.

This repo will eventually contain an updated version of my Bueller repo/workflow.


Installation

Automated

Using cURL and tar on a unix system:

# Create your WordPress site folder:
$ mkdir my-wordpress-site && cd my-wordpress-site
# Grab the relevant folders/files from this repo:
$ curl -#L https://github.com/mhulse/wp-stub/tarball/master | tar -xzv --strip-components 1 --exclude=*/{.git*,.editor*,README.*,LICENSE}
# Grab and setup the latest WordPress:
$ wget http://wordpress.org/latest.tar.gz && tar xfz latest.tar.gz && rm -f latest.tar.gz && mv wordpress wp
# Setup fresh database:
$ mysql -u username -p 

At the mysql prompt (replace {...} with valid strings):

mysql> CREATE DATABASE {DBNAME};
mysql> GRANT USAGE ON *.* TO {USER}@localhost IDENTIFIED BY '{PASSWORD}';
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, ALTER, CREATE, DROP, INDEX, EXECUTE ON {DBNAME}.* TO {USER}@localhost;
mysql> exit

mysql prompt tips

In case you want separate user for each database you need to create a new user to access that database. Once created, run all other commands with this username.

mysql> create user {USER}@localhost identified by '{PASSWORD}';

You can test whether your database creation was successful by running this command:

mysql> USE {DBNAME};

Next, open wp-config.php and edit (replace {...} with valid strings):

define('DB_NAME', '{DBNAME}');
define('DB_USER', '{USER}');
define('DB_PASSWORD', '{PASSWORD}');

Replace the below lines with the output of this page.

define('AUTH_KEY',         '');
define('SECURE_AUTH_KEY',  '');
define('LOGGED_IN_KEY',    '');
define('NONCE_KEY',        '');
define('AUTH_SALT',        '');
define('SECURE_AUTH_SALT', '');
define('LOGGED_IN_SALT',   '');
define('NONCE_SALT',       '');

Save and close the file.

A this point, you may need to change file/folder permissions:

find ./ -type d -exec chmod 755 {} \;
find ./ -type f -exec chmod 644 {} \;

Things like your uploads/ and plugins/ directories may need to have looser permissions. You’ll just have to test and find out what works best for your server.

Visit /wp url and install WP …

Virtual hosts:

<VirtualHost *:80>
	DocumentRoot "/Users/xxx/wordpress"
	ServerName wp.local
	ServerAlias www.wp.local
	ErrorLog "logs/wp.local-error.log"
	CustomLog "logs/wp.local-access.log" combined
	#DirectoryIndex index.html
	<Directory "/Users/xxx/wordpress">
		IndexOptions +FancyIndexing NameWidth=*
		Options -Indexes +Includes +FollowSymLinks +MultiViews
		AllowOverride All
		Order allow,deny
		Allow from all
	</Directory>
</VirtualHost>

More information coming soon.

Manually:

  • Coming soon.

wp-stub's People

Contributors

mhulse avatar

Stargazers

Ben Beekman avatar Angus H. avatar

Watchers

 avatar

wp-stub's Issues

XAMPP virtual host and other docs

Include all that info in this repo.

Don't forget to add:

<IfModule mime_module>
    AddType image/svg+xml svg svgz
    AddEncoding gzip svgz
</IfModule>

… to httpd.conf. Though, maybe newer versions of XAMPP have this fixed? Kinda weird it's not in etc/mime.types?

Shell script to do setup in one fell swoop

#!/bin/bash

echo "Database Name: "
read -e dbname
echo "Database User: "
read -e dbuser
echo "Database Password: "
read -s dbpass

echo "run install? (y/n)"
read -e run

if [ "$run" == n ] ; then
exit
else
#download wordpress
curl -O http://wordpress.org/latest.ta...

#unzip wordpress
tar -zxvf latest.tar.gz

#change dir to wordpress
cd wordpress

#copy file to parent dir
cp -rf . ..

#move back to parent dir
cd ..

#remove files from wordpress folder
rm -R wordpress

#create wp config
cp wp-config-sample.php wp-config.php

#set database details with perl find and replace
perl -pi -e "s/database_name_here/$dbname/g" wp-config.php
perl -pi -e "s/username_here/$dbuser/g" wp-config.php
perl -pi -e "s/password_here/$dbpass/g" wp-config.php

#create uploads folder and set permissions
mkdir wp-content/uploads
chmod 777 wp-content/uploads

#remove zip file
rm latest.tar.gz

#remove bash script
#rm wp.sh
fi

Edit the above and make work for this repo. Use one curl command to install.

From:

http://code.tutsplus.com/articles/download-and-install-wordpress-via-the-shell-over-ssh--wp-24403

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.