Created
October 10, 2011 08:27
-
-
Save sawanoboly/1274859 to your computer and use it in GitHub Desktop.
Wordpress setup script for Joyent Smartmachine.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## WordPress Setup script for Joyent SmartMachine 1.3.6 | |
## How to use. | |
# wget https://raw.github.com/gist/1274859/8508adf89853cfd9899648d3a867bfb5b81e0fe8/wp.sh --no-check-certificate -O - | bash | |
# Open http://{server address} | |
# 1.install mysql-server and apache,mod_php. | |
# 2.Download wordpress from svn repository. | |
# 3.create wp_config.php | |
pkgin -y install ap22-php53 php53-mbstring | |
pkgin -y install mysql-server php53-mysql | |
## mysql setup | |
svccfg import /opt/local/share/smf/manifest/mysql.xml | |
svcadm enable mysql | |
# waitting Mysql. | |
until /opt/local/bin/mysqladmin ping -u root; do sleep 1; done | |
/opt/local/bin/mysqladmin -u root password 'joyent' | |
/opt/local/bin/mysqladmin -h `hostname` -u root password 'joyent' | |
/opt/local/bin/mysqladmin create wordpress -pjoyent --default-character-set=utf8 | |
## httpd configuration | |
mkdir -p /opt/local/etc/httpd/conf.d | |
cat >/opt/local/etc/httpd/conf.d/php5.conf<<'EOFEOF' | |
LoadModule php5_module lib/httpd/mod_php5.so | |
AddHandler application/x-httpd-php .php | |
DirectoryIndex index.php index.html | |
EOFEOF | |
echo "Include etc/httpd/conf.d/*.conf">>/opt/local/etc/httpd/httpd.conf | |
## php extension install | |
# pkg php53 compiled with '--with-config-file-scan-dir=/opt/local/etc/php.d' | |
mkdir -p /opt/local/etc/php.d | |
echo "extension=mbstring.so">/opt/local/etc/php.d/mbstring.ini | |
echo "extension=mysql.so">/opt/local/etc/php.d/mysql.ini | |
## Start apache httpd2 | |
svccfg import /opt/local/share/smf/manifest/apache.xml | |
svcadm enable apache | |
### restart command is.. | |
# svcadm restart apache | |
## Wordpress | |
# pkgin -y install scmgit | |
pkgin -y install subversion | |
mv /opt/local/share/httpd/htdocs{,_back} | |
mkdir /opt/local/share/httpd/htdocs | |
svn co http://core.svn.wordpress.org/tags/3.2.1 /opt/local/share/httpd/htdocs | |
## create config | |
cat > /opt/local/share/httpd/htdocs/wp-config.php<<'EOFEOF' | |
<?php | |
define('DB_NAME', 'wordpress'); | |
define('DB_USER', 'root'); | |
define('DB_PASSWORD', 'joyent'); | |
define('DB_HOST', 'localhost'); | |
define('DB_CHARSET', 'utf8'); | |
define('DB_COLLATE', ''); | |
define('AUTH_KEY', 'example'); | |
define('SECURE_AUTH_KEY', 'example'); | |
define('LOGGED_IN_KEY', 'example'); | |
define('NONCE_KEY', 'example'); | |
define('AUTH_SALT', 'example'); | |
define('SECURE_AUTH_SALT', 'example'); | |
define('LOGGED_IN_SALT', 'example'); | |
define('NONCE_SALT', 'example'); | |
$table_prefix = 'wp_'; | |
define ('WPLANG', ''); | |
define('WP_DEBUG', false); | |
require_once(ABSPATH . 'wp-settings.php'); | |
EOFEOF | |
cat <<EOF | |
## | |
## Please open in your browser "http://{server}/". | |
## and setting wordpress. | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment