Standard Mail function is broken if MX Record is changed
Most of Contact Us form or other types of form on your website are using standard PHP mail function if it’s not set for SMTP Server (using WP-Mail-SMTP plugin). So if you move MX Record of your domain name from Godaddy to Google Mail Server, you’ll need to set the MX Entry to “Remote Mail Exchanger” option in order for the PHP standard Mail() function works properly on your website.
How to add NodeJS process to windows
There’re a few ways to add NodeJS process to windows server.
Install node-windows
npm install -g node-windows
Then Daemonizing your script is accomplished through code:
var Service = require('node-windows').Service;
// Create a new service object
var svc = new Service({
name:'Hello World',
description: 'The NodeJS web server.',
script: 'C:\\path\\to\\my\\node\\script.js'
});
// Listen for the "install" event, which indicates the
// process is available as a service.
svc.on('install',function(){
svc.start();
});
// Listen for the "start" event and let us know when the
// process has actually started working.
svc.on('start',function(){
console.log(svc.name+' started!\nVisit http://localhost:3001 to see it in action.');
});
// Install the script as a service.
svc.install();
Or simply use the daemon npm module
var daemon = require('daemon');
daemon.daemonize({
stdout: './log.log'
, stderr: './log.error.log'
}
, './node.pid'
, function (err, pid) {
if (err) {
console.log('Error starting daemon: \n', err);
return process.exit(-1);
}
console.log('Daemonized successfully with pid: ' + pid);
// Your Application Code goes here
});
Or put nodejs MyServer.js in a .sh file, and nohup sh startserver.sh
Or use this package built by talles
npm install -g qckwinsvc Installing your service: > qckwinsvc prompt: Service name: [name for your service] prompt: Service description: [description for it] prompt: Node script path: [path of your node script] Service installed Uninstalling your service: > qckwinsvc --uninstall prompt: Service name: [name of your service] prompt: Node script path: [path of your node script] Service stopped Service uninstalled
Or install os-service here
npm install os-service
var service = require ("os-service");
//A program can then be added, removed and run as a service:
service.add ("my-service");
service.remove ("my-service");
var logStream = fs.createWriteStream ("my-service.log");
service.run (logStream, function () {
console.log ("stop request received");
service.stop ();
});
A fix for XAMPP – Apache Server in Windows 10
Windows 10 will throw errors when you try to start Apache server in XAMPP.
7:56:35 AM [Apache] Attempting to start Apache app…
7:57:05 AM [Apache] Problem detected!
7:57:05 AM [Apache] Port 80 in use by “Unable to open process” with PID 4!
7:57:05 AM [Apache] Apache WILL NOT start without the configured ports free!
7:57:05 AM [Apache] You need to uninstall/disable/reconfigure the blocking application
7:57:05 AM [Apache] or reconfigure Apache and the Control Panel to listen on a different port
To fix this issue, the World Wide Web Publishing Service (IIS) of Windows 10 must be disabled. This service by default it’s using Port 80.
Open a CMD prompt and type in command: net stop was /y
Run Dialog Box (press keys Win+R) .. then type: services.msc
Then scrolled down to: World Wide Web Publishing Service Double clicked on it and clicked STOP (if this service status is Started)
Start Apache again with XAMPP.
Another way to get access to the services – go to Control Panel > System and Security > Administrative tools > Services
“SQL Server Reporting Service(MSSQLSERVER)” also uses port 80 and so it should be stopped if MS-SQL sever is insalled on your machine.
Another very easy option is to simply set Apache to listen on a different port. This can be done by clicking on the “Config” button on the same line as the “Apache” module, select the “httpd.conf” file in the dropdown, then change the “Listen 80” line to “Listen 8080”. Save the file and close it.
Now it avoids Port 80 and uses Port 8080 instead without issue. The only additional thing you need to do is make sure to put localhost:8080 in the browser so the browser knows to look on Port 8080. Otherwise it defaults to Port 80 and won’t find your localhost website.
Google Map will not load in hidden tab and switcher
If you embed Google Map in your website or application, you’ll have to place it outside of hidden tab; Or you’ll need to add a trigger in JavaScript to load the map; however, visitors of your website must double click to fully load the map.
You can add this trigger like this on the page: google.maps.event.trigger(map0, ‘resize’);
Or you can add a function call to Click event of a map tab:
$( "#TabIDHere" ).click(function() {
google.maps.event.trigger(map0, 'resize');
});
What to do if your WordPress has been hacked
If your business website or personal blog is running on WordPress framework, you must upgrade to at least V4.4 as of Jan 2016. Before doing so, please read the instruction how to backup your files and database here. If not, your website maybe in danger of malicious embedded code attack. If you do, scan all wp- directories to find this type of codes:
————-
…