luisfmelo
3/29/2017 - 7:18 PM

Woocommerce set up example

Woocommerce set up example

# this can help to install locally: http://vccw.cc/

################################################################################
# ON SERVER:

# install LAMP stack
sudo apt-get update
sudo apt-get install apache2
sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
sudo mysql_install_db
sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt php5-curl php5-gd php5-xmlrpc
sudo service apache2 restart

# config database
mysql -u root -p
  > CREATE DATABASE wdmdb;
  > CREATE USER wpuser@localhost IDENTIFIED BY 'pwd';
  > GRANT ALL PRIVILEGES ON wdmdb.* TO wpuser@localhost;
  
# install wordpress
cd /var/www/html
sudo wget http://wordpress.org/latest.tar.gz
sudo tar -xzvf latest.tar.gz
sudo rm latest.tar.gz
sudo chown -R www-data:www-data *
sudo nano wordpress/wp-config.php
sudo chmod -R 777 *




# Configure Pretty Permalinks for WordPress
    # This part is optional.
    # By default, WordPress creates URLs dynamically that look something like this http://server_domain_name_or_IP/?p=1. This isn't exactly the most useful interface for visitors or search engines,         so most users want to modify this. WordPress has the ability to create "pretty" permalinks which will clean up the URL into a more human-friendly format. The following steps show you how to         setup pretty permalinks in your WordPress Blog.
    # 6.1 Apache Rewrite

    # We will modify the apache virtual host file for Wordpress 4.5 to allow .htaccess overrides. Add the following (red) lines in the 000-default.conf file:
    
    sudo nano /etc/apache2/sites-available/000-default.conf

            [...]
             ServerAdmin webmaster@localhost
                    DocumentRoot /var/www/html
                    ServerName server1.example.com
                    <Directory /var/www/html/>
                    AllowOverride All
                    </Directory>
            [...]

    # Next, we have to to enable the Apache rewrite module. Run:
        sudo a2enmod rewrite
        sudo service apache2 restart


            ## Common Settings -> Post name
            ## Optional -> Product category base	-> shop
            ## Product Permalinks ->  Custom Base	-> /product
            
            

# for woocommerce: https://shopplugins.com/woocommerce-demo-data/