summaryrefslogtreecommitdiff
path: root/_site_build
diff options
context:
space:
mode:
authordavidtsadler <davidtsadler@googlemail.com>2012-05-13 20:47:31 +0100
committerdavidtsadler <davidtsadler@googlemail.com>2012-05-13 20:47:31 +0100
commit2322bec7d13880acbe8616bc28190440b9377e69 (patch)
treebd4dbdaa707d3a245a46bc55a4911698f64b4ebc /_site_build
parent0f05950a6a2a8a9460f151de6a2d058b70077d79 (diff)
Save progress on posts.
Diffstat (limited to '_site_build')
-rw-r--r--_site_build/_posts/2012-04-21-how-to-install-magento-on-ubuntu.markdown72
-rw-r--r--_site_build/img/localhost.magento-store.com.jpgbin0 -> 73211 bytes
2 files changed, 69 insertions, 3 deletions
diff --git a/_site_build/_posts/2012-04-21-how-to-install-magento-on-ubuntu.markdown b/_site_build/_posts/2012-04-21-how-to-install-magento-on-ubuntu.markdown
index 3ce459d..4a8a5ee 100644
--- a/_site_build/_posts/2012-04-21-how-to-install-magento-on-ubuntu.markdown
+++ b/_site_build/_posts/2012-04-21-how-to-install-magento-on-ubuntu.markdown
@@ -9,10 +9,10 @@ comments: true
google_plus: true
twitter_share: true
facebook_like: true
-published: false
+published: true
licensed: true
---
-By the end of this guide you will have installed Magento, and some sample data, locally on Ubuntu. This will allow you to get to grips with the software before installing it onto a production server. In addition to Magento I will take you through installing Apache, PHP and MySQL. I'm going to assume that you are using Ubuntu 12.04 (Precise Pangolin) and that you wish to install version 1.7.0.0 of Magento. You're results may vary if you are using different versions.
+By the end of this guide you will have installed Magento, and some sample data, locally on Ubuntu. This will allow you to get to grips with the software before installing it onto a production server. In addition to Magento I will take you through installing Apache, PHP and MySQL. I'm going to assume that you are using Ubuntu 12.04 LTS (Precise Pangolin) and that you wish to install version 1.7.0.0 of Magento. You're results may vary if you are using different versions.
As this is quite a long post I have broken it down into various sections. Feel free to ignore those parts that are not relevent for you.
@@ -33,7 +33,7 @@ If you have never heard of Magento the following from the <a href="http://www.ma
<footer>&mdash; <cite><a href="http://www.magentocommerce.com/product/faq#What%20is%20Magento?" rel="external nofollow" target="_blank" title="Go to the Magento FAQ">Magento Frequently Asked Questions</a></cite></footer>
</blockquote>
-Magento is available in two editions, Community and Enterprise. The Enterpise edition is the company's commercial version of the software and is meant for large-scale eCommerce users. The Community edition on the other hand is available as a free download under the open source OSL 3.0 license and is the version that you will be installing.
+Magento is available in two editions, Community and Enterprise. The Enterprise edition is the company's commercial version of the software and is meant for large-scale eCommerce users. The Community edition on the other hand is available as a free download under the open source OSL 3.0 license and is the version that you will be installing.
This post will walk you through every thing you need to get a local copy of Magento running on Ubuntu. It is not meant as a guide to installing a fully working eCommerce store located on a production server.
@@ -126,6 +126,72 @@ Before we get into the business of creating the directory I need to point out a
Many of the commands that follow use absoulte paths when refering to directories located in my home directory. Since the username on my computer is `dev` you will need to replace any occurrences of this with your own username. Feel free to also change the location of any of the directories. Just remember that you must use the correct location when configuring the virtual host later on.
+The first thing we need to do is ensure that you belong to the same group as the Apache process. Note that after entering the command you must log out and then log back in before the system will recognise that you belong to a new group.
+
+{% highlight bash %}
+sudo usermod -a -G www-data dev
+{% endhighlight %}
+
+You can use the `groups` command to check that you belong to the `www-data` group. As long as it appears in the list of groups you can move on to creating the required directories.
+
+{% highlight bash %}
+mkdir /home/dev/public_html
+chgrp www-data /home/dev/public_html
+{% endhighlight %}
+
+As both you and Apache need read and write access to the directory we have used the `chgrp` command to change its group to be `www-data`. However any new files or directories that you create within `public_html` will not inherit the same group. We therefore need to change the permissions to include the &quot;setgid&quot; bit.
+
+{% highlight bash %}
+sudo chmod 2750 /home/dev/public_html
+{% endhighlight %}
+
+We can now create the directory that Magento will be served from and it will be given the `www-data` group automatically.
+
+{% highlight bash %}
+mkdir -p /home/dev/public_html/magento-store.com/{public,log}
+{% endhighlight %}
+
<h2 id="vhost">Configuring the Apache Virtual Host.</h2>
+We will create a simple virtual host configuration file that will instruct Apache to serve the contents of the directory `/home/dev/public_html/magento-store.com/public` for any requests to `localhost.magento-store.com`
+
+{% highlight bash %}
+sudo bash -c "cat >> /etc/apache2/sites-available/magento-store.com <<EOF
+<VirtualHost *:80>
+
+ ServerName localhost.magento-store.com
+ ServerAlias www.localhost.magento-store.com
+
+ DocumentRoot /home/dev/public_html/magento-store.com/public
+
+ LogLevel warn
+ ErrorLog /home/dev/public_html/magento-store.com/log/error.log
+ CustomLog /home/dev/public_html/magento-store.com/log/access.log combined
+
+</VirtualHost>
+EOF"
+{% endhighlight %}
+
+Using the `a2ensite` command and restarting Apache will ensure that the new configuration file is loaded.
+
+{% highlight bash %}
+sudo a2ensite magento-store.com
+sudo service apache2 restart
+{% endhighlight %}
+
+To ensure that the domain `localhost.magento-store.com` resolves locally to the computer we need to add some entries to the system's `hosts` file.
+
+{% highlight bash %}
+sudo bash -c "cat >> /etc/hosts <<EOF
+
+# DNS for localhost magento store development.
+127.0.0.1 localhost.magento-store.com
+127.0.0.1 www.localhost.magento-store.com
+EOF"
+{% endhighlight %}
+
+If everything has gone according to plan you should be able to open a browser and navigate to `localhost.magento-store.com` and see a directory listing as shown below.
+<figure>
+![Browser showing the directory listing when going to localhost.magento-store.com](/img/localhost.magento-store.com.jpg "Visiting localhost.magento-store.com for the first time.")
+</figure>
<h2 id="magento">Installing Magento.</h2>
diff --git a/_site_build/img/localhost.magento-store.com.jpg b/_site_build/img/localhost.magento-store.com.jpg
new file mode 100644
index 0000000..c7e6387
--- /dev/null
+++ b/_site_build/img/localhost.magento-store.com.jpg
Binary files differ