TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Top things to do after setting up EC2 AWS server?

5 pointsby vtempestabout 11 years ago
The top three things to do after setting up ec2 server is setup a username password login and enable lamp web server as well as to assign a domain name

2 comments

Asparagirlabout 11 years ago
The super-short must-do list for any new cloud server, not just EC2:<p>- Add a non-root user<p>- Add that user to the sudo group<p>- Update and then upgrade all packages<p>- Install fail2ban<p>- Log out and do all future work as the non-root user
vtempestabout 11 years ago
The top three things to do after setting up ec2 server is setup a username password login and enable lamp web server as well as to assign a domain name Setup password login<p>Login to your EC2 via ssh<p>ssh -i &#x2F;path&#x2F;to&#x2F;your&#x2F;Awskey.pem ubuntu@54.84.42.20 then set<p>sudo adduser alex Set a password<p>sudo visudo Add this line<p>alex ALL=NOPASSWD:ALL Beneath the root ALL=(ALL):ALL line, and ctrl x to exit and enter y to save<p>sudo nano &#x2F;etc&#x2F;ssh&#x2F;sshd_config Find this line and modify it to say yes<p>PasswordAuthentication yes Then exit and save with ctrl+x and press y to save<p>sudo service ssh restart Now you can login as ssh alex@54.84.42.20<p>Setup websites<p>If you&#x27;ve just booted your ec2 server, you will need to first update packages before you can use them<p>sudo apt-get update &amp;&amp; sudo apt-get upgrade Type y when asked to install.<p>sudo tasksel install lamp-server Create mysql root passwords when asked<p>Now open permissions to your root folder<p>sudo chmod 777 &#x2F;var&#x2F;www In order to enable .htaccess on ubuntu server, type<p>sudo a2enmod rewrite Then type<p>sudo nano &#x2F;etc&#x2F;apache2&#x2F;sites-enabled&#x2F;000-default.conf or<p>Make these modifications, change AllowOverride to All and ErrorLog to use the &#x2F;var&#x2F;www root. If you can&#x27;t find these here, check the &#x2F;etc&#x2F;apache2&#x2F;apache2.conf file<p>AllowOverride All<p>ErrorLog &#x2F;var&#x2F;www&#x2F;error.log Ctrl+X and y to save<p>To install phpmyadmin, type<p>sudo apt-get install phpmyadmin Then press space to asterisk apache2, tab and enter, then yes and set a password for the phpmyadmin to access the databases. Now accessible at siteip&#x2F;phpmyadmin<p>In the AWS EC2 Instance console, make sure the security group assigned to your instance has under the inbound tab port 80 HTTP enabled. Only port 22 is open by default. Find out your security group name listed when you click on your instance, then go to the Security Groups link on the sidebar of ec2 and modify that security group by clicking on it, inbound tab, edit, add rule, select http. Now when you click on your ec2 instance it shows a Public DNS like this ec2-54-85-204-200.compute-1.amazonaws.com, type that into your URL bar and you should be able to see index.html located on &#x2F;var&#x2F;www<p>when you login, if you want the default directory to always be &#x2F;var&#x2F;www then type<p>sudo nano ~&#x2F;.bashrc And add to the very bottom:<p>cd &#x2F;var&#x2F;www Register a domain<p>Go to your ec2 manager and click elastic IPs on the sidebar, Allocate a new address, then associate address and select your running instance to be associated with that address. Test it out by typing that ip address into your url box, index.html should show up.<p>Now go to Route 53 under the aws console dropdown and click Create Hosted Zone, name it your site&#x27;s name .com, then go to record sets, create record set Type: A with the Value of the Elastic IP you got before.<p>Now copy the Name Server values, which look like ns-1877.awsdns-42.co.uk. ns-1149.awsdns-15.org. ns-923.awsdns-51.net. ns-216.awsdns-27.com.<p>Go to godaddy or 1and1 and buy a domain for $10, then under DNS management for that site domain, edit DNS servers to be custom and enter all four of those Name servers. Give it an hour for it to update redirection.
评论 #7765781 未加载
评论 #7765783 未加载