smallbizwiz Posted July 21, 2014 Share Posted July 21, 2014 I spent the better part of a day getting PrestaShop set up on Digital Ocean today. I would give credits, but since none of the guides were complete, I don't want to point someone to bad information. Pre-Work: Install Putty Install Putty on your client - google “install Putty” for many different tutorials Helpful tip: When you highlight a line on the Putty window, it automatically saves that to the clipboard. Right-Click to paste in Putty. Set up on Digital Ocean This guide is pretty good, but lacks a major point: setting up apache config file, my tutorial addresses this: http://blobmarket.com/blog/en/install-prestashop-1-6-on-a-digital-ocean-vps.html#.U8egZ_ldXmd Sign Up for Digital Ocean Create a Droplet Hostname: yourdomain.today (without www) Size: 1GB ($10/mo) Region: New York Image: Application: LAMP on Ubuntu 12.04 NOTE: do NOT choose LEMP, choose LAMP Settings: Leave the Option Enable Virt() checked Check enable back-ups if you want, it will cost you 20% more Connecting to the Droplet After you create the Droplet, you will receive your credentials via email Using Putty, connect to the server using the credentials you received (i.e. logged in as root) Change password: passwd root Configure MySQL (logged in as root) Change Password: mysqladmin -u root -p‘OLDPASSWORD’ password NEWPASSWORD NOTE: OLDPASSWORD is right next to -p and it is surrounded by single quotes mysql -u root -p The following will create your first database CREATE DATABASE yourfirstdatabase The following will create your first user GRANT ALL PRIVILEGES ON yourfirstdatabase .* TO 'username'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON yourfirstdatabase .* TO 'username'@'%' IDENTIFIED BY 'password'; The following will exit you from mysql \q The following will allow you to test your new user log-in mysql -u username -p ENTER ‘password’. This should work! Set up FTP Install FileZila on your client (google FileZila download for installation and general help) In Putty, login as root With Root sudo apt-get install vsftpd vi /etc/vsftpd.conf In conf file, verify anonymous_enable=NO //Should be OK local_enable=YES //Should be OK write_enable=YES //Search for write - uncomment chroot_local_user=YES //Search for chroot - uncomment NOTE: Search in vi is ESC-/. After the slash, type the string you’re looking for, press ‘n’ for the next instance. Press ‘i’ when you’re at the spot to edit the file. Press ESC,wq,ENTER to save Create new user adduser newguy Enter a password that you’ll remember for newguy visudo Scroll to the line toward the bottom that reads:root ALL=(ALL) ALL Add the line: newguy ALL=(ALL) ALL NOTE: location of the line above is important, make sure it’s the line below root ALL… If not, this won’t work and you’ll get errors Save with CTRL-o, then CTRL-X With newguy (i.e. exit root) cd ~ sudo mkdir files sudo mikdir www With root (i.e. su - ) chown root:root /home/newguy mount --bind /var/www/ /home/newguy/www/ sudo nano /etc/fstab Scroll to the bottom of file and add: /var/www/ /home/username/www/ none bind 0 0 cd /home/newguy All directories/sub-directories to 755: find www -type d -exec chmod 755 {} + All files to 644:find www -type f -exec chmod 644 {} + sudo service vsftpd restart Permissions Cheat sheet: http://danflood.com/wordpress/2013/12/chmod-cheat-sheet/ Set Up PrestaShop Download Prestashop In a browser, go here to find the link to download the latest PrestaShop zip file: https://code.google.com/p/prestashop/downloads/list Copy the link location of the latest zip file On the server (i.e. via Putty, login as root) sudo mkdir -p /var/www/yourdomain cd /var/www/yourdomain/ wget INSERT_LINK_COPIED_ABOVE_WITH_ZIP_AT_END sudo apt-get -y install zip unzip prestashop_1.6.X.X.zip cd / && mv /var/www/yourdomain/prestashop/* /var/www/yourdomain/ rmdir /var/www/yourdomain/prestashop/ && rm /var/www/yourdomain/prestashop_1.6.X.X.zip Installing Prestashop (i.e. via Putty, login as root) chown www-data:www-data -R /var/www/yourdomain/ chmod -R 0744 /var/www/yourdomain sudo apt-get update sudo apt-get -y install php5-gd vi /etc/apache2/sites-enabled/000-default.conf Change: DocumentRoot /var/www/html to DocumentRoot /var/www sudo service apache2 restart Configure PrestaShop In a browser, go to http://IP.ADD.RE.SS/yourdomain Enter database chosen above Username:root MySQL password above Clean Up the Install rm -r /var/www/yourdomain/install/ mv /var/www/yourdomain/admin/ /var/www/yourdomain/psadmin/ phpMyAdmin Set Up As root sudo apt-get install phpmyadmin During the installation, phpMyAdmin will walk you through a basic configuration. Once the process starts up, follow these steps: Select Apache2 for the server Choose YES when asked about whether to Configure the database for phpmyadmin with dbconfig-common Enter your MySQL password when prompted Enter the password that you want to use to log into phpmyadmin sudo nano /etc/apache2/apache2.conf In file, scroll the bottom of the file, add the line: Include /etc/phpmyadmin/apache.conf CTRL-o, ENTER, CTRL-x sudo service apache2 restart sudo service mysql restart php.ini configuration You will need to edit a few lines if you want to change translations in the back office as you’ll encounter a configuration limit error. vi /etc/php5/apache2/php.ini /max_input (this searches for the existing line) i (this allows you to insert data into the file) Type (Thanks to Vekia for this info): max_input_vars = 3000suhosin.post.max_vars = 3000suhosin.request.max_vars = 3000 sudo service apach2 restart DNS Set Up: NOTE: Only required if the domain is different than the name you gave the droplet Go To Digital Ocean Contral Panel (https://cloud.digitalocean.com/domains/354968) NOTE: This only Click DNS under Create on the left Enter your domain name (without www) under name Leave IP Address blank Select the Droplet where your files are hosted Click Create Domain Add Record Record Type: CNAME Name: www Hostname: @ Record Type: CNAME Name: * Hostname: @ 1 Link to comment Share on other sites More sharing options...
smallbizwiz Posted July 21, 2014 Author Share Posted July 21, 2014 Sorry about the formatting guys; it looked fine before I clicked post! I can share the doc on Google Drive. Message me if you want something cleaner. I also took notes on different errors/fixes I was doing the installation [multiple times] Link to comment Share on other sites More sharing options...
wakabayashi Posted September 4, 2014 Share Posted September 4, 2014 Could you please tell me how you set up email? For my phpmail is not working!? Link to comment Share on other sites More sharing options...
HaCos Posted September 15, 2014 Share Posted September 15, 2014 (edited) Hello, Thanks for the guide! Edited December 9, 2015 by HaCos (see edit history) Link to comment Share on other sites More sharing options...
thepan Posted September 15, 2014 Share Posted September 15, 2014 I would like to know if anyone has experience with settings up a deployment on digital ocean that includes apache nginx varnish mqsql and memcached. Link to comment Share on other sites More sharing options...
Recommended Posts