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.
Setup AWS EC2 and RDS (php5.5, apache2.4, mysql5.5, phpmyadmin)
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
@lmon
Copy link

lmon commented Dec 16, 2014

thank you!
(you have a typo: "Git Depoly" should be "Git Deploy") 😄

@pakwai122
Copy link

sudo yum install -y php55-mysqlnd php55 php55-xml php55-mcrypt php55-mbstring php55-cli mysql55 mysql55-server httpd24

sudo yum groupinstall -y "Web Server" "MySQL Database" "PHP Support"

What are the difference between these two scripts? currently, I'm using ec2 to host a Wordpress site with your server script to setup which is nice, but the script looks missed sth that "groupinstall" has. How can I do the groupinstall to connect the RDS plus install the phpmyadmin?? cuz I tried the groupinstall and it failed to connect the RDS and install phpmyadmin, please help.

@tywoplenty
Copy link

Thank you =)

@asacolips
Copy link

This is awesome, thank you! I've been struggling with getting php 5.5 running on ec2 and this process worked flawlessly.

@orange7986
Copy link

So cool! thank you.

@ghostidentity
Copy link

Very helpful, thank you.

@sameernagegowda
Copy link

Brilliant stuff.. thanks a lot

@mahendramcoders
Copy link

i am executing this command service mysqld start it getting error comman not unrecongnised service

@rijasmk
Copy link

rijasmk commented Oct 1, 2015

@vint2000
Copy link

How do I create an ALIAS for phpmyadmin, for security reasons

@adeelahmed
Copy link

Thanks very much, A great help!!

@kaizenlpi
Copy link

Tyvm! On the last step, I tried http://YOUR_SERVER_IP/db_test.php with my ec2's url. The browser returns: object(mysqli)#1 (19) { ["affected_rows"]=> int(0) ["client_info"]=> string(79) "mysqlnd 5.0.11-dev - 20120503 - $Id: 15d5c781cfcad91193dceae1d2cdd127674ddb3e $" ["client_version"]=> int(50011) ["connect_errno"]=> int(0) ["connect_error"]=> NULL ["errno"]=> int(0) ["error"]=> string(0) "" ["error_list"]=> array(0) { } ["field_count"]=> int(0) ["host_info"]=> string(61) "rackspace.cakmjmk8ufvv.us-east-1.rds.amazonaws.com via TCP/IP" ["info"]=> NULL ["insert_id"]=> int(0) ["server_info"]=> string(10) "5.6.23-log" ["server_version"]=> int(50623) ["stat"]=> string(134) "Uptime: 8363 Threads: 2 Questions: 4473 Slow queries: 0 Opens: 81 Flush tables: 1 Open tables: 74 Queries per second avg: 0.534" ["sqlstate"]=> string(5) "00000" ["protocol_version"]=> int(10) ["thread_id"]=> int(74) ["warning_count"]=> int(0) }

What happened?

@makkaba
Copy link

makkaba commented Apr 16, 2016

thanks a lot !!

@Creativefriends
Copy link

Hey buddy, am having some issues can I hire you to set things up? the wordpress is already done, but not able to connect to existing database, please email: awesome(dot)info@creativefriends(dot)asia
thanks

@jeffmcneill
Copy link

jeffmcneill commented Jul 29, 2017

Install PhpMyAdmin from the Amazon EPEL Repository, after Enabling EPEL:

yum-config-manager --enable epel
yum install phpmyadmin

Edit the file /etc/httpd/conf.d/phpMyAdmin.conf and replace 127.0.0.1 with the ip address of the client.

nano /etc/httpd/conf.d/phpMyAdmin.conf

Restart the web server

service httpd restart

Test to see if it works

https://host.domain.tld/phpmyadmin/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment