Skip to content

Instantly share code, notes, and snippets.

@macx
Last active August 29, 2015 14:19
Show Gist options
  • Select an option

  • Save macx/1e6d4bd2ecbd1f01c9fc to your computer and use it in GitHub Desktop.

Select an option

Save macx/1e6d4bd2ecbd1f01c9fc to your computer and use it in GitHub Desktop.
Setup Amazon Server

Login and Configuration

ssh -i ~/.ssh/your_key_rsa [email protected]
sudo bash              # Set User Admin privileges 
cd /var/www/           # Change to Doc-Root
chown -R username html # Give privileges to Doc-Roo
chgrp wheel html       # Set Apache-group
 
# Restart Apache, if needed
sudo service httpd restart

Start MySQL-Server

sudo bash                   # Set User Admin privileges 
/sbin/service mysqld start  # Start MySQL-Server
mysql -u root               # Login at DB Server

Create DB User and Database

/* Set user per project */
CREATE USER 'myUser'@'localhost' IDENTIFIED BY 'myPassword';
 
/* Grant privileges and restart the rights table */
GRANT ALL PRIVILEGES ON * . * TO 'myUser'@'localhost';
 
FLUSH PRIVILEGES;
 
/* Create Database */
CREATE DATABASE myname;
USE myname;
 
/* Create Tables */
CREATE TABLE `foobar` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `text` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
/* Check */
DESCRIBE advent_profiles;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment