【Open an Online store Step-By-Step】【1】

Discussion in 'eCommerce' started by cloudcine, Nov 27, 2012.

  1. #1
    Before I start my own online store business, I know nothing about e-commerce, such as, how and where to buy domain, choose which hosting VPS provider, how to install my own e-commerce store and forum programme and then configure them, how to build my own VPS system, and so on.

    Some of them are easy and I can learn quickly from the official tutorials, but some are not very popular and I have to Google or Bing or Altavista many information to assure what they are.

    For newcomers who want to start their own online business quickly, think more about their own “BUSINESS" and spend more time on communicating with their clients should be more important.

    Today, I hope to introduce a brief introduction regarding some key techniques of building an online web store, hope the newcomers can avoid wasting their time on those BASIC technique problems.

    If you are very familiar with Programmer/Website/E-commerce, please read other threads, this article is just for newcomers.
    1. Think about what your business mode is?
    What kind of business mode will you choose ?

    Do you want to establish an ebay or amazon store and then get profit from that?
    Or you just want to open an independent store on your own website, don’t you?

    Please note that, even you know nothing about "techniques", they can't be your disturb. You can also do it very well on today's internet revolution even without any IT knowledges.

    As far as ebay or amazon public platform is concerned, you can easily open you store by just registering and binding your Paypal account, meanwhile, you can be a real online store owner since then.

    There are so many other store platforms besides ebay and amazon, such as aliexpress, taobao, bonanza,etc.

    The advantage of open one store on these platform is obvious, you can quickly get clients and orders right now once you establish home there, but on the other side, the shortage is, when your business have been enlarged, the reputation of these platform have also developed, but your own business or reputation or brand name might be still unknown to your clients, they come here to buy goods just because they think the e-commerce platform itself( instead of you) can meet their demand, if you leave away, they can quickly find other replacement to keep on buying.

    Buf if you just want to open your own store, that is, own your individual website, you might need to know some basic concepts about HTML/CSS. You also might need to buy your own domain (for example, from dynadot or namesilo) as well as website hosting space. You also have to buy some shop/store/mall software or shopping cart. Among them, we suggest you choose Magento or PrestaShop.

    For Magento, it's robust and powerful but a little complicated, and also require a high load on your server, you should buy VPS space(such as Linode) or hosting space supporting Magento(such as Simplehelix, which provide good support for Magento featuring with automatic setup but with a little expensive cost). If you have chosen Magento, you should also learn some knowledges about PHP, Linux(such as Ubuntu or CentOS).

    Sometimes, you also want to maintain a client community of your products/services, meanwhile, Forum software will be necessary on your web server, among them, for example, you can install discuz!X2.0 on your VPS.

    To be frank, your own store will be more powerful than the public e-commerce platform, but they are a little complicated, and you have to involve both energy and time in it.

    In general, After finish all above job, you can easily setup your own website. I have listed all the benefit and shortage of these business modes, just for the purpose that you can have a brief concept about “open an online store”, which might help you to make your final decision before start your online store business.

    Only after confirming what you want, you can save your time and energy and quickly start your online store business!

    2.Choose the right domain name.

    If you just want to open a store on Amazon or Ebay, just register there and then start your business right away.

    If that’s not the case, you might buy your own domain name firstly.

    Once you have chosen which domain name you will use, please check whether or not others have occupied it, you can check this by input your desired text on www.dynadot.com, for example, I input “shiling”, from the result, we have found that, shiling.com,shiling.net has been taken, but shiling.org is still available to register.

    2confirmyourdomain.jpg
     

    Attached Files:

    Last edited: Nov 27, 2012
    cloudcine, Nov 27, 2012 IP
  2. cloudcine

    cloudcine Greenhorn

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #2
    [h=2]【Open an Online store Step-By-Step】【2】[/h]If you think shiling.org is ok, check the checkbox before shiling.org, then click “Add to Cart”
    View attachment 98218
     
    cloudcine, Nov 27, 2012 IP
  3. cloudcine

    cloudcine Greenhorn

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #3
    If you don’t need to modify it again, click “Check Out”.
    2CheckOut.jpg
     
    cloudcine, Nov 27, 2012 IP
  4. cloudcine

    cloudcine Greenhorn

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #4
    [h=1]【Open an Online store Step-By-Step】【4】[/h]If you want to protect your contact information with the provider's private domain service. Click “add Domain Privacy”( you might have to pay extra 2$ for that service)
    [Note: If you haven’t registered on Dynadot, register it now.]
    AccountCreate.jpg
     
    cloudcine, Nov 27, 2012 IP
  5. cloudcine

    cloudcine Greenhorn

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #5
    If you’re a registred user, just login and then pay for your order.
    AccountSignin.jpg
     

    Attached Files:

    cloudcine, Nov 27, 2012 IP
  6. cloudcine

    cloudcine Greenhorn

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #6
    [h=2]【Open an Online store Step-By-Step】【6】[/h]The total amount for one year domain cost in Dynadot is 9.99$ + 2$ domain privacy fee = $11.99, input your visa/mastercard and then click “Submit Card”.
    2PayforyourOrder.jpg
     
    cloudcine, Nov 27, 2012 IP
  7. cloudcine

    cloudcine Greenhorn

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #7
    Now your domain name should be ready for you, it's just like a new address name for you, others can write letters to this post number, but you also have to buy a real house — that is "Hosting Space”.

    3. Choose the right hosting space and e-commerce programme.

    3.1 Regarding hosting space


    Just as what we said on Setup one, if you want to open a store on Amazon or Ebay, just visit their website and register and start it. But if you want to establish your own store, you not only have to buy your own domain name, but also your own hosting space. You will install store programme on the hosting space. You can install so many e-commerce programme on your hosting space, for example, Prestashop, Opencart,ZenCart, Oxid, Magento, osCommerce, Joomla+Virtuemart plugin, Wordpress+Jigoshop plugins, Drupal+Drupal Commerce plugin ,etc.

    Please note that, here when we say “hosting space”, it doesn't mean the common hosting space which just support static html contents, if you want to customize your own website and e-commerce software, the common hosting space is not enough, you might can’t install many things on your own website. If you just install magento, simplehelix might meet your demands. If that's not the case, you strongly suggest you just buy the VPS hosting space.

    3.2 Regarding e-commerce software or shopping cart

    If you are familiar with Wordpress, Drupal or Joomla, use them with their plugins directly.

    Comparing with all above e-commerce softwares, Prestashop is a lightweight application and very easy to use, Magento is more powerful but need a high load for the server, what's more, you should also configure its option yourself.

    For me, I use Linode + Magento to afford my own store. I hope more powerful and more security, I don’t mind the difficult to configure its option, I can google many useful information about Linux, PHP, Magento, Linode, and so on. And above portfolio really meet my demand.

    4. Hosing Space Configuration -- Linode

    Here I show you the detailed configuration about Linode:

    4.1 Welcome to Linode

    Register on Linode is very easy, once registered and login in, you can start by “DNS Manager” and “Dashboard”.

    View attachment 98226
     
    cloudcine, Nov 27, 2012 IP
  8. cloudcine

    cloudcine Greenhorn

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #8
    【Open an Online store Step-By-Step】【8】

    Click “DNS Manager”, you can find below pictures:

    3choosetherightdomain2.jpg
     

    Attached Files:

    Last edited: Nov 27, 2012
    cloudcine, Nov 27, 2012 IP
  9. cloudcine

    cloudcine Greenhorn

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #9
    【Open an Online store Step-By-Step】【9】

    Click “Add a domain zone”. Your domain is just like : yourdomain.com
    SOA Email is your own email.
    Then click “Add a Master Zone”.
    3choosetherightdomain3.jpg
     

    Attached Files:

    cloudcine, Nov 27, 2012 IP
  10. cloudcine

    cloudcine Greenhorn

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #10
    Here is an example how to configure “NS Records” and “A Records":
    3choosetherightdomain4.jpg
     

    Attached Files:

    cloudcine, Nov 27, 2012 IP
  11. cloudcine

    cloudcine Greenhorn

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #11
    For NS Records, you just input 5 NS Records in Linode:
    ns1.linode.com
    ns2.linode.com
    ns3.linode.com
    ns4.linode.com
    ns5.linode.com

    For A Records, you can add 2 records (or more):
    1) <blank>, 123.456.78.90
    2) www, 123.456.78.90
    By Leaving <blank>, Meanwhile, when you type yourdomain.com, you will be easily redirected to your homepage ip address : 123.456.78.90
    By input “www”, when you visit www.yourdomain.com, you will be also easily redirected to your homepage ip address : 123.456.78.90

    Buf if you want to have a sub-domain, such as : forum.yourdomain.com, you have to add the extra records: forum.yourdomain.com
    Accordingly, you can also add store.yourdomain.com if you want.

    Please also note that you just need add these records on linode, nothing else need to be done for a newcomer.
    You will add some contents on your nginx configuration file in the future(we will discuss it later).

    After finishing above procedures, your own website should get ready for you, in theory, you can start your own business.

    4.2 Logging in Linode for the First Time

    Once you have the IP address and an SSH client, you're ready to log in via SSH. Here's how:

    4.21. Open the terminal window or application, type the following command, and then press Enter. Be sure to replace the example IP address with your Linode's IP address.

    4.22. If the warning shown below appears, type yes and press Enter to continue connecting.

    4.23. The log in prompt appears, as shown below. Enter the password you created for the root user.

    4. 24. The SSH client initiates the connection. You know you are logged in when the following prompt appears:

    Now you can start executing commands on your Linode.
    [h=1]4.3 Setting the Hostname[/h]You'll need to set your system's hostname and fully qualified domain name (FQDN). Your hostname should be something unique. Some people name their servers after planets, philosophers, or animals. Note that the system's hostname has no relationship to websites or email services hosted on it, aside from providing a name for the system itself. Your hostname should not be "www" or anything too generic.


    Ubuntu / Debian

    Enter following commands to set the hostname, replacing plato with the hostname of your choice:

    If it exists, edit the file /etc/default/dhcpcd to comment out the SET_HOSTNAME directive:
    File excerpt:/etc/default/dhcpcd



    Update /etc/hosts


    Next, edit your /etc/hosts file to resemble the following example, replacing plato with your chosen hostname, example.com with your system's domain name, and 12.34.56.78 with your system's IP address. As with the hostname, the domain name part of your FQDN does not necesarily need to have any relationship to websites or other services hosted on the server (although it may if you wish). As an example, you might host "www.something.com" on your server, but the system's FQDN might be "mars.somethingelse.com."
    File:/etc/hosts




    If you have IPv6 enabled on your Linode, you will also want to add an entry for your IPv6 address, as shown in this example:
    File:/etc/hosts




    The value you assign as your system's FQDN should have an "A" record in DNS pointing to your Linode's IPv4 address. For Linodes with IPv6 enabled, you should also set up a "AAAA" record in DNS pointing to your Linode's IPv6 address. For more information on configuring DNS, see Adding DNS Records.

    4.4 Setting the Timezone

    All Linodes are set to Eastern Standard Time by default, but you can change the timezone to whatever you want it to be. It may be best to set it to the same timezone of most of your users. If you're unsure which timezone would be best, consider using universal coordinated time or UTC (also known as Greenwich Mean Time).

    [h=2]Ubuntu/Debian[/h] Enter the following command to access the timezone utility:

    4.5 Checking the Time

    Now try entering the following command to view the current date and time according to your server:

    The output should look similar to this: Thu Feb 16 12:17:52 EST 2012.

    4.6 Installing Software Updates

    Now you need to install the available software updates for your Linode's Linux distribution. Doing so patches security holes in packages and helps protect your Linode against unauthorized access.

    Ubuntu / Debian

    Enter the following commands to check for and install software updates:

     
    cloudcine, Nov 27, 2012 IP
  12. cloudcine

    cloudcine Greenhorn

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #12
    4.7 Securing Your Server

    4.71 Adding a New User


    The problem with logging in as root is that you can execute any command - even a command that could accidentally break your server. For this reason and others, we recommend creating another user account and using that at all times. After you log in with the new account, you'll still be able to execute superuser commands with the sudo command.

    Here's how to add a new user:

    1. Open a terminal window and log in to your Linode via SSH.
    2. Create the user by entering the following command. Replace example_user with your desired username:
    3. Add the user to the administer the system (admin) group by entering the following command. Replace example_user with your username:
    4. Log out of your Linode as the root user by entering the following command:
    5. Log in to your Linode as the new user by entering the following command. Replace example_user with your username, and the example IP address with your Linode's IP address:
    Now you can administer your Linode with the new user account instead of root. When you need to execute superuser commands in the future, preface them with sudo. For example, later in this guide you'll execute sudo iptables -L while logged in with your new account. Nearly all superuser commands can be executed with sudo, and all commands executed with sudo will be logged to /var/log/auth.log.

    4.72 Using SSH Key Pair Authentication

    You've used password authentication to connect to your Linode via SSH, but there's more a secure method available: key pair authentication. In this section, you'll generate a public and private key pair using your desktop computer and then upload the public key to your Linode. SSH connections will be authenticated by matching the public key with the private key stored on your desktop computer - you won't need to type your account password. When combined with the steps outlined later in this guide that disable password authentication entirely, key pair authentication can protect against brute-force password cracking attacks.


    Here's how to use SSH key pair autentication to connect to your Linode:


    1. Generate the SSH keys on a desktop computer running Linux or Mac OS X by entering the following command in a terminal window on your desktop computer. PuTTY users can generate the SSH keys by following the instructions in our PuTTY guide.
    2. The SSH keygen utility appears. Follow the on-screen instructions to create the SSH keys on your desktop computer. To use key pair authentication without a passphrase, press Enter when prompted for a passphrase.
    3. Upload the public key to your Linode with the secure copy command (scp) by entering the following command in a terminal window on your desktop computer. Replace example_user with your username, and 123.456.78.90 with your Linode's IP address. If you have a Windows desktop, you can use a third-party client like WinSCP to upload the file to your home directory.
    4. Create a directory on your Linode for the public key by entering the following command on your Linode:
    5. Move the public key in to the directory you just created by entering the following command on your Linode:
    6. Modify the permissions on the public key by entering the following commands, one by one, on your Linode. Replace example_user with your username.
    The SSH keys have been generated, and the public key has been installed on your Linode. You're ready to use SSH key pair authentication! To try it, log out of your terminal session and then log back in. The new session will be authenticated with the SSH keys and you won't have to enter your account password. (You'll still need to enter the passphrase for the key, if you specified one.)

    4.73 Disabling SSH Password Authentication and Root Login

    You just strengthened the security of your Linode by adding a new user and generating SSH keys. Now it's time to make some changes to the default SSH configuration. First, you'll disable password authentication to require all users connecting via SSH to use key authentication. Next, you'll disable root login to prevent the root user from logging in via SSH. These steps are optional, but are strongly recommended.

    Here's how to disable SSH password authentication and root login:

    1. Open the SSH configuration file for editing by entering the following command:
    2. Change the PasswordAuthentication setting to no as shown below. Verify that the line is uncommented by removing the # in front of the line, if there is one.:
    3. Change the PermitRootLogin setting to no as shown below:
    4. Save the changes to the SSH configuration file by pressing Control-X, and then Y.
    5. Restart the SSH service to load the new configuration. Enter the following command:
    After the SSH service restarts, the SSH configuration changes will be applied.
     
    cloudcine, Nov 27, 2012 IP
  13. cloudcine

    cloudcine Greenhorn

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #13
    4.8 Creating a Firewall

    Now it's time to set up a firewall to limit and block unwanted inbound traffic to your Linode. This step is optional, but we strongly recommend that you use the example below to block traffic to ports that are not commonly used. It's a good way to deter would-be intruders! You can always modify the rules or disable the firewall later.


    Here's how to create a firewall on your Linode:


    1. Check your Linode's default firewall rules by entering the following command:
    2. Examine the output. If you haven't implemented any firewall rules yet, you should see an empty ruleset, as shown below:
    3. Create a file to hold your firewall rules by entering the following command:
    4. Now it's time to create some firewall rules. We've created some basic rules to get you started. Copy and paste the rules shown below in to the iptables.firewall.rules file you just created.File:/etc/iptables.firewall.rules

    5. Edit the rules as necessary. By default, the rules will allow traffic to the following services and ports: HTTP (80), HTTPS (443), SSH (22), and ping. All other ports will be blocked.
    6. Save the changes to the firewall rules file by pressing Control-X, and then Y.
    7. Activate the firewall rules by entering the following command:
    8. Recheck your Linode's firewall rules by entering the following command:
    9. Examine the output. The new ruleset should look like the one shown below:
    10. Now you need to ensure that the firewall rules are activated every time you restart your Linode. Start by creating a new script with the following command:
    11. Copy and paste the following lines in to the file you just created:
      File:/etc/network/if-pre-up.d/firewall



    12. Press Control-X and then press Y to save the script.
    13. Set the script's permissions by entering the following command:
    That's it! Your firewall rules are in place and protecting your Linode. Remember, you'll need to edit the firewall rules later if you install other software or services.
     
    cloudcine, Nov 27, 2012 IP
  14. cloudcine

    cloudcine Greenhorn

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #14
    4.9 Installing and Configuring Fail2Ban

    Fail2Ban is an application that prevents dictionary attacks on your server. When Fail2Ban detects multiple failed login attempts from the same IP address, it creates temporary firewall rules that block traffic from the attacker's IP address. Attempted logins can be monitored on a variety of protocols, including SSH, HTTP, and SMTP. By default, Fail2Ban monitors SSH only.


    Here's how to install and configure Fail2Ban:


    1. Install Fail2Ban by entering the following command:
    2. Optionally, you can override the default Fail2Ban configuration by creating a new jail.local file. Enter the following command to create the file:
    3. Set the bantime variable to specify how long (in seconds) bans should last.
    4. Set the maxretry variable to specify the default number of tries a connection may be attempted before an attacker's IP address is banned.
    5. Press Control-x and then press y to save the changes to the Fail2Ban configuration file.
    Fail2Ban is now installed and running on your Linode. It will monitor your log files for failed login attempts. After an IP address has exceeded the maximum number of authentication attempts, it will be blocked at the network level and the event will be logged in /var/log/fail2ban.log.
     
    cloudcine, Nov 27, 2012 IP
  15. cloudcine

    cloudcine Greenhorn

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #15
    cloudcine, Nov 27, 2012 IP
  16. cloudcine

    cloudcine Greenhorn

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #16
    5.1 You should install some pre-compile packages in advance:

    Login to vps via SSH and execute the following command:

    sudo apt-get install cmake make pkg-config gcc gettext build-essential
    sudo apt-get install autoconf2.13
    export PHP_AUTOCONF=/usr/bin/autoconf2.13
    export PHP_AUTOCONF=/usr/bin/autoheader2.13
    sudo apt-get install git git-core subversion
    sudo apt-get install bison re2c flex
    sudo apt-get install sysv-rc-conf gettext unrar aptitude chkconfig
    sudo apt-get install libncurses5-dev libssl-dev libxml2-dev vim-nox
    sudo apt-get install openssl libssl-dev
    sudo apt-get install libssl0.9.8
    apt-cache search pcre | grep -- -dev
    sudo apt-get update
    sudo apt-get install libpcre3 libpcre3-dev

    5.2 Copy required software to VPS:

    Login to VPS via SSH and execute the following command:

    sudo mkdir /usr/temp/
    sudo chmod 777 /usr/temp/

    Exit VPS and transport your local file to server via scp command:

    sudo scp magento-1.7.0.0.tar.gz username@ip adress:/usr/temp/
    sudo scp nginx-1.3.6.tar.gz username@ip adress:/usr/temp/
    sudo scp nginx.conf username@ip adress:/usr/temp/
    sudo scp fcgi.conf username@ip adress:/usr/temp/
    sudo scp ninx username@ip adress:/usr/temp/
    sudo scp libpng-1.2.18 username@ip adress:/usr/temp/
    sudo scp libiconv-1.14.tar.gz username@ip adress:/usr/temp/
    sudo scp libmcryhpt-2.5.8.tar.gz username@ip adress:/usr/temp/
    sudo scp mhash-0.9.9.9.tar.gz username@ip adress:/usr/temp/
    sudo scp mcrypt-2.6.8.tar.gz username@ip adress:/usr/temp/
    sudo scp php-git.tar.gz username@ip adress:/usr/temp/
    sudo scp memchache-2.2.5.tgz username@ip adress:/usr/temp/
    sudo scp libevent-2.0.18-stable.tar.gz username@ip adress:/usr/temp/
    sudo scp memcached-1.4.5.tar.gz username@ip adress:/usr/temp/

    5.3 Install php lib, add usergroup, install mysql, nginx, etc

    5.31 Enter temp directory

    Login to VPS via SSH and execute the following command:
    sudo ssh username@123.456.78.90
    cd /usr/temp/

    5.32 install php lib

    sudo tar zxvf libpng-1.2.18.tar.gz
    cd libpng-1.2.18
    sudo ./configure --prefix=/usr/local/libpng
    sudo make && make install

    sudo apt-get install libpng-dev zlib1g-dev libbz2-dev
    sudo apt-get install libjpeg62 libjpeg62-dev libjpeg-progs
    sudo apt-get install screen
    sudo apt-get install msttcorefonts libfreetype6-dev libfontconfig1-dev chrpath
    sudo apt-get install libgd2-xpm libgd2-xpm-dev libreadline-gplv2-dev php5-gd
    sudo apt-get install libXpm-dev
    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get install php5-mcrypt
    sudo apt-get install libxml2 libxml2-dev
    sudo apt-get install xutils-dev
    sudo aptitude install sysstat
    sudo apt-get install libstdc++6 freeglut3
    sudo apt-get install libcurl3
    sudo apt-get install libcurl4-gnutls-dev
    sudo apt-get install libxslt1-dev
    sudo apt-get install libtool
    sudo apt-get install libt1-dev
    sudo apt-get install libgmp3-dev
    sudo apt-get install patch
    sudo apt-get install libc-client-dev
    sudo apt-get install freetds-dev
    sudo apt-get install libz-dev
    sudo apt-get install libmysqlclient-dev
    sudo apt-get install autotools-dev cpp curl gawk gcc lftp libc6-dev linux-libc-dev libpcrecpp0 libtool python
    sudo apt-get update
    sudo apt-get install php-pear

    5.33 Add www Group
    #################
    #Add www Group #
    #################
    sudo groupadd www
    sudo useradd -g www www
    sudo mkdir -p /home/www/wwwroot
    sudo chmod +w /home/www/wwwroot
    sudo chown www:www /home/www/wwwroot -R

    5.34 delete mysql and then install

    ###################
    #delete mysql if exist #
    ###################

    sudo apt-get autoremove mysql-server-5.0
    sudo apt-get remove mysql-server
    sudo apt-get autoremove mysql-server
    sudo apt-get remove mysql-common
    sudo dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P

    #####################
    # Install mysql manually #
    #####################

    sudo apt-get install mysql-client-5.5 mysql-server-core-5.5 mysql-server-5.5
    sudo apt-get install libmysqlclient-dev
    sudo update-rc.d mysql defaults

    #####################
    # test mysql is ok #
    #####################

    sudo service mysql start # sudo /etc/init.d/mysql restart
    sudo netstat -tap | grep mysql

    5.35 install and configurate nginx

    #####################
    # install nginx #
    #####################

    cd /usr/temp/
    sudo tar zxvf nginx-1.3.6.tar.gz

    cd nginx-1.3.6
    sudo ./configure --prefix=/usr/local/nginx --conf-path=/usr/local/nginx/conf/nginx.conf --with-http_realip_module --with-http_addition_module --with-http_gzip_static_module --with-http_random_index_module --with-http_stub_status_module --with-http_sub_module --with-http_dav_module --pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log
    sudo make && make install

    #######################################
    # Copy conf file/execute file to target directory #
    #######################################

    #Copy fcgi.conf to /usr/local/nginx/conf/fcgi.conf
    #Copy nginx.conf to /usr/local/nginx/conf/nginx.conf
    #Copy nginx to /usr/local/nginx/sbin/nginx

    #########################
    # give nginx right to execute #
    #########################

    sudo chmod +x /usr/local/nginx/sbin/nginx

    #############################################
    # Now you can start nginx by the following command #
    #############################################

    sudo /usr/local/nginx/sbin/nginx # start
    sudo /usr/local/nginx/sbin/nginx -s stop # stop
    sudo /usr/local/nginx/sbin/nginx -s reload # reload

    #########################################################################
    # If nginx error happen ...
    # nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)
    # after installing and restarting to start nginx I go this error:
    # Just restart again and this error will be disappared.
    #########################################################################

    ##########################################
    # Add nginx start to the system boot start item #
    ##########################################
    sudo update-rc.d nginx defaults

    5.4 Php, Php-fpm install and configuration

    # 5.41 Libiconv
    sudo cd /usr/local/src/
    sudo tar zxvf libiconv-1.14.tar.gz
    cd libiconv-1.14/
    sudo ./configure --prefix=/usr/local
    sudo make && make install && cd ..

    # 5.42 Libmcrypt
    sudo tar xjvf libmcrypt-2.5.8.tar.bz2
    sudo cd libmcrypt-2.5.8
    sudo ./configure
    sudo make && make install
    sudo /sbin/ldconfig
    cd libltdl/
    sudo ./configure --enable-ltdl-install
    sudo make && make install
    cd /usr/local/src/

    #5.43 Mhash
    sudo tar zxvf mhash-0.9.9.9.tar.gz
    cd mhash-0.9.9.9/
    sudo ./configure
    sudo make && make install
    cd ..
    ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la
    ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so
    ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4
    ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8
    ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a
    ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la
    ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so
    ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2
    ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1
    ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config
    sudo tar zxvf mcrypt-2.6.8.tar.gz
    cd mcrypt-2.6.8
    sudo /sbin/ldconfig
    sudo ./configure
    sudo make && make install

    5.44 delete php-fpm and then install

    ###########################################
    #delete php-fpm package before manually install it #
    ###########################################

    sudo apt-get autoremove php5-fpm
    sudo apt-get remove php5-fpm
    dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P

    ####################################################################
    # php package install #
    # if fail to run, reconfigure & make & make install again will be ok. #
    # Steps for using PHP from Git #
    # You can retrieve the PHP source code from our GitHub mirror with this command: #
    # sudo git clone https://github.com/php/php-src.git #or
    # sudo git clone http://git.php.net/repository/php-src.git #
    ####################################################################

    sudo git clone http://git.php.net/repository/php-src.git

    cd php-src
    ./buildconf # generate the configure script. This may take several moments
    sudo ./configure --with-mysql --with-iconv-dir=/usr/local --with-freetype-dir=/usr --with-jpeg-dir=/usr --with-png-dir=/usr --with-zlib --with-libxml-dir=/usr --with-xmlrpc --enable-xml --enable-mbstring --enable-ftp --with-gd --with-pear --enable-sockets --enable-gd-native-ttf --enable-sysvsem --enable-sysvshm --enable-shmop --enable-zip --enable-fpm --with-mhash --with-mcrypt --enable-bcmath --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --with-openssl —with-pdo-mysq
    sudo make ZEND_EXTRA_LIBS='-liconv' # This may take a long moments, be patient.
    sudo make install

    5.45 php-fpm config

    ##########################
    # php-fpm config #
    ##########################

    cp php.ini-production /usr/local/bin/php.ini
    cp sapi/fpm/init.d.php-fpm.in /etc/init.d/php-fpm
    chmod 755 /etc/init.d/php-fpm
    cp sapi/fpm/php-fpm.conf.in /etc/php-fpm.conf

    sudo nano /etc/init.d/php-fpm

    # add the following lines:

    php_fpm_BIN=/usr/local/sbin/php-fpm
    php_fpm_CONF=/etc/php-fpm.conf
    php_fpm_PID=/var/run/php-fpm/php-fpm.pid

    # add finished!

    sudo mkdir -p /var/run/php-fpm
    sudo chown www.www /var/run/php-fpm
    sudo chown www:www /var/run/php-fpm

    # edit php-fpm.conf
    sudo nano /etc/php-fpm.conf

    # add the following lines

    pid=/var/run/php-fpm/php-fpm.pid

    # change the following contents

    ;user = @php_fpm_user@ -> user = www
    ;group = @php_fpm_group@ -> group = www

    # finish change php-fpm.conf contents

    sudo nano /etc/init.d/php-fpm

    # add the following contents

    php_fpm_PID_dir=/var/run/php-fpm
    if [ ! -r $php_fpm_PID_dir ] ; then
    mkdir /var/run/php-fpm
    exit 1
    Fi

    # finish adding the contents

    sudo chmod 755 /etc/init.d/php-fpm
    /etc/init.d/php-fpm start

    ##################################
    # test whether or not php-fpm is running #
    ##################################

    sudo netstat -ntlp | grep 9000

    #############################################
    #add php-fpm to the service, let it start when pc start #
    #############################################

    sudo update-rc.d php-fpm defaults

    5.5 install php extension package ( optional package, required by Discuz! X 2.0)

    #5.51 Memcache

    cd /usr/local/src
    sudo tar zxvf memcache-2.2.5.tgz
    cd memcache-2.2.5/
    sudo /usr/local/bin/phpize
    sudo ./configure --with-php-config=/usr/local/bin/php-config
    sudo make && make install
    sudo updatedb

    locate php.ini

    sudo nano /usr/local/bin/php.ini

    ############################
    # modify php.ini file #
    ############################
    # find extension_dir = "./"
    # change into:
    extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20100525/"
    # add one line below above line:
    # add extension = "memcache.so"
    # find this : output_buffering = Off
    # change into this : output_buffering = On
    # save

    #5.52 Memcached

    cd /usr/local/src
    sudo tar zxvf libevent-2.0.18-stable.tar.gz
    cd libevent-2.0.18-stable
    sudo ./configure --prefix=/usr/lib
    sudo make
    sudo make install
    cd ../

    sudo tar zxvf memcached-1.4.5.tar.gz
    cd memcached-1.4.5
    sudo ./configure --prefix=/usr/local --with-libevent=/usr/lib/

    # If error happen, pls do this patch to keep on:

    sudo wget http://johntech-resource.googlecode....aliasing.patch
    # sudo wget http://sr.cloudcine.com/soft/fix-strict-aliasing.patch

    sudo patch memcached.h fix-strict-aliasing.patch
    sudo nano Makefile
    # find this : CFLAGS = , Add this contents: -Wno-error=unused-but-set-variable
    # finally it should be as follows:
    CFLAGS = -g -O2 -pthread -Wall -Werror -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wno-error=unused-but-set-variable

    sudo make && make install
    sudo /usr/local/bin/memcached -d -u www -m 128

    5.6 Security configuration for php package

    sudo nano /usr/local/bin/php.ini
    # find ; cgi.fix_pathinfo=1 in /usr/local/bin/php.ini
    # delete the symbol “;” and change into :
    cgi.fix_pathinfo=0

    5.7 Magento install

    sudo mysql -u root -p # enter mysql
    mysql> DROP DATABASE test; # delete test database
    mysql> DELETE FROM mysql.user WHERE user = ''; # delete blank user
    mysql> FLUSH PRIVILEGES;
    msyql> CREATE DATABASE yourdatabasename;
    mysql> GRANT ALL PRIVILEGES ON yourdatabasename.* TO 'mysqlusername'@'localhost' IDENTIFIED BY 'mysqlpassword';
    sudo cp /usr/temp/magento-1.7.0.0.tar.gz /home/www/wwwroot/magento-1.7.0.0.tar.gz
    sudo cd /home/www/wwwroot
    sudo tar zxvf magento-1.7.0.0.tar.gz

    sudo mv magento store

    #####################
    # give write right to user #
    #####################

    sudo chmod -R 777 /home/www/wwwroot
    sudo chmod -R 777 /home/www/wwwroot/store/

    ###################################################
    # provide write right to your directory (such as “store") #
    ###################################################

    cd /home/www/wwwroot/store
    sudo find . -type d -exec chmod 777 {} \;
    sudo find . -type f -exec chmod 644 {} \;
    sudo find . -type d -exec chmod 755 {} \;
    sudo chmod o+w var var/.htaccess includes includes/config.php app/etc
    sudo chmod -R o+w media
    sudo chmod -R 777 var

    ##################################################################
    # install your magento on your sub-domain store.yourdomain.com #
    ##################################################################

    http://store.yourdomain.com
    ... ...
     
    cloudcine, Nov 27, 2012 IP
  17. cloudcine

    cloudcine Greenhorn

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #17
    5.8 nginx.conf example file

    
    #user  www www;  # if www user fail to install, change into root user.
    user root root;
    worker_processes  1;
    error_log  /var/log/nginx/error.log;
    pid        /var/run/nginx.pid;
    events {
           worker_connections  1024;
           }
    http {
        include       mime.types;
        default_type  application/octet-stream;
        keepalive_timeout  65;
        tcp_nopush      on;
        tcp_nodelay     on;
        server_tokens   off;
        gzip            on;
        gzip_static     on;
        gzip_comp_level 2;
        gzip_min_length 1024;
        gzip_proxied any;
        access_log  /var/log/nginx/access.log;
        sendfile        on;
        autoindex off;
        map $scheme $fastcgi_https { ## Detect when HTTPS is used
            default off;
            https on;
          }
    server {
        listen 80;
        client_max_body_size 2000M;
        server_name yourdomain.com www.yourdomain.com;
        root /home/www/wwwroot;  # root directory for your whole website
        index index.php index.html index.htm default.htm default.html;
        location / {
           if (-f $request_filename) {
                          expires 30d;
                      break;
                                      }
            if (!-e $request_filename) {
                           rewrite ^(.+)$ /index.php last;
                                       }
            try_files $uri $uri/ @handler;
                   }
        location @handler { ## Magento uses a common front handler
                            rewrite / /index.php;
                          }
        location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
            rewrite ^(.*.php)/ $1 last;
                         }
        location ~ \.php$ {
            expires        off; ## Do not cache dynamic content
            if (!-e $request_filename) { rewrite / /index.php last; } ## Catch 404s that try_files miss
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fcgi.conf;
                      }
       }#main server
    server {
        listen 80;
        client_max_body_size 2000M;
        server_name store.yourdomain.com; # your sub-domain website, such as: store.yourdomain.com
        root /home/www/wwwroot/store;             # the path for yoru sub-domain
        index index.php index.html index.htm default.htm default.html;
        location / {
           if (-f $request_filename) {
                          expires 30d;
                      break;
                                      }
            if (!-e $request_filename) {
                           rewrite ^(.+)$ /index.php last;
                                       }
            try_files $uri $uri/ @handler;
                   }
        location @handler { ## Magento uses a common front handler
                            rewrite / /index.php;
                          }
        location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
            rewrite ^(.*.php)/ $1 last;
                         }
        location ~ \.php$ {
            expires        off; ## Do not cache dynamic content
            if (!-e $request_filename) { rewrite / /index.php last; } ## Catch 404s that try_files miss
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fcgi.conf;
    
                       }
           }#store server
    server {
        listen 80;
        client_max_body_size 2000M;
        server_name forum.yourdomain.com;    #another sub-domain, create another server{}
        root /home/www/wwwroot/forum;
        index index.php index.html index.htm default.htm default.html;
        location / {
           if (-f $request_filename) {
                          expires 30d;
                      break;
                                      }
            if (!-e $request_filename) {
                           rewrite ^(.+)$ /index.php last;
                                       }
            try_files $uri $uri/ @handler;
                   }
        location @handler { ## Magento uses a common front handler
                            rewrite / /index.php;
                          }
        location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
            rewrite ^(.*.php)/ $1 last;
                         }
        location ~ \.php$ {
            expires        off; ## Do not cache dynamic content
            if (!-e $request_filename) { rewrite / /index.php last; } ## Catch 404s that try_files miss
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fcgi.conf;
                       }
           }#forum server
    }## http end
    
    
    PHP:
     
    cloudcine, Nov 27, 2012 IP
  18. cloudcine

    cloudcine Greenhorn

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #18
    6. About Payment Process

    Available Payment processor is : Paypal, Monebookers, Google CheckOut, 2CheckOut, Alipay (used in China).

    In united states, Paypal and Google CheckOut is popular.
    In Europe, Moneybookers is popular, Paypal is also ok.

    If you’re not sure, just use Paypal.

    Please note that your client may return their money even they have send them to you, it may improve the risks for the seller for Paypal.

    For 2CheckOut, you have to pay a little higher cost for the Payment Processor.

    For Paypal configuration, it's so easy, the example configuration website is as follows:

    Find

    And provide your PayPal email address there.
     

    Attached Files:

    cloudcine, Nov 27, 2012 IP
  19. cloudcine

    cloudcine Greenhorn

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #19
    7. Setup your own Forum sub-site

    ##################################################################
    # install your Discuz! X 2.0 on your sub-domain, such as forum.yourdomain.com #
    ##################################################################

    sudo svn checkout http://discuzx-en.googlecode.com/svn/trunk/discuzx2.0/

    sudo tar zxvf discuzx2.0.tar.gz

    # Move all source code of discuz x 2.0 to the following directory: /home/www/wwwroot/forum

    cd /home/www/wwwroot/forum
    sudo chmod -R 777 ./data
    sudo chmod -R 777 ./config
    sudo chmod -R 777 /home/www/wwwroot/forum
    http://forum.yourdomain.com/
    ... ...

    Congraduation! Both your Store and Forum have been established, start your online store business right now!!
     
    cloudcine, Nov 27, 2012 IP
  20. sshoaibahmed

    sshoaibahmed Member

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #20
    wow nice details
    very informative
     
    sshoaibahmed, Nov 28, 2012 IP