Skip to content

Instantly share code, notes, and snippets.

@rogerbush8
Last active August 29, 2015 14:13
Show Gist options
  • Save rogerbush8/a3112bc45be56001a4ef to your computer and use it in GitHub Desktop.
Save rogerbush8/a3112bc45be56001a4ef to your computer and use it in GitHub Desktop.
Clean interactive install on Debian Wheezy of Latest WordPress # /var/www
# Shell commands to interactively install wordpress on Debian Wheezy
# This is not an automatic script (but could be easily converted). Assumes you have root.
# Assumes you have Apache2, PHP and MySQL already installed.
# @see https://gist.github.com/rogerbush8/db4266946b4a02e967ed - rogerbush8/install-debian-wheezy-apache2-php-mysql
# which could be performed as a prerequisite.
# Pull latest tarball directly from wordpress.org and untar it to /var/www.
# All files will end up in /var/www/wordpress.
cd /tmp
wget http://wordpress.org/latest.tar.gz
tar -C /var/www -xzvf latest.tar.gz
# Set all file permissions for wordpress files
chown -R www-data:www-data /var/www/wordpress
find /var/www/wordpress -type f -exec chmod 0600 {} \;
find /var/www/wordpress -type d -exec chmod 0700 {} \;
# Login to mysql, create database, user and grant permission.
# Assumes local client/server install (webserver and db on same machine).
mysql -u root -p
mysql> CREATE DATABASE wordpress;
mysql> CREATE USER wordpress_user@localhost;
mysql> SET PASSWORD FOR wordpress_user@localhost = PASSWORD("some_password");
mysql> GRANT ALL PRIVILEGES ON wordpress.* TO wordpress_user@localhost IDENTIFIED BY 'some_password';
mysql> FLUSH PRIVILEGES;
mysql> exit;
# Create a new website config file /etc/apache2/sites-available/wordpress.
# N.B. make sure to change the IP address, ServerAdmin (email) and ServerName below:
cat > /etc/apache2/sites-available/wordpress
NameVirtualHost 107.191.105.14:80
<VirtualHost 107.191.105.14:80>
ServerAdmin roger@grokible
ServerName grokible.com
DocumentRoot /var/www/wordpress
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
[CTRL-D]
# Comment out "NameVirtualHost *:80" in /etc/apache2/ports.conf using #
# Use text editor to prepend #.
# Disable default site and enable new wordpress site.
a2dissite default
a2ensite wordpress
# Enable mod rewrite and restart
a2enmod rewrite
service apache2 restart
# We can now finish configuration from a browser pointed to
# http://<serverip>. The most critical information to get
# correct is the mysql setup info: database name, user
# name and password. The setup is extremely quick, and once
# you create a wordpress user login and password, all remaining
# config is done via the wordpress admin panel.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment