Up to this point you have created the server, and have granted yourself access to it. Now it’s time to make it work how it should, so, let’s jump right into this. We will be using the ever so dreaded command prompt to set this up. There isn’t any way around it so just muster up the courage, and open it up. I use a mac so I am going to go into Applications -> Utilities -> Terminal.
The first thing to do is to get connected. To do this you need to use your Key Pair, which you downloaded when creating your server. For me, I downloaded this file right to my Downloads folder on my Macbook Pro, so I will first get into the directory:
Now if you haven’t done it already, you need to set the permissions on this file. It’s for added security.
[code]sudo chmod 600 Initial_Test.pem[/code]
Next I will SSH into the server by utilizing the Key Pair. Mine was called Initial_Test.pem.
[code]ssh -i Initial_Test.pem email@example.com[/code]
Next, it will ask you if you want to add this to your known hosts file. Type “yes” and press “Return,” and you are now connected! Next we need to install any updates. So type the following command.
[code]sudo aptitude update[/code]
One that is complete type,
[code]sudo aptitude dist-upgrade[/code]
Next you need to install the LAMP stack so type,
It will run a quick command and then launch a blue screen with a bunch of options. Use the arrow keys to move the cusror down to where it says “LAMP” and press the “Space Bar,” and then press “Return.” You have now begun to install the LAMP stack. Eventually it will ask you some questions about setting up MySQL, namely the Username and Password you wish to use. Just enter these so that you will remember them and press return. For this example, I am going to use “root” as my username and “test123” as my password. Once that process is complete, it will kick you out to the command prompt. We are going to go ahead and setup phpMyAdmin. To do so, I will need to log into MySQL. To do so, type the following and press “Return.”
[code]mysql -u root -p[/code]
When prompted enter your password (in my case test123) and press”Return.” Now all I have to do is create the phpmyadmin database. So I will type the following and press “Return.”
[code]CREATE DATABASE phpmyadmin;[/code]
Then type “exit” and you will exit out of MySQL. Next I will install phpMyAdmin by enter the following and pressing “Return.”
[code]sudo apt-get install phpmyadmin[/code]
At this point you are going to want to go test your phpMyAdmin area. I have found in recent installs that I can’t connect so sometimes I need to run the following command to link everything up.
[code]sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf.d/phpmyadmin.conf[/code]
So guess what…your done. For the most part. As promised PHP is installed, along with MySQL, and we even got phpMyAdmin installed, so you don’t have to do anything on the command line.
A few things to note.
- Location of the php.ini file:
- Restart apache by typing:
Now if you have other things you need installed, just Google it! From here on out you will follow the same process above to connect to the server. You will have to enter a few commands, and boom…your done.
There are a few extensions that I like to install, and usually find I need when creating a Web Apps. For the most part just enter these and press enter. Some of them may ask you if you want to allow the module to use up space, so just press “Y”. Others I have listed, require a little more editing, and I will try to write up a few articles on these in more detail.
[code]sudo apt-get install curl libcurl3 libcurl3-dev php5-curl[/code]
[code]sudo apt-get install php5-memcache memcached[/code]
SFTP (Read More)
[code]sudo apt-get install vsftpd[/code]
PHP CLI / Cron (Read More)
[code]sudo apt-get install php5-cli[/code]
Mod_Rewrite (Additional PostComing Soon!)
[code]sudo a2enmod rewrite[/code]
HTOP – Monitor Processes on Server
[code]sudo apt-get install htop[/code]
Other PHP Libraries
[code]sudo apt-get install php5-dev[/code]
[code]sudo apt-get install php-pear[/code]
Might Need to Install MongoDB
[code]pecl install mongo[/code]
Then add this to the php.ini file
Allows the system to send mail from server.
[code]sudo apt-get install sendmail[/code]