Skip to content

Instantly share code, notes, and snippets.

@suvozy
Last active December 28, 2022 07:43
Show Gist options
  • Select an option

  • Save suvozy/8998731 to your computer and use it in GitHub Desktop.

Select an option

Save suvozy/8998731 to your computer and use it in GitHub Desktop.

Revisions

  1. suvozy revised this gist Aug 10, 2015. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion Setup.md
    Original file line number Diff line number Diff line change
    @@ -116,7 +116,7 @@ with username `root` password `SUPERSECUREPASSWORD`
    rm -rf config
    ```

    #Setup RDS
    # Setup RDS
    Setup RDS with username `awsuser` password `mypassword`

    ## Security group
    @@ -126,6 +126,7 @@ Type | Protocol | Port Range | Source
    ---- | -------- | ---------- | ------
    MYSQL/Aurora | TCP | 3306 | sg-abcdefgh (phpMyAdmin)

    # Connect to RDS
    ## Edit Config
    ```shell
    nano /var/www/html/phpmyadmin/config.inc.php
  2. suvozy revised this gist Aug 10, 2015. 1 changed file with 0 additions and 5 deletions.
    5 changes: 0 additions & 5 deletions Setup.md
    Original file line number Diff line number Diff line change
    @@ -10,11 +10,6 @@ Type | Protocol | Port Range | Destination
    SSH | TCP | 22 | 0.0.0.0/0
    HTTP | TCP | 80 | 0.0.0.0/0

    ## Outbound
    Type | Protocol | Port Range | Destination
    ---- | -------- | ---------- | -----------
    All traffic | All | All | 0.0.0.0/0

    Assign `phpMyAdmin` to the new EC2 instance and visit
    ```
    http://YOUR_SERVER_IP
  3. suvozy revised this gist Aug 10, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions Setup.md
    Original file line number Diff line number Diff line change
    @@ -126,6 +126,7 @@ Setup RDS with username `awsuser` password `mypassword`

    ## Security group
    `rds`

    Type | Protocol | Port Range | Source
    ---- | -------- | ---------- | ------
    MYSQL/Aurora | TCP | 3306 | sg-abcdefgh (phpMyAdmin)
  4. suvozy revised this gist Aug 10, 2015. 1 changed file with 23 additions and 17 deletions.
    40 changes: 23 additions & 17 deletions Setup.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    #Launch an instance
    # Launch an instance
    http://docs.aws.amazon.com/AmazonVPC/latest/GettingStartedGuide/GetStarted.html

    # Security group
    @@ -20,38 +20,38 @@ Assign `phpMyAdmin` to the new EC2 instance and visit
    http://YOUR_SERVER_IP
    ```

    #Setup EC2
    # Setup EC2

    ```shell
    chmod 400 key.pem
    ssh -i key.pem ec2-user@YOUR_SERVER_IP
    ```

    ##Root login
    ## Root login
    ```shell
    sudo -i
    ```

    ##Update and install
    ## Update and install
    ```shell
    yum -y update
    yum install -y gcc make gcc-c++
    yum install -y php55-mysqlnd php55 php55-xml php55-mcrypt php55-mbstring php55-cli mysql55 mysql55-server httpd24
    ```
    `-y` will tell yum to say yes to all questions.

    ##Start your engines
    ## Start your engines
    ```shell
    service httpd start
    service mysqld start
    ```

    ##MySQL Setup
    ## MySQL Setup
    ```shell
    /usr/bin/mysqladmin -u root password SUPERSECUREPASSWORD
    ```

    ##Setup startup scripts for apache and MySQL
    ## Setup startup scripts for apache and MySQL
    ```shell
    cd /etc/rc.d/rc3.d
    rm K15httpd
    @@ -60,7 +60,7 @@ ln -s ../init.d/mysqld S30mysql
    ln -s ../init.d/httpd S85httpd
    ```

    ##Install phpMyAdmin
    ## Install phpMyAdmin
    ```shell
    cd /var/www/html
    wget https://files.phpmyadmin.net/phpMyAdmin/4.4.13.1/phpMyAdmin-4.4.13.1-english.tar.gz
    @@ -86,7 +86,7 @@ And last, run this command to associate that user with the phpmyadmin folder:
    chown -R apache.apache phpmyadmin/
    ```

    ##Install Config
    ## Install Config
    ```shell
    cd /var/www/html/phpmyadmin/
    cp config.sample.inc.php config.inc.php
    @@ -96,7 +96,7 @@ cp config.sample.inc.php config/config.inc.php
    chmod o+w config/config.inc.php
    ```

    ##Setup Config
    ## Setup Config
    ```shell
    nano /var/www/html/phpmyadmin/config.inc.php
    ```
    @@ -105,40 +105,46 @@ $cfg['blowfish_secret'] = '{^QP+-(3mlHy+Gd~FE3mN{gIATs^1lX+T=KVYv{ubK*U0V';
    ```
    reference: http://www.question-defense.com/tools/phpmyadmin-blowfish-secret-generator

    ##Restart Server
    ## Restart Server
    ```shell
    service httpd restart
    ```

    ##Setup phpMyAdmin
    ## Setup phpMyAdmin
    ```
    http://YOUR_SERVER_IP/phpmyadmin/index.php
    ```
    with username `root` password `SUPERSECUREPASSWORD`

    ##Remove config folder
    ## Remove config folder
    ```shell
    rm -rf config
    ```

    #Setup RDS
    Setup RDS with username `awsuser` password `mypassword`

    ##Edit Config
    ## Security group
    `rds`
    Type | Protocol | Port Range | Source
    ---- | -------- | ---------- | ------
    MYSQL/Aurora | TCP | 3306 | sg-abcdefgh (phpMyAdmin)

    ## Edit Config
    ```shell
    nano /var/www/html/phpmyadmin/config.inc.php
    ```
    ```php
    $cfg['Servers'][$i]['host'] = 'mydbinstance.abcdefghijkl.us-east-1.rds.amazonaws.com:3306'
    ```

    ##Access phpMyAdmin
    ## Access phpMyAdmin
    ```
    http://YOUR_SERVER_IP/phpmyadmin/index.php
    ```
    with username `awsuser` password `mypassword`

    ##phpinfo
    ## phpinfo
    ```shell
    nano /var/www/html/info.php
    ```
    @@ -149,7 +155,7 @@ nano /var/www/html/info.php
    http://YOUR_SERVER_IP/info.php
    ```

    ##Test db connection
    ## Test db connection
    ```shell
    nano /var/www/html/db_test.php
    ```
  5. suvozy revised this gist Aug 10, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Setup.md
    Original file line number Diff line number Diff line change
    @@ -38,7 +38,7 @@ yum -y update
    yum install -y gcc make gcc-c++
    yum install -y php55-mysqlnd php55 php55-xml php55-mcrypt php55-mbstring php55-cli mysql55 mysql55-server httpd24
    ```
    -y will tell yum to say yes to all questions.
    `-y` will tell yum to say yes to all questions.

    ##Start your engines
    ```shell
  6. suvozy revised this gist Aug 10, 2015. 1 changed file with 42 additions and 42 deletions.
    84 changes: 42 additions & 42 deletions Setup.md
    Original file line number Diff line number Diff line change
    @@ -22,56 +22,56 @@ http://YOUR_SERVER_IP

    #Setup EC2

    ```
    ```shell
    chmod 400 key.pem
    ssh -i key.pem ec2-user@YOUR_SERVER_IP
    ```

    ##Root login
    ```
    ```shell
    sudo -i
    ```

    ##Update and install
    ```
    sudo yum -y update
    sudo yum install -y gcc make gcc-c++
    sudo yum install -y php55-mysqlnd php55 php55-xml php55-mcrypt php55-mbstring php55-cli mysql55 mysql55-server httpd24
    ```shell
    yum -y update
    yum install -y gcc make gcc-c++
    yum install -y php55-mysqlnd php55 php55-xml php55-mcrypt php55-mbstring php55-cli mysql55 mysql55-server httpd24
    ```
    -y will tell yum to say yes to all questions.

    ##Start your engines
    ```
    sudo service httpd start
    sudo service mysqld start
    ```shell
    service httpd start
    service mysqld start
    ```

    ##MySQL Setup
    ```
    sudo /usr/bin/mysqladmin -u root password SUPERSECUREPASSWORD
    ```shell
    /usr/bin/mysqladmin -u root password SUPERSECUREPASSWORD
    ```

    ##Setup startup scripts for apache and MySQL
    ```
    ```shell
    cd /etc/rc.d/rc3.d
    sudo rm K15httpd
    sudo rm K36mysqld
    sudo ln -s ../init.d/mysqld S30mysql
    sudo ln -s ../init.d/httpd S85httpd
    rm K15httpd
    rm K36mysqld
    ln -s ../init.d/mysqld S30mysql
    ln -s ../init.d/httpd S85httpd
    ```

    ##Install phpMyAdmin
    ```
    ```shell
    cd /var/www/html
    sudo wget https://files.phpmyadmin.net/phpMyAdmin/4.4.13.1/phpMyAdmin-4.4.13.1-english.tar.gz
    sudo tar -xzvf phpMyAdmin-4.4.13.1-english.tar.gz -C /var/www/html
    sudo mv phpMyAdmin-4.4.13.1-english phpmyadmin
    sudo rm -rf phpMyAdmin-4.4.13.1-english.tar.gz
    wget https://files.phpmyadmin.net/phpMyAdmin/4.4.13.1/phpMyAdmin-4.4.13.1-english.tar.gz
    tar -xzvf phpMyAdmin-4.4.13.1-english.tar.gz -C /var/www/html
    mv phpMyAdmin-4.4.13.1-english phpmyadmin
    rm -rf phpMyAdmin-4.4.13.1-english.tar.gz
    ```
    check for updates: https://www.phpmyadmin.net/downloads/

    We now need to add permission for this folder, find the user group (should be apache) with this command:
    ```
    ```shell
    egrep 'User|Group' /etc/httpd/conf/httpd.conf
    ```

    @@ -82,32 +82,32 @@ Group apache
    ```

    And last, run this command to associate that user with the phpmyadmin folder:
    ```
    sudo chown -R apache.apache phpmyadmin/
    ```shell
    chown -R apache.apache phpmyadmin/
    ```

    ##Install Config
    ```
    ```shell
    cd /var/www/html/phpmyadmin/
    sudo cp config.sample.inc.php config.inc.php
    sudo mkdir config
    sudo chmod o+rw config
    sudo cp config.sample.inc.php config/config.inc.php
    sudo chmod o+w config/config.inc.php
    cp config.sample.inc.php config.inc.php
    mkdir config
    chmod o+rw config
    cp config.sample.inc.php config/config.inc.php
    chmod o+w config/config.inc.php
    ```

    ##Setup Config
    ```
    sudo nano /var/www/html/phpmyadmin/config.inc.php
    ```shell
    nano /var/www/html/phpmyadmin/config.inc.php
    ```
    ```php
    $cfg['blowfish_secret'] = '{^QP+-(3mlHy+Gd~FE3mN{gIATs^1lX+T=KVYv{ubK*U0V';
    ```
    reference: http://www.question-defense.com/tools/phpmyadmin-blowfish-secret-generator

    ##Restart Server
    ```
    sudo service httpd restart
    ```shell
    service httpd restart
    ```

    ##Setup phpMyAdmin
    @@ -117,16 +117,16 @@ http://YOUR_SERVER_IP/phpmyadmin/index.php
    with username `root` password `SUPERSECUREPASSWORD`

    ##Remove config folder
    ```
    sudo rm -rf config
    ```shell
    rm -rf config
    ```

    #Setup RDS
    Setup RDS with username `awsuser` password `mypassword`

    ##Edit Config
    ```
    sudo nano /var/www/html/phpmyadmin/config.inc.php
    ```shell
    nano /var/www/html/phpmyadmin/config.inc.php
    ```
    ```php
    $cfg['Servers'][$i]['host'] = 'mydbinstance.abcdefghijkl.us-east-1.rds.amazonaws.com:3306'
    @@ -139,8 +139,8 @@ http://YOUR_SERVER_IP/phpmyadmin/index.php
    with username `awsuser` password `mypassword`

    ##phpinfo
    ```
    sudo nano /var/www/html/info.php
    ```shell
    nano /var/www/html/info.php
    ```
    ```php
    <?php phpinfo(); ?>
    @@ -150,8 +150,8 @@ http://YOUR_SERVER_IP/info.php
    ```

    ##Test db connection
    ```
    sudo nano /var/www/html/db_test.php
    ```shell
    nano /var/www/html/db_test.php
    ```
    ```php
    <?php
  7. suvozy revised this gist Aug 10, 2015. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion Setup.md
    Original file line number Diff line number Diff line change
    @@ -142,9 +142,12 @@ with username `awsuser` password `mypassword`
    ```
    sudo nano /var/www/html/info.php
    ```
    ```
    ```php
    <?php phpinfo(); ?>
    ```
    ```
    http://YOUR_SERVER_IP/info.php
    ```

    ##Test db connection
    ```
    @@ -160,6 +163,9 @@ var_dump($link);
    $link = mysqli_connect('localhost', 'root', 'SUPERSECUREPASSWORD', 'information_schema');
    var_dump($link);
    ```
    ```
    http://YOUR_SERVER_IP/db_test.php
    ```

    #Git Deploy
    https://gist.github.com/oodavid/1809044
  8. suvozy revised this gist Aug 10, 2015. 1 changed file with 19 additions and 0 deletions.
    19 changes: 19 additions & 0 deletions Setup.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,25 @@
    #Launch an instance
    http://docs.aws.amazon.com/AmazonVPC/latest/GettingStartedGuide/GetStarted.html

    # Security group
    `phpMyAdmin`

    ## Inbound
    Type | Protocol | Port Range | Destination
    ---- | -------- | ---------- | -----------
    SSH | TCP | 22 | 0.0.0.0/0
    HTTP | TCP | 80 | 0.0.0.0/0

    ## Outbound
    Type | Protocol | Port Range | Destination
    ---- | -------- | ---------- | -----------
    All traffic | All | All | 0.0.0.0/0

    Assign `phpMyAdmin` to the new EC2 instance and visit
    ```
    http://YOUR_SERVER_IP
    ```

    #Setup EC2

    ```
  9. suvozy revised this gist Aug 9, 2015. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions Setup.md
    Original file line number Diff line number Diff line change
    @@ -44,12 +44,12 @@ sudo ln -s ../init.d/httpd S85httpd
    ##Install phpMyAdmin
    ```
    cd /var/www/html
    sudo wget http://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/4.1.7/phpMyAdmin-4.1.7-all-languages.tar.gz
    sudo tar -xzvf phpMyAdmin-4.1.7-all-languages.tar.gz -C /var/www/html
    sudo mv phpMyAdmin-4.1.7-all-languages phpmyadmin
    sudo rm -rf phpMyAdmin-4.1.7-all-languages.tar.gz
    sudo wget https://files.phpmyadmin.net/phpMyAdmin/4.4.13.1/phpMyAdmin-4.4.13.1-english.tar.gz
    sudo tar -xzvf phpMyAdmin-4.4.13.1-english.tar.gz -C /var/www/html
    sudo mv phpMyAdmin-4.4.13.1-english phpmyadmin
    sudo rm -rf phpMyAdmin-4.4.13.1-english.tar.gz
    ```
    check for updates: http://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/
    check for updates: https://www.phpmyadmin.net/downloads/

    We now need to add permission for this folder, find the user group (should be apache) with this command:
    ```
  10. suvozy revised this gist Jan 18, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Setup.md
    Original file line number Diff line number Diff line change
    @@ -142,5 +142,5 @@ $link = mysqli_connect('localhost', 'root', 'SUPERSECUREPASSWORD', 'information_
    var_dump($link);
    ```

    #Git Depoly
    #Git Deploy
    https://gist.github.com/oodavid/1809044
  11. suvozy revised this gist Nov 21, 2014. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions Setup.md
    Original file line number Diff line number Diff line change
    @@ -132,10 +132,12 @@ sudo nano /var/www/html/info.php
    sudo nano /var/www/html/db_test.php
    ```
    ```php
    <?php
    $link = mysqli_connect('mydbinstance.abcdefghijkl.us-east-1.rds.amazonaws.com', 'awsuser', 'mypassword', 'information_schema', 3306);
    var_dump($link);
    ```
    ```php
    <?php
    $link = mysqli_connect('localhost', 'root', 'SUPERSECUREPASSWORD', 'information_schema');
    var_dump($link);
    ```
  12. suvozy revised this gist Jul 12, 2014. 2 changed files with 0 additions and 44 deletions.
    File renamed without changes.
    44 changes: 0 additions & 44 deletions Step 2.md
    Original file line number Diff line number Diff line change
    @@ -1,44 +0,0 @@
    ```
    sudo -i
    ```

    #Build webapp key
    ```
    sudo -Hu webapp ssh-keygen -t rsa # choose "no passphrase"
    ```
    or
    ```
    sudo -Hu webapp ssh-keygen -t rsa -C "server-webapp@rime.co"
    ```

    ##Clone
    ```
    cat /home/webapp/.ssh/id_rsa.pub
    sudo -Hu webapp git clone git@github.com:suvozit/log-pixel.git /var/www/html
    ```

    #Build Server key
    ##Generate
    https://help.github.com/articles/generating-ssh-keys

    ##Apply
    ```
    cat id_rsa.pub
    ```
    https://github.com/settings/ssh

    ##Hanlde Error
    https://help.github.com/articles/error-permission-denied-publickey

    #Clean html folder
    ```
    cd /var/www/html
    rm -rf .* *
    ```

    #Clone Source
    ```
    git clone git@github.com:suvozit/log-pixel.git /var/www/html
    git reset --hard HEAD
    ```
  13. suvozy revised this gist Jul 12, 2014. 1 changed file with 144 additions and 0 deletions.
    144 changes: 144 additions & 0 deletions Step 1.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,144 @@
    #Launch an instance
    http://docs.aws.amazon.com/AmazonVPC/latest/GettingStartedGuide/GetStarted.html

    #Setup EC2

    ```
    chmod 400 key.pem
    ssh -i key.pem ec2-user@YOUR_SERVER_IP
    ```

    ##Root login
    ```
    sudo -i
    ```

    ##Update and install
    ```
    sudo yum -y update
    sudo yum install -y gcc make gcc-c++
    sudo yum install -y php55-mysqlnd php55 php55-xml php55-mcrypt php55-mbstring php55-cli mysql55 mysql55-server httpd24
    ```
    -y will tell yum to say yes to all questions.

    ##Start your engines
    ```
    sudo service httpd start
    sudo service mysqld start
    ```

    ##MySQL Setup
    ```
    sudo /usr/bin/mysqladmin -u root password SUPERSECUREPASSWORD
    ```

    ##Setup startup scripts for apache and MySQL
    ```
    cd /etc/rc.d/rc3.d
    sudo rm K15httpd
    sudo rm K36mysqld
    sudo ln -s ../init.d/mysqld S30mysql
    sudo ln -s ../init.d/httpd S85httpd
    ```

    ##Install phpMyAdmin
    ```
    cd /var/www/html
    sudo wget http://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/4.1.7/phpMyAdmin-4.1.7-all-languages.tar.gz
    sudo tar -xzvf phpMyAdmin-4.1.7-all-languages.tar.gz -C /var/www/html
    sudo mv phpMyAdmin-4.1.7-all-languages phpmyadmin
    sudo rm -rf phpMyAdmin-4.1.7-all-languages.tar.gz
    ```
    check for updates: http://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/

    We now need to add permission for this folder, find the user group (should be apache) with this command:
    ```
    egrep 'User|Group' /etc/httpd/conf/httpd.conf
    ```

    Which will return:
    ```
    User apache
    Group apache
    ```

    And last, run this command to associate that user with the phpmyadmin folder:
    ```
    sudo chown -R apache.apache phpmyadmin/
    ```

    ##Install Config
    ```
    cd /var/www/html/phpmyadmin/
    sudo cp config.sample.inc.php config.inc.php
    sudo mkdir config
    sudo chmod o+rw config
    sudo cp config.sample.inc.php config/config.inc.php
    sudo chmod o+w config/config.inc.php
    ```

    ##Setup Config
    ```
    sudo nano /var/www/html/phpmyadmin/config.inc.php
    ```
    ```php
    $cfg['blowfish_secret'] = '{^QP+-(3mlHy+Gd~FE3mN{gIATs^1lX+T=KVYv{ubK*U0V';
    ```
    reference: http://www.question-defense.com/tools/phpmyadmin-blowfish-secret-generator

    ##Restart Server
    ```
    sudo service httpd restart
    ```

    ##Setup phpMyAdmin
    ```
    http://YOUR_SERVER_IP/phpmyadmin/index.php
    ```
    with username `root` password `SUPERSECUREPASSWORD`

    ##Remove config folder
    ```
    sudo rm -rf config
    ```

    #Setup RDS
    Setup RDS with username `awsuser` password `mypassword`

    ##Edit Config
    ```
    sudo nano /var/www/html/phpmyadmin/config.inc.php
    ```
    ```php
    $cfg['Servers'][$i]['host'] = 'mydbinstance.abcdefghijkl.us-east-1.rds.amazonaws.com:3306'
    ```

    ##Access phpMyAdmin
    ```
    http://YOUR_SERVER_IP/phpmyadmin/index.php
    ```
    with username `awsuser` password `mypassword`

    ##phpinfo
    ```
    sudo nano /var/www/html/info.php
    ```
    ```
    <?php phpinfo(); ?>
    ```

    ##Test db connection
    ```
    sudo nano /var/www/html/db_test.php
    ```
    ```php
    $link = mysqli_connect('mydbinstance.abcdefghijkl.us-east-1.rds.amazonaws.com', 'awsuser', 'mypassword', 'information_schema', 3306);
    var_dump($link);
    ```
    ```php
    $link = mysqli_connect('localhost', 'root', 'SUPERSECUREPASSWORD', 'information_schema');
    var_dump($link);
    ```

    #Git Depoly
    https://gist.github.com/oodavid/1809044
  14. suvozy revised this gist Jul 12, 2014. 2 changed files with 22 additions and 166 deletions.
    44 changes: 0 additions & 44 deletions Step 1.md
    Original file line number Diff line number Diff line change
    @@ -1,44 +0,0 @@
    ```
    sudo -i
    ```

    #Build webapp key
    ```
    sudo -Hu webapp ssh-keygen -t rsa # choose "no passphrase"
    ```
    or
    ```
    sudo -Hu webapp ssh-keygen -t rsa -C "server-webapp@rime.co"
    ```

    ##Clone
    ```
    cat /home/webapp/.ssh/id_rsa.pub
    sudo -Hu webapp git clone git@github.com:suvozit/log-pixel.git /var/www/html
    ```

    #Build Server key
    ##Generate
    https://help.github.com/articles/generating-ssh-keys

    ##Apply
    ```
    cat id_rsa.pub
    ```
    https://github.com/settings/ssh

    ##Hanlde Error
    https://help.github.com/articles/error-permission-denied-publickey

    #Clean html folder
    ```
    cd /var/www/html
    rm -rf .* *
    ```

    #Clone Source
    ```
    git clone git@github.com:suvozit/log-pixel.git /var/www/html
    git reset --hard HEAD
    ```
    144 changes: 22 additions & 122 deletions Step 2.md
    Original file line number Diff line number Diff line change
    @@ -1,144 +1,44 @@
    #Launch an instance
    http://docs.aws.amazon.com/AmazonVPC/latest/GettingStartedGuide/GetStarted.html

    #Setup EC2

    ```
    chmod 400 key.pem
    ssh -i key.pem ec2-user@YOUR_SERVER_IP
    ```

    ##Root login
    ```
    sudo -i
    ```

    ##Update and install
    ```
    sudo yum -y update
    sudo yum install -y gcc make gcc-c++
    sudo yum install -y php55-mysqlnd php55 php55-xml php55-mcrypt php55-mbstring php55-cli mysql55 mysql55-server httpd24
    ```
    -y will tell yum to say yes to all questions.

    ##Start your engines
    ```
    sudo service httpd start
    sudo service mysqld start
    ```

    ##MySQL Setup
    ```
    sudo /usr/bin/mysqladmin -u root password SUPERSECUREPASSWORD
    ```

    ##Setup startup scripts for apache and MySQL
    ```
    cd /etc/rc.d/rc3.d
    sudo rm K15httpd
    sudo rm K36mysqld
    sudo ln -s ../init.d/mysqld S30mysql
    sudo ln -s ../init.d/httpd S85httpd
    ```

    ##Install phpMyAdmin
    #Build webapp key
    ```
    cd /var/www/html
    sudo wget http://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/4.1.7/phpMyAdmin-4.1.7-all-languages.tar.gz
    sudo tar -xzvf phpMyAdmin-4.1.7-all-languages.tar.gz -C /var/www/html
    sudo mv phpMyAdmin-4.1.7-all-languages phpmyadmin
    sudo rm -rf phpMyAdmin-4.1.7-all-languages.tar.gz
    sudo -Hu webapp ssh-keygen -t rsa # choose "no passphrase"
    ```
    check for updates: http://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/

    We now need to add permission for this folder, find the user group (should be apache) with this command:
    or
    ```
    egrep 'User|Group' /etc/httpd/conf/httpd.conf
    sudo -Hu webapp ssh-keygen -t rsa -C "server-webapp@rime.co"
    ```

    Which will return:
    ##Clone
    ```
    User apache
    Group apache
    cat /home/webapp/.ssh/id_rsa.pub
    sudo -Hu webapp git clone git@github.com:suvozit/log-pixel.git /var/www/html
    ```

    And last, run this command to associate that user with the phpmyadmin folder:
    ```
    sudo chown -R apache.apache phpmyadmin/
    ```
    #Build Server key
    ##Generate
    https://help.github.com/articles/generating-ssh-keys

    ##Install Config
    ##Apply
    ```
    cd /var/www/html/phpmyadmin/
    sudo cp config.sample.inc.php config.inc.php
    sudo mkdir config
    sudo chmod o+rw config
    sudo cp config.sample.inc.php config/config.inc.php
    sudo chmod o+w config/config.inc.php
    cat id_rsa.pub
    ```
    https://github.com/settings/ssh

    ##Setup Config
    ```
    sudo nano /var/www/html/phpmyadmin/config.inc.php
    ```
    ```php
    $cfg['blowfish_secret'] = '{^QP+-(3mlHy+Gd~FE3mN{gIATs^1lX+T=KVYv{ubK*U0V';
    ```
    reference: http://www.question-defense.com/tools/phpmyadmin-blowfish-secret-generator
    ##Hanlde Error
    https://help.github.com/articles/error-permission-denied-publickey

    ##Restart Server
    #Clean html folder
    ```
    sudo service httpd restart
    ```

    ##Setup phpMyAdmin
    ```
    http://YOUR_SERVER_IP/phpmyadmin/index.php
    ```
    with username `root` password `SUPERSECUREPASSWORD`

    ##Remove config folder
    ```
    sudo rm -rf config
    ```

    #Setup RDS
    Setup RDS with username `awsuser` password `mypassword`

    ##Edit Config
    ```
    sudo nano /var/www/html/phpmyadmin/config.inc.php
    ```
    ```php
    $cfg['Servers'][$i]['host'] = 'mydbinstance.abcdefghijkl.us-east-1.rds.amazonaws.com:3306'
    ```

    ##Access phpMyAdmin
    ```
    http://YOUR_SERVER_IP/phpmyadmin/index.php
    ```
    with username `awsuser` password `mypassword`

    ##phpinfo
    ```
    sudo nano /var/www/html/info.php
    ```
    ```
    <?php phpinfo(); ?>
    cd /var/www/html
    rm -rf .* *
    ```

    ##Test db connection
    ```
    sudo nano /var/www/html/db_test.php
    ```
    ```php
    $link = mysqli_connect('mydbinstance.abcdefghijkl.us-east-1.rds.amazonaws.com', 'awsuser', 'mypassword', 'information_schema', 3306);
    var_dump($link);
    ```
    ```php
    $link = mysqli_connect('localhost', 'root', 'SUPERSECUREPASSWORD', 'information_schema');
    var_dump($link);
    #Clone Source
    ```
    git clone git@github.com:suvozit/log-pixel.git /var/www/html
    #Git Depoly
    https://gist.github.com/oodavid/1809044
    git reset --hard HEAD
    ```
  15. suvozy revised this gist Jul 12, 2014. 2 changed files with 0 additions and 0 deletions.
    File renamed without changes.
    File renamed without changes.
  16. suvozy revised this gist Jul 12, 2014. 1 changed file with 44 additions and 0 deletions.
    44 changes: 44 additions & 0 deletions Readme.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,44 @@
    ```
    sudo -i
    ```

    #Build webapp key
    ```
    sudo -Hu webapp ssh-keygen -t rsa # choose "no passphrase"
    ```
    or
    ```
    sudo -Hu webapp ssh-keygen -t rsa -C "server-webapp@rime.co"
    ```

    ##Clone
    ```
    cat /home/webapp/.ssh/id_rsa.pub
    sudo -Hu webapp git clone git@github.com:suvozit/log-pixel.git /var/www/html
    ```

    #Build Server key
    ##Generate
    https://help.github.com/articles/generating-ssh-keys

    ##Apply
    ```
    cat id_rsa.pub
    ```
    https://github.com/settings/ssh

    ##Hanlde Error
    https://help.github.com/articles/error-permission-denied-publickey

    #Clean html folder
    ```
    cd /var/www/html
    rm -rf .* *
    ```

    #Clone Source
    ```
    git clone git@github.com:suvozit/log-pixel.git /var/www/html

    git reset --hard HEAD
    ```
  17. suvozy revised this gist Feb 26, 2014. 1 changed file with 18 additions and 1 deletion.
    19 changes: 18 additions & 1 deletion Setup.md
    Original file line number Diff line number Diff line change
    @@ -32,6 +32,15 @@ sudo service mysqld start
    sudo /usr/bin/mysqladmin -u root password SUPERSECUREPASSWORD
    ```

    ##Setup startup scripts for apache and MySQL
    ```
    cd /etc/rc.d/rc3.d
    sudo rm K15httpd
    sudo rm K36mysqld
    sudo ln -s ../init.d/mysqld S30mysql
    sudo ln -s ../init.d/httpd S85httpd
    ```

    ##Install phpMyAdmin
    ```
    cd /var/www/html
    @@ -110,10 +119,18 @@ http://YOUR_SERVER_IP/phpmyadmin/index.php
    ```
    with username `awsuser` password `mypassword`

    ##Test db connection
    ##phpinfo
    ```
    sudo nano /var/www/html/info.php
    ```
    ```
    <?php phpinfo(); ?>
    ```

    ##Test db connection
    ```
    sudo nano /var/www/html/db_test.php
    ```
    ```php
    $link = mysqli_connect('mydbinstance.abcdefghijkl.us-east-1.rds.amazonaws.com', 'awsuser', 'mypassword', 'information_schema', 3306);
    var_dump($link);
  18. suvozy revised this gist Feb 26, 2014. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion Setup.md
    Original file line number Diff line number Diff line change
    @@ -121,4 +121,7 @@ var_dump($link);
    ```php
    $link = mysqli_connect('localhost', 'root', 'SUPERSECUREPASSWORD', 'information_schema');
    var_dump($link);
    ```
    ```

    #Git Depoly
    https://gist.github.com/oodavid/1809044
  19. suvozy revised this gist Feb 15, 2014. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions Setup.md
    Original file line number Diff line number Diff line change
    @@ -7,6 +7,13 @@ http://docs.aws.amazon.com/AmazonVPC/latest/GettingStartedGuide/GetStarted.html
    chmod 400 key.pem
    ssh -i key.pem ec2-user@YOUR_SERVER_IP
    ```

    ##Root login
    ```
    sudo -i
    ```

    ##Update and install
    ```
    sudo yum -y update
    sudo yum install -y gcc make gcc-c++
  20. suvozy revised this gist Feb 15, 2014. 1 changed file with 3 additions and 5 deletions.
    8 changes: 3 additions & 5 deletions Setup.md
    Original file line number Diff line number Diff line change
    @@ -35,12 +35,10 @@ sudo rm -rf phpMyAdmin-4.1.7-all-languages.tar.gz
    ```
    check for updates: http://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/

    We now need to add a user and give that user permission for this folder:
    We now need to add permission for this folder, find the user group (should be apache) with this command:
    ```
    sudo adduser phpmyadmin
    sudo passwd phpmyadmin
    egrep 'User|Group' /etc/httpd/conf/httpd.conf
    ```
    After you set a password, find the user group (should be apache) with this command: `egrep 'User|Group' /etc/httpd/conf/httpd.conf`

    Which will return:
    ```
    @@ -50,7 +48,7 @@ Group apache

    And last, run this command to associate that user with the phpmyadmin folder:
    ```
    sudo chown -R phpmyadmin.apache phpmyadmin/
    sudo chown -R apache.apache phpmyadmin/
    ```

    ##Install Config
  21. suvozy revised this gist Feb 15, 2014. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion Setup.md
    Original file line number Diff line number Diff line change
    @@ -114,4 +114,6 @@ $link = mysqli_connect('mydbinstance.abcdefghijkl.us-east-1.rds.amazonaws.com',
    var_dump($link);
    ```
    ```php
    $link = mysqli_connect('localhost', 'ro
    $link = mysqli_connect('localhost', 'root', 'SUPERSECUREPASSWORD', 'information_schema');
    var_dump($link);
    ```
  22. suvozy revised this gist Feb 15, 2014. 1 changed file with 2 additions and 4 deletions.
    6 changes: 2 additions & 4 deletions Setup.md
    Original file line number Diff line number Diff line change
    @@ -96,7 +96,7 @@ Setup RDS with username `awsuser` password `mypassword`
    sudo nano /var/www/html/phpmyadmin/config.inc.php
    ```
    ```php
    $cfg['Servers'][$i]['host'] = 'mydbinstance.abcdefghijkl.us-east-1.rds.amazonaws.com'
    $cfg['Servers'][$i]['host'] = 'mydbinstance.abcdefghijkl.us-east-1.rds.amazonaws.com:3306'
    ```

    ##Access phpMyAdmin
    @@ -114,6 +114,4 @@ $link = mysqli_connect('mydbinstance.abcdefghijkl.us-east-1.rds.amazonaws.com',
    var_dump($link);
    ```
    ```php
    $link = mysqli_connect('localhost', 'root', 'SUPERSECUREPASSWORD', 'test');
    var_dump($link);
    ```
    $link = mysqli_connect('localhost', 'ro
  23. suvozy revised this gist Feb 15, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Setup.md
    Original file line number Diff line number Diff line change
    @@ -85,7 +85,7 @@ with username `root` password `SUPERSECUREPASSWORD`

    ##Remove config folder
    ```
    sudo nano rm -rf config
    sudo rm -rf config
    ```

    #Setup RDS
  24. suvozy revised this gist Feb 15, 2014. 1 changed file with 7 additions and 2 deletions.
    9 changes: 7 additions & 2 deletions Setup.md
    Original file line number Diff line number Diff line change
    @@ -56,6 +56,7 @@ sudo chown -R phpmyadmin.apache phpmyadmin/
    ##Install Config
    ```
    cd /var/www/html/phpmyadmin/
    sudo cp config.sample.inc.php config.inc.php
    sudo mkdir config
    sudo chmod o+rw config
    sudo cp config.sample.inc.php config/config.inc.php
    @@ -64,7 +65,7 @@ sudo chmod o+w config/config.inc.php

    ##Setup Config
    ```
    sudo nano /var/www/html/phpmyadmin/config/config.inc.php
    sudo nano /var/www/html/phpmyadmin/config.inc.php
    ```
    ```php
    $cfg['blowfish_secret'] = '{^QP+-(3mlHy+Gd~FE3mN{gIATs^1lX+T=KVYv{ubK*U0V';
    @@ -82,13 +83,17 @@ http://YOUR_SERVER_IP/phpmyadmin/index.php
    ```
    with username `root` password `SUPERSECUREPASSWORD`

    ##Remove config folder
    ```
    sudo nano rm -rf config
    ```

    #Setup RDS
    Setup RDS with username `awsuser` password `mypassword`

    ##Edit Config
    ```
    sudo nano /var/www/html/phpmyadmin/config/config.inc.php
    sudo nano /var/www/html/phpmyadmin/config.inc.php
    ```
    ```php
    $cfg['Servers'][$i]['host'] = 'mydbinstance.abcdefghijkl.us-east-1.rds.amazonaws.com'
  25. suvozy revised this gist Feb 14, 2014. 1 changed file with 2 additions and 4 deletions.
    6 changes: 2 additions & 4 deletions Setup.md
    Original file line number Diff line number Diff line change
    @@ -69,6 +69,7 @@ sudo nano /var/www/html/phpmyadmin/config/config.inc.php
    ```php
    $cfg['blowfish_secret'] = '{^QP+-(3mlHy+Gd~FE3mN{gIATs^1lX+T=KVYv{ubK*U0V';
    ```
    reference: http://www.question-defense.com/tools/phpmyadmin-blowfish-secret-generator

    ##Restart Server
    ```
    @@ -110,7 +111,4 @@ var_dump($link);
    ```php
    $link = mysqli_connect('localhost', 'root', 'SUPERSECUREPASSWORD', 'test');
    var_dump($link);
    ```

    #References:
    * WORDPRESS ON LINUX IN THE AMAZON CLOUD WITH MAC - http://caleb
    ```
  26. suvozy revised this gist Feb 14, 2014. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions Setup.md
    Original file line number Diff line number Diff line change
    @@ -53,7 +53,7 @@ And last, run this command to associate that user with the phpmyadmin folder:
    sudo chown -R phpmyadmin.apache phpmyadmin/
    ```

    ###Install Config
    ##Install Config
    ```
    cd /var/www/html/phpmyadmin/
    sudo mkdir config
    @@ -62,7 +62,7 @@ sudo cp config.sample.inc.php config/config.inc.php
    sudo chmod o+w config/config.inc.php
    ```

    ###Setup Config
    ##Setup Config
    ```
    sudo nano /var/www/html/phpmyadmin/config/config.inc.php
    ```
    @@ -113,4 +113,4 @@ var_dump($link);
    ```

    #References:
    * WORDPRESS ON LINUX IN THE AMAZON CLOUD WITH MAC - http://calebogden.com/wordpress-
    * WORDPRESS ON LINUX IN THE AMAZON CLOUD WITH MAC - http://caleb
  27. suvozy revised this gist Feb 14, 2014. 1 changed file with 15 additions and 15 deletions.
    30 changes: 15 additions & 15 deletions Setup.md
    Original file line number Diff line number Diff line change
    @@ -1,32 +1,31 @@
    #Launch an instance
    http://docs.aws.amazon.com/AmazonVPC/latest/GettingStartedGuide/GetStarted.html

    # Setup EC2
    #Setup EC2

    ```
    chmod 400 key.pem
    ssh -i key.pem ec2-user@YOUR_SERVER_IP
    ```

    -y will tell yum to say yes to all questions.
    ```
    sudo yum -y update
    sudo yum install -y gcc make gcc-c++
    sudo yum install -y php55-mysqlnd php55 php55-xml php55-mcrypt php55-mbstring php55-cli mysql55 mysql55-server httpd24
    ```
    -y will tell yum to say yes to all questions.

    Start your engines
    ##Start your engines
    ```
    sudo service httpd start
    sudo service mysqld start
    ```

    MySQL Setup
    ##MySQL Setup
    ```
    sudo /usr/bin/mysqladmin -u root password SUPERSECUREPASSWORD
    ```

    Install phpMyAdmin
    ##Install phpMyAdmin
    ```
    cd /var/www/html
    sudo wget http://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/4.1.7/phpMyAdmin-4.1.7-all-languages.tar.gz
    @@ -54,7 +53,7 @@ And last, run this command to associate that user with the phpmyadmin folder:
    sudo chown -R phpmyadmin.apache phpmyadmin/
    ```

    Install Config
    ###Install Config
    ```
    cd /var/www/html/phpmyadmin/
    sudo mkdir config
    @@ -63,42 +62,44 @@ sudo cp config.sample.inc.php config/config.inc.php
    sudo chmod o+w config/config.inc.php
    ```

    Setup Config
    ###Setup Config
    ```
    sudo nano /var/www/html/phpmyadmin/config/config.inc.php
    ```
    ```php
    $cfg['blowfish_secret'] = '{^QP+-(3mlHy+Gd~FE3mN{gIATs^1lX+T=KVYv{ubK*U0V';
    ```

    Restart Server
    ##Restart Server
    ```
    sudo service httpd restart
    ```

    Setup phpMyAdmin
    ##Setup phpMyAdmin
    ```
    http://YOUR_SERVER_IP/phpmyadmin/index.php
    ```
    with username `root` password `SUPERSECUREPASSWORD`


    #Setup RDS
    Setup RDS with username `awsuser` password `mypassword`. Edit Config
    Setup RDS with username `awsuser` password `mypassword`

    ##Edit Config
    ```
    sudo nano /var/www/html/phpmyadmin/config/config.inc.php
    ```
    ```php
    $cfg['Servers'][$i]['host'] = 'mydbinstance.abcdefghijkl.us-east-1.rds.amazonaws.com'
    ```

    Access phpMyAdmin
    ##Access phpMyAdmin
    ```
    http://YOUR_SERVER_IP/phpmyadmin/index.php
    ```
    with username `awsuser` password `mypassword`

    Test db connection
    ##Test db connection
    ```
    sudo nano /var/www/html/info.php
    ```
    @@ -112,5 +113,4 @@ var_dump($link);
    ```

    #References:
    * WORDPRESS ON LINUX IN THE AMAZON CLOUD WITH MAC - http://calebogden.com/wordpress-on-linux-in-the-amazon-cloud-with-mac
    * phpMyAdmin Blowfish Secret Generator - http://www.question-defense.com/tools/phpmyadmin-blowfish-secret-generator
    * WORDPRESS ON LINUX IN THE AMAZON CLOUD WITH MAC - http://calebogden.com/wordpress-
  28. suvozy revised this gist Feb 14, 2014. 1 changed file with 13 additions and 0 deletions.
    13 changes: 13 additions & 0 deletions Setup.md
    Original file line number Diff line number Diff line change
    @@ -98,6 +98,19 @@ http://YOUR_SERVER_IP/phpmyadmin/index.php
    ```
    with username `awsuser` password `mypassword`

    Test db connection
    ```
    sudo nano /var/www/html/info.php
    ```
    ```php
    $link = mysqli_connect('mydbinstance.abcdefghijkl.us-east-1.rds.amazonaws.com', 'awsuser', 'mypassword', 'information_schema', 3306);
    var_dump($link);
    ```
    ```php
    $link = mysqli_connect('localhost', 'root', 'SUPERSECUREPASSWORD', 'test');
    var_dump($link);
    ```

    #References:
    * WORDPRESS ON LINUX IN THE AMAZON CLOUD WITH MAC - http://calebogden.com/wordpress-on-linux-in-the-amazon-cloud-with-mac
    * phpMyAdmin Blowfish Secret Generator - http://www.question-defense.com/tools/phpmyadmin-blowfish-secret-generator
  29. suvozy revised this gist Feb 14, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Setup.md
    Original file line number Diff line number Diff line change
    @@ -89,7 +89,7 @@ Setup RDS with username `awsuser` password `mypassword`. Edit Config
    sudo nano /var/www/html/phpmyadmin/config/config.inc.php
    ```
    ```php
    $cfg['Servers'][$i]['host'] = 'xxx.xxxxxxxxxxxx.us-east-1.rds.amazonaws.com'
    $cfg['Servers'][$i]['host'] = 'mydbinstance.abcdefghijkl.us-east-1.rds.amazonaws.com'
    ```

    Access phpMyAdmin
  30. suvozy revised this gist Feb 14, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Setup.md
    Original file line number Diff line number Diff line change
    @@ -86,7 +86,7 @@ with username `root` password `SUPERSECUREPASSWORD`
    #Setup RDS
    Setup RDS with username `awsuser` password `mypassword`. Edit Config
    ```
    sudo nano /var/www/html/phpmyadmin/config.inc.php
    sudo nano /var/www/html/phpmyadmin/config/config.inc.php
    ```
    ```php
    $cfg['Servers'][$i]['host'] = 'xxx.xxxxxxxxxxxx.us-east-1.rds.amazonaws.com'