Using Drupal syslog instead of default db log

Here is the doc: https://www.drupal.org/documentation/modules/syslog

Basically, just enable syslog module which is already in the core. And disable the database logging module.

Enabled syslog module on Drupal’s module administration screen, went to Administration / Configuration / Development / Logging and errors and set the Syslog facility to LOG_LOCAL3.(Any of them in the dropdown should be ok I think)

Then you need config the syslog config file. It’s different between Linux and Mac. Here is a instruction for OS X Yosemite:

1. Just like above, create the log file with

sudo touch /var/log/drupal.log

2. Instead of adding a line to /etc/syslog.conf, add the following line to /etc/asl.conf:

# Drupal logging
? [= Facility local3] file /var/log/drupal.log

3. Restart logging with

sudo launchctl unload /System/Library/LaunchDaemons/com.apple.syslogd.plist
sudo launchctl load /System/Library/LaunchDaemons/com.apple.syslogd.plist

My problem is above restart syslog service not working. So I did a restart for my Mac and all works.

AWS EC2 + LAMP + Ubuntu + Drupal install

Tutorial from AWS EC2 Docs

http://docs.aws.amazon.com/gettingstarted/latest/wah-linux/web-app-hosting-intro.html

Ubuntu install Apache + PHP

Check this tut but we have RDS so not need to install MySQL like this: http://www.chrishjorth.com/blog/free-aws-ec2-ubuntu-apache-php-mysql-setup/

Basic: http://howtoubuntu.org/how-to-install-lamp-on-ubuntu

Install php mysql:

Restart apache:

Error log:  /var/log/apache2/error.log

 

 

Using Git from BitBucket repository

Install git first. Then when I try to clone the Bitbucket repository, it failed and gives error:

To solve this, you need using SSH keys:

To create SSH keys:

 

Drupal commerce orders not process with Paypal payment

We have a site based on Drupal Commerce and Paypal WPS payment method. After launch, we found some orders by Paypal is stuck in the status of “Checkout: Confirm order” and not go to the next status.

After checking we find when a Paypal payment finished,  the user will be gave two options. One is go back to our site, another is go to Paypal site. And if a user chose the second option, we will lost the order confirmation from Paypal.

Luckily I find Paypal has a “auto return” option for us. So we can force user to redirect to our site after he/she finished the payment, without giving a option to Paypal site.

It works but has some exceptions. We still found some orders are not confirmed after set our Paypal to “auto return”.

The issue be found when a user chose Paypal but select the credit card to pay. This is called “Paypal account optional”, and if this one is turning on, the user using credit card will not be redirected. As in the Paypal docs said:

Note: If you have turned on Auto Return and have chosen to turn on PayPal Account Optional for new users, a new user will not be automatically directed back to your website, but will be given the option to return.

So turn off this option will fix the issue.

For more solutions, we can look at this discussion on drupal.org: “When completing the checkout process” never fires if a rule sets order complete on IPN

The solution works around “auto redirect”: https://www.drupal.org/node/2485507

Drupal mobile site for Acquia cloud

Responsive mobile theme is not in this scope. Here is talking about dedicated theme for mobile devices.

Acquia cloud is using Varnish. For theme switch solution, it has a problem.

Here is Acquia documentation for mobile:  Enabling device-based redirects

And another one about back to desktop version:  Circumvent mobile redirects with a desktop cookie

So in my understanding, it requires us to give a different mobile domain, usually subdomain like m.yourdomain.com to your mobile version.