Difference between revisions of "Aws"
(21 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
===RDS=== | |||
[http://www.omh.cc/mycnf/ optimal memory for mysql] | |||
mysql -h mysql.ch13xre91kbe.us-east-1.rds.amazonaws.com -P3306 -u tim -p amnj | |||
/* Add Remote AWS RDS */ | |||
$i++; | |||
$cfg['Servers'][$i]['auth_type'] = 'HTTP'; | |||
$cfg['Servers'][$i]['hide_db'] = '(mysql|information_schema|phpmyadmin)'; | |||
/* Server parameters */ | |||
$cfg['Servers'][$i]['host'] = 'mysql.ch13xre91kbe.us-east-1.rds.amazonaws.com'; | |||
====tlkbam==== | |||
since migrating a copy to home linux box... | |||
=====installed on home===== | |||
apt-get install sqlite | |||
apt-get install php5-sqlite | |||
installed on homelamp | |||
useradd -d /home/levelthe -m levelthe | |||
/etc/apache2/sites-enabled and ln to it | |||
ln -s ../sites-available/levelthe levelthe | |||
/etc/init.d/apache2 restart | |||
====new natty instance ==== | |||
AMI: ebs/ubuntu-images/ubuntu-natty-11.04-amd64-server-20111003 (ami-fd589594 | |||
ssh -i .ssh/hpkey.pem ubuntu@ec2-184-72-86-119.compute-1.amazonaws.com | |||
whenver you restart an instance it gets a new ec2- number | |||
Install lamp | |||
sudo apt-get update , | |||
sudo apt-get install lamp-server^ (^somehow gets deps.) password for mysql tibo | |||
in browser | |||
ec2-107-22-18-113.compute-1.amazonaws.com shows its running | |||
running sftp is a hack since logged in as ubuntu and have no permissions | |||
<s>sudo chown -hR ubuntu /etc</s> fusck up everything just chown what you need to edit | |||
Check PHP by putting this file in /var/www | |||
<?php | |||
phpinfo(); | |||
?> | |||
If it trys to save the file php aint workin make sure php module is enabled. <s>or wait a little</s>restart apache | |||
sudo /etc/init.d/apache2 restart | |||
See if php is runnning from command line | |||
php -version | |||
=====reddit install===== | |||
after script ran it said nginx had a conflict with apache over port 80 so I edited /etc/apache2/ports.conf | |||
moving along created sudo useradd reddit, then sudo passwd reddit (jjjjjj) | |||
====misc commands==== | |||
rm -rf fir/ | |||
ln -s ../sites-available/webeshop webeshop | |||
====creating an image==== | |||
ami-ddb661b4 | |||
====the package that worked==== | ====the package that worked==== | ||
AMI: turnkey-lamp-11.3-lucid-x86.ebs (ami-c5458eac) root 07c69f95 | AMI: turnkey-lamp-11.3-lucid-x86.ebs (ami-c5458eac) root 07c69f95 | ||
Line 20: | Line 81: | ||
install php command line interpreter | install php command line interpreter | ||
apt-get install php5-cli | apt-get install php5-cli | ||
=====import database===== | |||
mysql -u pathbost_tim -p pathbost_poets < pathbost_poets.sql | |||
====most current on top==== | ====most current on top==== | ||
Line 43: | Line 107: | ||
{{:useradd add user}} | |||
====cname==== | ====cname==== |
Latest revision as of 15:59, 27 February 2013
RDS
mysql -h mysql.ch13xre91kbe.us-east-1.rds.amazonaws.com -P3306 -u tim -p amnj
/* Add Remote AWS RDS */ $i++; $cfg['Servers'][$i]['auth_type'] = 'HTTP'; $cfg['Servers'][$i]['hide_db'] = '(mysql|information_schema|phpmyadmin)'; /* Server parameters */ $cfg['Servers'][$i]['host'] = 'mysql.ch13xre91kbe.us-east-1.rds.amazonaws.com';
tlkbam
since migrating a copy to home linux box...
installed on home
apt-get install sqlite apt-get install php5-sqlite
installed on homelamp
useradd -d /home/levelthe -m levelthe
/etc/apache2/sites-enabled and ln to it
ln -s ../sites-available/levelthe levelthe /etc/init.d/apache2 restart
new natty instance
AMI: ebs/ubuntu-images/ubuntu-natty-11.04-amd64-server-20111003 (ami-fd589594
ssh -i .ssh/hpkey.pem ubuntu@ec2-184-72-86-119.compute-1.amazonaws.com whenver you restart an instance it gets a new ec2- number
Install lamp
sudo apt-get update , sudo apt-get install lamp-server^ (^somehow gets deps.) password for mysql tibo
in browser
ec2-107-22-18-113.compute-1.amazonaws.com shows its running
running sftp is a hack since logged in as ubuntu and have no permissions
sudo chown -hR ubuntu /etcfusck up everything just chown what you need to edit
Check PHP by putting this file in /var/www
<?php phpinfo(); ?>
If it trys to save the file php aint workin make sure php module is enabled. or wait a littlerestart apache
sudo /etc/init.d/apache2 restart
See if php is runnning from command line
php -version
reddit install
after script ran it said nginx had a conflict with apache over port 80 so I edited /etc/apache2/ports.conf
moving along created sudo useradd reddit, then sudo passwd reddit (jjjjjj)
misc commands
rm -rf fir/ ln -s ../sites-available/webeshop webeshop
creating an image
ami-ddb661b4
the package that worked
AMI: turnkey-lamp-11.3-lucid-x86.ebs (ami-c5458eac) root 07c69f95
open ports in AWSsecurity 80 22 443 12320 12321 12322
associate with AWSelastic ip
create users from webpanel
configure apache /etc/apache2 create symlinks in mods-enabled to ln -s /mods-available/userdir.load and conf userdir.load and conf
set up public_html for user accounts and put in an index.html
create virtual host files for each user in /etc/apache2/sites-available and link to them from sites-enabled
apt-get install locate, mlocate then updatedb
apt-get install lynx
install php command line interpreter
apt-get install php5-cli
import database
mysql -u pathbost_tim -p pathbost_poets < pathbost_poets.sql
most current on top
AMI: turnkey-lamp-11.3-lucid-x86.ebs (ami-c5458eac) root 07c69f95
to connect to bitnami wordpress instance i-98cebbfa AMI: bitnami-wordpress-3.3-2-linux-ubuntu-10.04-ebs (ami-8139ece8)
ssh -i .ssh/hpkey.pem root@107.21.243.191
to connect to phpMyAdmin
ssh -v -N -L 8080:127.0.0.1:80 -i .ssh/hpkey.pem bitnami@107.21.243.191
name, webserver
mckenna.tim
user, bitnami
ami, server
hpkey.pem for cygwin hpkey.ppk for winscp
ssh -i .ssh/hpkey.pem ec2-user@ec2-50-17-136-39.compute-1.amazonaws.com
useradd - setting up accounts
lastlog (lists all the users) useradd -d/home/newdir newdir (makeit <=8 char) passwd newdir
create a publichtml and set permissions
cd /home mkdir /newdir chmod 711 /home/newdir cd /home/newdir mkdir public_html chmod ugo+rx -R public_html
apache etc/httpd.conf setup
This is probably already done. Do this maybe if new install of server
<IfModule mod_userdir.c> # # UserDir is disabled by default since it can confirm the presence # of a username on the system (depending on home directory # permissions). # #UserDir disable # # To enable requests to /~user/ to serve the user's public_html # directory, remove the "UserDir disable" line above, and uncomment # the following line instead: # UserDir public_html </IfModule> # # Control access to UserDir directories. The following is an example # for a site where these directories are restricted to read-only. # <Directory /home/*/public_html> AllowOverride FileInfo AuthConfig Limit Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec <Limit GET POST OPTIONS> Order allow,deny Allow from all </Limit> <LimitExcept GET POST OPTIONS> Order deny,allow Deny from all </LimitExcept> </Directory>
in /etc/apache2/sites-available create a file with the username
<VirtualHost *:80> DocumentRoot /home/abvbread/public_html ServerName www.abvbreadandroses.info # Other directives here </VirtualHost>
cd /etc/apache2/sites-enabled a2ensite webeshop (puts a link in sites-enabled) or do it manually - ln -s ../sites-available/webeshop webeshop /etc/init.d/apache2 reload sudo /etc/init.d/apache2 restart OR apache2ctl restart
cname
at http://namecheap.com mckennatim nanj. Set cname for www to load balancer address and then redirect the 'apex' (wrec.us) to the www...
@ http://www.wrec.us URL Redirect 0www loadBalancer-1126309168.us-east-1.elb.amazonaws.com CNAMe