you're reading...

Founders BLOG

WordPress on S3: going pro

WordPress-on-S3 makes professional website administration as easy as pie.

OblakSoft is pleased to announce availability of the ready-to-run WordPress-on-S3 / Yapixx AMI with enhanced configuration, performance, and website administration features.  Now website owners can use Webmin and phpMyAdmin for secure website administration over the Internet, and pre-configure Cloud Storage Connection for the instance.

System administration

For extra security, Webmin and phpMyAdmin are configured to use TCP ports 12321 and 12322, correspondingly.  This setup provides a simple and flexible way to secure access to system administration functionality without affecting the website operation.  Access to the system administration functionality can be easily added and removed by modifying the firewall (a.k.a. security group) settings in the AWS management console.

By default, the administration TCP ports are closed. To allow access to Webmin and phpMyAdmin, add the following rule to the security group of the instance (if you’re following the step-by-step guide, see slides 8 and 9):

You can restrict the access further by specifying the IP address range in the source field.  Note that rules can be added to and deleted from the security group at any time and take effect immediately. You can open the administration TCP ports for the time you need to make configuration changes and close the ports after you’re done.

To access Webmin, go to https://ec2-N-N-N-N.compute-X.amazonaws.com:12321 (substitute the host name with the real EC2 name).  You’ll see a warning that there is a problem with the SSL certificate.  This is expected: the certificate is generated for each instance and you can confirm the authenticity as described on the slides 13 and 14 of the step-by-step guide.

Initially, all accounts on the instance are locked, so to log into the Webmin you need to set up the root password first.  One way to do it is to connect to the instance using SSH or PuTTY and run the sudo root passwd command.  But we made it even easier. With the new WordPress-on-S3 AMI you can set the root password in the user data when creating an instance.  The syntax for root password is the following:

os.root.password=YourRootPassword

Here is a screenshot of setting the root password to SuperSecret7:

If you didn’t set the root password when you were creating the instance, you can stop the instance, edit the user data to set the root password (right click on the instance in the AWS management console and choose the “View/Change User Data” action from the menu), and start the instance again.

Please be sure to pick a strong password and keep it safe.

Once the root password is set, you can log into the Webmin and gain full access to your system.  The full Webmin documentation is available here, and some screenshots are available here.

Database administration

As mentioned earlier, phpMyAdmin uses TCP port 12322, so to access it you need to open the port and then go to https://ec2-N-N-N-N.compute-X.amazonaws.com:12322 (substitute the host name with the real EC2 name).  You’ll see a warning that there is a problem with the SSL certificate.  This is expected: the certificate is generated for each instance and you can confirm the authenticity as described on the slides 13 and 14 of the step-by-step guide.

Initially, none of MySQL accounts have passwords, which makes them inaccessible via phpMyAdmin.  So to log into phpMyAdmin, you need to set the MySQL root password first.  You do it from the command line, or you can do it in Webmin:

Note if Cloud Storage Connection is not configured, MySQL server may not be able to start, so you need to configure Cloud Storage Connection before you can administer MySQL server.

Please be sure to pick a strong password and keep it safe.

Once the MySQL root password is set, you can log into phpMyAdmin take full control over your database administration.  The full phpMyAdmin documentation is available here, and wiki pages are available here.

If you want to set password for MySQL wordpress_user, you also need to edit the wp-config.php and update the password there as well.  For quick access to wp-config.php, we added a custom command in Webmin:

Automated Cloud Storage Connection configuration

The Cloud Storage Connection Web UI (slide 12 in the step-by-step guide) is great for a quick start, but in production you might want to have the site ready from the start in an automated scripted way, without going thru manual steps.

Now you can pre-configure Cloud Storage Connection in user data when creating an instance from the ready-to-run WordPress-on-S3 AMI.  The syntax for Cloud Storage Connection configuration is the same as in the my.cnf file:

clouse_cloud_data_url=s3://s3.amazonaws.com/bucket/prefix
clouse_cloud_auth_key=AccessKey:SecretKey

You can get a name of an existing bucket or create a new bucket to store your website content in the AWS management console.  Your Access Key and Secret Key can be retrieved here.  See also slides 16 and 21 of the step-by-step guide.

Here is a screenshot of setting Cloud Storage Connection configuration (and the root password) in the user data:



If you made any mistake in the user data configuring your website instance, you can simply stop the instance, correct the user data (right click on the instance in the AWS management console and choose the “View/Change User Data” action from the menu), and start the instance again.

Performance enhancements

To help the website deal gracefully with load spikes (especially on EC2 micro instances) we added a 1 GB swap file.   Now the operating system can save rarely used data to disk and use memory to store most frequently accessed data.

To optimize PHP code execution, WordPress-on-S3 AMI now has Alternative PHP Cache (a.k.a. APC) installed and configured. To take advantage of APC even further, we configured W3 Total Cache to use APC for caching internal WordPress objects’ data and database queries.

Many of our customers use W3 Total Cache plugin to optimize their website.  The new AMI comes with W3 Total Cache pre-installed and configured for better website performance.

In conclusion

Ready-to-run WordPress-on-S3 AMI, containing up-to-date LAMP + WordPress + ClouSE + familiar admin tools and UI, allows launching a WordPress-powered website to cloud in a matter of minutes.  Now you can take full control of the website administration, all from your Web browser, no command line experience is required.  Launch your website today at http://www.oblaksoft.com/downloads/, using WordPress-on-S3 AMI as the platform.

It’ll be great to hear your thoughts on how we can further simplify the experience of launching WordPress to cloud.

Discussion

4 Responses to “WordPress on S3: going pro”

  1. Thank you for your great work! Finally, it’s safe to use WordPress for heavy loaded sites without any hussle.

    I would love to see BuddyPress AMI in the future. (Yes, it’s possible to DIY, but much practical to start with some ready-to-use template).

    Posted by Danil Semelenov | February 9, 2013, 5:09 am
    • Hi Danil,
      Thank you for the suggestion to add BuddyPress. We started with making WordPress-to-Cloud AMI a complete plaftorm for professional WordPress sites. Going forward we’ll continue evaluating what variety of {clouds, virtualization environments, stacks, components, applications, tools} to support out of box. We appreciate your feedback. Let us know if there is anything specific you might be looking for.

      Posted by Artem Livshits | February 10, 2013, 4:21 pm
  2. Hello,

    Thank you for all your great work. I launched into s3 using your instructions, but (probably as a newbie in s3) found that I have a problem developing the wordpress site as I am used to, as I do not have access to the normal file structure.

    Is there a way to “see” the files and structure as they would be on a normal system? I need to edit folders and files in order to push the site ahead. Or am I only limited to the wordpress console when using your solution?

    Thank you for your help
    Tomasz

    Posted by Tomasz Kozakiewicz | April 24, 2013, 3:14 pm
    • Hi Tomasz,

      Thank you for trying WordPress on S3!

      You can edit files in the File Manager module of the Webmin system administration console. Log into Webmin, select Others -> File Manager module on the left. The WordPress files are located in /var/www/wordpress.

      Alternatively, you can use the Upload and Download module to transfer files between the instance and your computer. Log into Webmin, select Others -> Upload and Download.

      Posted by Artem Livshits | April 25, 2013, 12:17 am

Post a Comment

Categories

Twitting ...