Skip to content

Instantly share code, notes, and snippets.

@brennanneoh
Created March 22, 2012 09:53
Show Gist options
  • Save brennanneoh/2157420 to your computer and use it in GitHub Desktop.
Save brennanneoh/2157420 to your computer and use it in GitHub Desktop.
PHP Hands-On @ Hackerspace 22 March 2012
Login to AWS Management Console.
Start a Debian (x86) micro instance.
Access your instance via SSH.
Edit sources:
nano /etc/apt/sources.list
Copy:
deb http://packages.dotdeb.org squeeze all
deb-src http://packages.dotdeb.org squeeze all
Exit, then:
wget http://www.dotdeb.org/dotdeb.gpg
cat dotdeb.gpg | sudo apt-key add -
Update apt sources:
apt-get update
Install packages:
apt-get install nginx mysql-server php5-fpm php5-mysql php5-gd php5-curl git
Get ThinkUp straight from the source:
git clone https://github.com/ginatrapani/ThinkUp /usr/share/thinkup
Login to MySQL:
mysql –u root –p
Create the Database:
CREATE DATABASE thinkup;
Grant connection privilege:
GRANT USAGE ON *.* TO thinkup@localhost IDENTIFIED BY ‘thinkuppassword’;
Grant database privilege:
GRANT ALL PRIVILEGES ON thinkup.* to thinkup@localhost ;
Give it a spin:
mysql –u thinkup –p‘thinkuppassword’ thinkup
Create a new site config:
touch /etc/nginx/sites-enabled/thinkup nano
/etc/nginx/sites-enabled/thinkup
Add some configurations:
server {
listen 80;
root /usr/share/thinkup;
index index.php;
server_name your-hostname;
location ~ ^/(.+\.php)$ {
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment