Launching your aiCache instanceRegistering for aiCache AMI
Launching the aiCache instanceStarting the Management Console
Selecting an AMI
aicache/aicache.v{versionNumber}.manifest.xmlDo not select images that follow another format (in the figure above aicache/image_bundles/) those images are specific to cloud vendors (rightscale for this example). Prefix aicache can be also aicache.eu for European AMI. Latest version is aicache/aicache.v6.manifest.xml. Launching an Instance from the AMISelect the image and then click the launch button shown on top, this will open the Launch instance wizard as shown below.Setting up config fileFor quick start, you can use template config.Hostname is your domain name, if you are trying to cache abc.com then change hostname (example.com) to your domain Cname is an alias for this domain name. If no hostname or cname found for specific request, aicache will respond with 409 Website not configured error. website hostname example.com cname www.example.com cname EC2_PUBLIC_HOSTNAMEcname EC2_PUBLIC_HOSTNAME is a special substitution. It will be replaced with amazon address like ec2-xx-xx-xx-xx.amazonaws.com and allow you to test aicache acceleration before making DNS changes. Origin Servers are your application / website servers. You should tell aiCache how it can call your application servers by specifying the ip addresses for your origin server / servers If you look at the example configuration file you will notice origin server entires #origin 10.24.83.175 80 1#origin 10.24.70.176 80 2#origin 10.24.73.156 80 3#origin 10.24.191.239 80 4note that # implies that this configuration line is commented / not effective. Add your origin ip address and remove the comment at the beginning of the line to enable origin server configuration If you have a website at 127.0.0.1 your configuration will look like this : origin 127.0.0.1 80 1#origin 10.24.70.176 80 2#origin 10.24.73.156 80 3#origin 10.24.191.239 80 4where 80 is the port on which the server is running, the second number implies the order a which aiCache will contact your origin servers. If case it is one server then its 1. Upload config file to your web server and set it's url in User Data field while launching AMI. On screenshot below I'm launching aiCache instance with config file from http://aicache.com/example.cfg New Users : If this is the first time you use Amazon AWS then you will have to complete steps 2 and 3 of the wizard where you can create a new keypair and security groups. Read the following two sections to understand the process Advanced users : you can skip the following 2 sections and advance to (Launch) section Creating a new KeypairIf you landed on step 2 of the wizard, then you will see a screen that looks like the figure below Public/Private keypair is the preferred method for securely connecting via SSH to your amazon EC2 instance. Keypair name can be any name that you choose, we suggest aiCacheKeypair as a name. Enter the name of the keypair then click on Create and Download keypair, after successfully downloading the keypair click on the continue button below. Warning: Key pair is considered confidential , if anyone can access your key pair he is likelyto be able to control, terminate, restart or tamper with your Aicache and any Amazon EC2instance you launch using this key pair.Creating and configuring security groupsEach amazon EC2 instance is protected by an EC2 firewall. The firewall configuration is called (security groups)using Amazon terminology. With a specific security group you can set your firewall to allow certain IP addresses to access certain ports on your instance. Since aiCache is basically a web server you should allow all clients to connect to port 80 (the default HTTP Port), you should also remember to allow yourself to use SSH to connect to the instance thus port 22 should always be open. You will now find yourself on step 3 of the wizard (firewall configuration). See figure below. For now select the port 22 option shown on the wizard screen later you will go back and modify the security group to allow port 80 access. Click continue. LaunchThis is step 4 of the wizard where you select security groups, key-pair, the number of instances to launch. See the below figure.
Testing aicache instancePoint your browser to the amazon EC2 address - http://ec2-xx-xx-xx-xx.compute-1.amazonaws.comIf aicache started correctly and no problems with config file, accelerated site should appear TroubleshootingConnecting to your aicache instanceUsually you don't have to access your aiCache instance via SSH - it will download config and keep aicache process alive automatically.But if you need to manually adjust config and don't want to restart instnace, ssh will be useful. For windows ssh you can use Putty. For Linux and Mac use your favourite ssh clients. Access your aiCache instance using your Amazon SSH keypairDownload your amazon AWS keypair file and use ssh (unix / Mac ) to connect to your instance.The ssh keypair is what you have created in subsection Creating a new Keypair ssh -i path_to_aws_keypair root@ec2-xx-xx-xx-xx.compute-1.amazonaws.comec2-xx-xx is the public DNS name for your instance For more information on how to use putty to connect to your AWS instance see AWS EC2 Manual Configuration fileConfiguration file you've provided as user data input located at/root/aicache.cfgRestarting aiCacheAfter you did some changes in config file, you have to restart aicache.pkill aicacheThis command will kill current aicache process and within 5 seconds new one will be started by aicache watchdog. Also watchdog will restart aicache in case of any crashes. Log rotation for aiCacheAiCache server provides several options for automated or on-demand log rotation Size-based access log file rotationaiCache provides automated, on-the-fly, size-based access log file rotation. This feature is typically used to cut down size of the access log files to some reasonable value, as it might be easier to deal with 10 files of 100MB each, as opposed to a single file of 1GB. To enable, simply set in the cfg file:max_log_file_size 100000000Be careful with those zeroes – the size is specified in bytes ! When max_log_file_size is set, aiCache rotates present log file upon it reaching the maximum size. The renamed access file has a timestamp added to the name of the file. The size-based rotation is a zero-downtime operation and happens automagically. On-demand log file rotation via USR1 signal.To execute on-the-fly, on-demand log file rotation, send SIGUSR1 to aiCache’s process ID at time of your choosing - manually or using a script driven by Linux cron facility. For example:pkill -USR1 aicacheSimply add this command to be scheduled by Linux cron facility at time that is convenient for you. aiCache’s log file rotation – size-based or on demand, is a zero-overhead and zero-downtime operation, so feel free to do it on schedule that is convenient for you, there’s no performance impact. Please note that aiCache rotates log files after the rotation is requested, upon receiving first log-enabled request. On-demand log file rotation via CLI command
You can also tell aiCache to rotate the log files from the CLI, using rotatelog command. After logging into CLI>rlLog file rotation is not cluster-wide, it is only the aiCache instance that the command is directed at, that executes the rotation. Advanced aiCache configurationaiCache is highly configurable and has a wide range of parameters which you can tweak to suit your needs.Please download aiCache administration guide for details on how to configure aiCache. |






