Permalink
Browse files

fixes to default http configs, dev server, setup.sh and manage scripts

  • Loading branch information...
1 parent 582a405 commit 43571cab6a49c5c7fe181ae84f41c5cc195ca02c @ryanmark ryanmark committed Jan 31, 2012
Showing with 36 additions and 25 deletions.
  1. +2 −0 bin/manage.sh
  2. +5 −4 bin/runserver.py
  3. +18 −12 fablib.py
  4. +2 −2 sample-http/development-nginx.conf
  5. +2 −2 sample-http/production-nginx.conf
  6. +2 −2 sample-http/staging-nginx.conf
  7. +5 −3 setup.sh
View
@@ -49,6 +49,8 @@ then
# Have to run as root so we can use port 80. WordPress won't run
# on an abitrary port. We need to pass the username in so we can
# tell the webserver to run as the local user.
+ echo "Need to run the server as root so we can use port 80. Your sudo password, please."
+
sudo tools/bin/runserver.py `whoami`
else
exit 0
View
@@ -164,20 +164,21 @@
break
if php.poll() is 0:
- print "nginx finished."
+ print "php finished."
break
elif php.poll() > 0:
- print "nginx exited badly."
+ print "php exited badly."
break
if memcache.poll() is 0:
- print "nginx finished."
+ print "memcache finished."
break
elif memcache.poll() > 0:
- print "nginx exited badly."
+ print "memcache exited badly."
break
time.sleep(1)
+
except KeyboardInterrupt:
sys.stdout.write('\nstopping...')
nginx.terminate()
View
@@ -144,26 +144,28 @@ def bootstrap():
with settings(warn_only=True):
env.run('rm wp-config.php');
- env.run(env.prefix + './runscript.sh setup_wp-config')
+ env.run(env.prefix + './manage.sh setup_wp-config')
create_db()
- env.run(env.prefix + './runscript.sh install')
- env.run(env.prefix + './runscript.sh install_network')
+ env.run(env.prefix + './manage.sh install')
+ env.run(env.prefix + './manage.sh install_network')
with settings(warn_only=True):
env.run('rm wp-config.php');
- env.run(env.prefix + './runscript.sh setup_wp-config --finish')
+ env.run(env.prefix + './manage.sh setup_wp-config --finish')
print("\nStep 3: Setup plugins")
- env.run(env.prefix + './runscript.sh setup_plugins')
+ env.run(env.prefix + './manage.sh setup_plugins')
print("\nStep 4: Cleanup, create blogs")
- env.run(env.prefix + './runscript.sh set_root_blog_defaults')
+ env.run(env.prefix + './manage.sh set_root_blog_defaults')
if confirm("Create child blogs?"): create_blogs()
+ env.run(env.prefix + './manage.sh setup_upload_dirs')
+
def create_db():
if not env.db_root_pass:
@@ -215,16 +217,20 @@ def reload_db(dump_slug='dump'):
destroy_db()
create_db()
with cd(env.path):
- env.run(env.prefix + './manage.sh setup_wp-config --finish' % env )
+ env.run(env.prefix + './manage.sh setup_wp-config --finish' )
load_db(dump_slug)
def create_blogs():
- with cd(env.path):
- i = 0
- response = ''
- while "No more blogs" not in response:
- response = env.run(env.prefix + "./manage.sh setup_blog -n %s" % i)
+ i = 0
+ response = ''
+ while "No more blogs" not in response:
+ with cd(env.path):
+ if env.has_key('settings'):
+ response = env.run(env.prefix + "./manage.sh setup_blog -n %s" % i)
+ else:
+ response = env.run(env.prefix + "./manage.sh setup_blog -n %s" % i, capture=True)
+ print( response )
i += 1
@@ -40,10 +40,10 @@ server {
alias /tmp/nginxroot/themes;
}
location ^~ /wp-content/blogs.dir {
- alias /tmp/nginxroot/blogs.dir;
+ alias /tmp/nginxroot/media/blogs.dir;
}
location ^~ /wp-content/uploads {
- alias /tmp/nginxroot/uploads;
+ alias /tmp/nginxroot/media/uploads;
}
location ^~ /wp-content/media {
alias /tmp/nginxroot/media;
@@ -38,10 +38,10 @@ server {
alias /home/wordpress/sites/example/themes;
}
location ^~ /wp-content/blogs.dir {
- alias /home/wordpress/sites/example/blogs.dir;
+ alias /home/wordpress/sites/example/media/blogs.dir;
}
location ^~ /wp-content/uploads {
- alias /home/wordpress/sites/example/uploads;
+ alias /home/wordpress/sites/example/media/uploads;
}
location ^~ /wp-content/media {
alias /home/wordpress/sites/example/media;
@@ -38,10 +38,10 @@ server {
alias /home/wordpress/sites/example/themes;
}
location ^~ /wp-content/blogs.dir {
- alias /home/wordpress/sites/example/blogs.dir;
+ alias /home/wordpress/sites/example/media/blogs.dir;
}
location ^~ /wp-content/uploads {
- alias /home/wordpress/sites/example/uploads;
+ alias /home/wordpress/sites/example/media/uploads;
}
location ^~ /wp-content/media {
alias /home/wordpress/sites/example/media;
View
@@ -41,9 +41,6 @@ cd wordpress
git checkout $WORDPRESS_TAG
cd $PROJECT_DIR
-# Link up themes that ship with WordPress
-ln -s wordpress/wp-content/themes/* themes/
-
# Get Akismet
git submodule add https://github.com/git-mirror/wordpress-akismet.git plugins/akismet
@@ -62,10 +59,15 @@ git add .
git commit -m "WordPress project setup"
echo "----------------------------------------------------"
+echo ""
echo " Please review the configuration in data/ and http/ "
echo ""
echo " When you are satisfied with the configuration, run "
echo " ./manage.sh setup_env"
echo " to get the proper libraries installed, then run"
echo " fab bootstrap"
echo " to install your WordPress blog"
+echo ""
+echo " If you want to use the themes that come with"
+echo " WordPress, run:"
+echo " cp -rf wordpress/wp-content/themes/* themes/"

0 comments on commit 43571ca

Please sign in to comment.