diff --git a/README.md b/README.md new file mode 100644 index 0000000..5fa6aa2 --- /dev/null +++ b/README.md @@ -0,0 +1,73 @@ +# h2vx.com +H2VX microformats to vCard/iCalendar converter, test dev.h2vx.com for issues + +# Setting up locally + +_The instructions (below) assume that you are using a Debian/Ubuntu/*nix distro. Commands are Ubuntu-centric, but can be adjusted to the *nix of your choice._ + +1. Install `tasksel` for LAMP-server setup: +``` +sudo apt install tasksel +``` + +2. Install LAMP-server via `tasksel`: +``` +sudo tasksel +``` +(starts tasksel) + +Follow the rest of the instructions using the Ubuntu-tasksel [link here](https://help.ubuntu.com/community/Tasksel#Usage) + +3. Install missing php-packages (assuming `php5` is installed): +``` +sudo apt install php5-curl php5-xsl php5-tidy +``` + +4. After you have downloaded/extracted the website, you can use the following command(s) to `push` the site to the Apache-server: +``` +sudo cp -av ~/h2vx.com-master/* /var/www/html/ +sudo chmod 755 -R /var/www +# the chmod is normally required to overcome 403 or other permissions-issues +``` + +5. Copy/Paste the following code into `~/vcf/sharing.js`: +``` +/* sharing.js + +2009-10-26 created by Tantek Çelik http://tantek.com + +NOTES: +This depends on functions defined in common.js +---------------------------------------------------- */ + +var base = document.location.href.substr(0, document.location.href.lastIndexOf('/vcf/') + 5); + +function updatesharing() { + var uri = uriclean(document.forms[0].uri.value); + document.getElementById('vcardlink').value = base+uri; + uri = htmlspecialchars(uri); + document.getElementById('HTML').value ='Download vCard'; +} + +document.forms[0].uri.onkeyup = updatesharing; +document.write('

'); + +updatesharing(); +``` + +Note. Adjusting the `sharing/js` is required to get the generator to render on your domain (eg. `localhost/vcf` ) + +Note2. Remember to copy/paste the `sharing.js` to `var/www/html` in case you make changes to the local copy. + +## Troubleshooting + + - Restart Apache server: + ``` + sudo service apache2 restart + ``` + + - View Apache Logs: + ``` + sudo cat /var/log/apache2/access.log + sudo cat /var/log/apache2/error.log + ```