- #install nodejs(Run "yum clean all && rpm --rebuilddb && yum update" in case yum cant find them)
- yum install nodejs
- #install nodejs,s npm utility
- yum install npm
- #install Font configuration and customization library
- yum install fontconfig-2.8.0-3.el6.i686
- cd /usr/local/
- #download prerender server
- git clone https://github.com/collectiveip/prerender.git
- cd prerender/
- #build and install
- npm install
- #create runner and log file
- echo "node server.js >> \"prerender_log.txt\"" >> prerender_runner.sh
- #set to run at startup
- echo "nohup /usr/local/prerender/prerender_runner.sh &" >> /etc/rc.local
- #start prerender
- sh prerender_runner.sh &
- #check output from prerender server
- tail -f prerender_log.txt
By default it starts on port 3000.So you will find it at : localhost:3000
To test if it successfully installed simply browse to this url:
http://localhost:3000/http://www.facebook.com
Right click on document and click view page source.You won't find any javascript there cause the page comes after all javascripts are executed.
Be careful about url syntax.Omitting protocol(http/https) and www will not work.Like these urls will not work:
http://localhost:3000/www.facebook.com
http://localhost:3000/http://facebook.com
Related:-
Making javascript heavy sites crawlable / SEO with Prerender.IO / Getting started with Prerender.io for java sites
Running web application & prerender node server on same machine
No comments:
Post a Comment