NOTE: I have extracted this from How to setup a server on the Amazon cloud and install SugarCRM in 30 minutes.
I have been building a public online industry network, or Facebook, for the financial market. I have extracted a few paragraphs from my “How to build an online network in 90 days with $25k” guide (currently in draft) to provide a mini-guide for @sugarcrmatlanta and the web community.
This article discusses how to create a virtual web server on the Amazon cloud and establish a place to install a new web site in less than 15 minutes. This is intended as a hackers technical general guide, rather than something a novice could do.
Objective – create a web server and a place to upload a web site in 15 minutesThe key steps are outlined below.
1. Learn about Amazon Web Services and open an account
Please read Why use Amazon Web Services?, Build an ebusiness on your desktop and drag it onto Amazon’s elastic cloud and category:Internet applications and hosting. You can open an account with Amazon web services here. Amazon offers different sized servers (or instances). Please read about pricing and instance types here.
2. Install Elasticfox into Firefox
Amazon Web Services is usually managed by a command prompt. Elasticfox is a firefox extension that provides a graphical interface that allows you to manage your virtual machines on Amazon’s cloud computing service. You can learn more about and download Elasticfox from here.
3. Learn about Webmin - an open source server management system
Typically, the management of a web server is complex and takes years of experience. Webmin is an open source software system that reduces the complexity signifcantly. We are going to use Webmin to manage our new server and avoid the text based instructions on the Virtualmin GPL AMI on EC2 configuration page. Virtualmin is a part of the Webmin system. I recommend you also review the Virtualmin vs. the rest page for a comparison of commercial and open source server management packages.
4. Use Elasticfox “KeyPairs” tab to create a new keypair
A keypair is a security device to control access to a web server. In Elasticfox, press the green button on the “keypairs” tab to create a new keypair. Type a name for the keypair and download the PEM file. We will need this PEM file later.
5. Use Elasticfox “Security groups” tab to define access to our server
A web server connects with other computers on the internet to exchange mail and server web pages. A web server listens on ports. For example, mail is typically exchange on ports 25 and 110. Web pages are delivered by Port 80. A web server starts life (typically) with all ports open. A port is like an open window on a house. If it is open, someone may climb in. We need to close the ports (or windows on our house) and just let in and out what we need to. This is called a firewall. A firewall simply prevents access through all ports (except the ports we want to). Amazon Security groups simply list the ports that should remain open. Use the green plus sign to “Create Security Group” called “webmin”. Highlight the “Webmin” security group. In the box on the lower half of the screen, please “Grant a new permission on the selected group”. Please add all the port numbers listed on the Virtualmin GPL AMI on EC2 configuration page. We can use this “security group” for any other Webmin server we launch in the future.
6. Use Elasticfox “AMIs and Instances tab” to Launch a Webmin web server “instance”
In Elasticfox, type “ami-c442a7ad” into the search box. This will list “virtualmin-gpl-3.56/image.manifest.xml”. Right click on AMI-c442a7ad and select “Launch instance of this AMI”. Please select the Instance type as small (or another size depending on your requirements), select the keypair you created above and make sure the “webmin” and “default” security groups are listed in the “Launch in” box. Press the launch button.
7. Wait for five minutes and take note of the Public DNS address
It will take approximately five minutes for Amazon to create the server and for it to be publicly available. Please refresh the Elasticfox interface. Eventually, a “Public DNS” will appear and State will be “running”. The “Public DNS” is the internet address of your web server. The four digits in the Public DNS are also the IP address of your server. This web server is now costing you money.
8. Setup Webmin to access through your browser
Type https://[enter public dns here]:10000 into your browser. The Webmin login screen should appear. The initial login is root and changeme.
- Click on the Webmin link in the top-left, open the Webmin category, click on Change Language and Theme, and enter a new password!
- To ensure that all packages are up to date, click on System Information at the bottom of the left frame. If you are prompted to install any packages on the information page that appears on the right, do so.
- Click back on the Virtualmin link on the top-left, and click on Create Virtual Server to create your first domain.
9. Setup DNS entries – let’s just assume this has been done
DNS is important and complex. It is difficult. This will not discuss the complexities of DNS server entries.
We need a memorable domain name, rather than the public DNS. Let’s assume we want www.domain.com to be the internet address for new web site. We need to tell the internet’s domain name system. We will assume the domain name domain.com is registered. We will assume this domain name has two name servers. We will assume that there is an A record for this domain name that points to the IP address of our Amazon server. I use www.dnsmadeeasy.com .
10. Setup our first virtual server or domain
Please learn more about Webmin by watching the video available here. Please setup www.domain.com in Webmin. The database name will be domain, the database username will be domain and the database password will be the virtual server administration password. You may get an error that mailman has not been installed. I recommend unchecking the “mailman” option for your new virtual server. The files for your web site will be stored under the /home directory on the web server. It will actually be something like /home/domain (without the .com) following. These are all created for you as part of the process. The /home/domain directory is where your web site can be copied. Webmin does have a mail server. Unfortunately, it may not be worthwhile trying to run a mail server on an Amazon image (unfortunately). I redirect mail to another (non-Amazon) virtual server.
You now have your own web server! How will you distribute (Web 1.0), participate (Web 2.0), contribute (Web 3.0) and transform (Web 4.0).
16. Other things to do
Setup Putty for Shell access
We may need shell or command prompt access to the new server. If the server does not respond, we will need to do this. I use Putty Portable. Unfortunately, the PEM file that Amazon gives us can not be used directly by Putty. We need to convert it. Get Puttygen.exe from here and convert the PEM file to a PPK file required by Putty. Do not lose these files.
Open Putty. Type your Public DNS into the Hostname field. Under Connection / SSH / Auth, select your “Private key file for authentication” (ie; PPK file). On the Session screen, click on Open. Putty should open terminal access to your server. You do not need a password, the private key file is your password.
Other features of Webmin
Webmin can backup the virtual server (ie; domain.com) or databases on demand or on schedule. It is a comprehensive web server that can add new software packages on demand. A file viewer is at Web / Others / Filemanager. A command shell is at Webmin / Others / Command shell.
Webmin professional installs many open source applications automatically
The paid version of Webmin/Virtualmin provides “81 easily installable applications” that can be installed under your domains at the click of a button.
I hope this helps … I welcome feedback or suggested revisions if I have omitted a material step. I will try to release my project “How to build an online network in 90 days for $25k” guide as soon as possible.
I also recommend you review the Category: Internet applications and hosting ,Can you put your life on an IPod (or USB key) and discard the laptop? and Syncronising and backing up files amongst teams and across the world.