Fork me on GitHub

pe_pplog demo page

Main menu

reverse proxies

1 Comment
if you are using a reverse proxy, the registered ip address from users visiting your site will always seem to be localhost (127.0.0.1), which affects the following features:

Users online is always 1 or 0

Banning is simply not possible

The login cookie being ip dependent is simply redundant

all of this will be fixed in the upcoming bugfixed version


How to create a self signed ssl certificate

No comments
In the newest version of the blog one can chose for the login to require a ssl (https) connection. This is obviously the safer option, especially if using the blog on a public wifi.

As the certificate generated in this how-to is not verified by a Certificate Authority such as Thawte or Verisign, your browser will notice an error inform you that the signing certificate authority is unknown and not trusted. Bear in mind that this is your self-signed certificate. So, you should ignore that error message.

Generating this certification does not mean that your site will automatically use https. You will have to manually type in https://yoursite.com

Here is how to create a ssl certificate for the Hiawatha server (for Apache see below):

1. Open a terminal/console at local or do it remotely through SSH access

2. The first thing that need to do is, create a RSA Private Key by using the below command.

#openssl genrsa -des3 -out server.key 2048


Generating RSA private key, 2048 bit long modulus
.........................................................++++++
.........................................................++++++
...........+
e is 65537 (0x10001)

3. The next step is to create a Certificate Signing Request (CSR). CSR is a message sent from an applicant to a certificate authority in order to apply for a digital identity certificate. User will be prompt to enter an information that related to CSR certificate. To create a CSR, enter the below command.

#openssl req -new -x509 -days 3650 -key serverkey.pem -out server.crt


Country Name (2 letter code) [GB]:type your 2 letter country code
State or Province Name (full name) [Berkshire]:type your state or province name
Locality Name (eg, city) [Newbury]:type your city name
Organization Name (eg, company) [My Company Ltd]:type your company name
Organizational Unit Name (eg, section) []:type your department
Common Name (eg, your name or your server's hostname) []:type your server hostname
Email Address []:type your email address

4. The next steps:

#echo "" >> serverkey.pem

#cat server.crt >> serverkey.pem
#echo "" >> serverkey.pem
#rm -f server.crt


5. Installing the Private Key and Certificate is simple. All you need to do is to know where are your hiawatha configuration files. I assume that, we are using /etc/hiawatha, but it might be /usr/local/etc/hiawatha. So, copy the serverkey.pem file to the directory and make it only readable for root.

#cp serverkey.pem /etc/hiawatha

# chmod 400 /etc/hiawatha/serverkey.pem


When you are being asked to overwritten the file, just type yes and hit Enter.

6. Add a ssl binding to the hiawatha config file. Open /etc/hiawatha/hiawatha.conf. Add the following after
Binding {
Port = 80
....
}

Binding {

Port = 443
SSLcertFile = /etc/hiawatha/serverkey.pem
}


7. Restart Hiawatha and test to access your site using https://. Check the certificate and make sure the information that you have inserted is correct.

8. Finish! Your configuration is done. Good luck :-)

And now for Apache
1. Open a terminal/console at local or do it remotely through SSH access

2. The first thing that need to do is, create a RSA Private Key by using the below command.

#openssl genrsa -des3 -out server.key 1024


Generating RSA private key, 1024 bit long modulus
.........................................................++++++
........++++++
e is 65537 (0x10001)
Enter PEM pass phrase: enter the desired pass phrase
Verifying password - Enter PEM pass phrase: same as a above

3. The next step is to create a Certificate Signing Request (CSR). CSR is a message sent from an applicant to a certificate authority in order to apply for a digital identity certificate. User will be prompt to enter an information that related to CSR certificate. To create a CSR, enter the below command.

#openssl req -new -key server.key -out server.csr


Country Name (2 letter code) [GB]:type your 2 letter country code
State or Province Name (full name) [Berkshire]:type your state or province name
Locality Name (eg, city) [Newbury]:type your city name
Organization Name (eg, company) [My Company Ltd]:type your company name
Organizational Unit Name (eg, section) []:type your department
Common Name (eg, your name or your server's hostname) []:type your server hostname
Email Address []:type your email address
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:type your password
An optional company name []:type your company name

4. The next step is to remove the passphrase key. It is because if you enable the passphrase, Apache will ask for the pass-phrase each time the web server is started. It will be a problem if the server is restarted as the user always need to type the passphrase. The below command will remove the passphrase.

#cp server.key server.key.org

#openssl rsa -in server.key.org -out server.key



5. To generate a Self-Signed Certificate, enter the below command. 

#openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt


6. Installing the Private Key and Certificate is simple. All you need to do is to know where are your XAMPP Apache directory. I assume that, we are using the default XAMPP directory, /opt/lampp. So, copy the two below files, ssl.crt and ssl.key to the XAMPP directory.

#cp server.crt /opt/lampp/etc/ssl.crt

#cp server.key /opt/lampp/etc/ssl.key/server.key


When you are being asked to overwritten the file, just type yes and hit Enter.

7. Restart Apache and test to access your site using https://. Check the certificate and make sure the information that you have insert is correct.

8. Finish! Your configuration is done. Good luck :-)

Adapted from: http://shahpunyerblog.blogspot.com



How to add social share buttons (part 2)

No comments
In a previous post I wrote about how to have individual social share buttons on the posts. For individual buttons this works well, just click on any of the links from the previous post, follow the instructions and copy and paste the resulting html code to $config_customHTMLpost. Remember to use a \ before any '. For example for the diaspora button I used the following code:


<a href="javascript:window.open('http://sharetodiaspora.github.com/?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title),'das','location=no,links=no,scrollbars=no,toolbar=no,width=620,height=550');"
style="padding: 3px 4px 2px; background: #fafafa; border: 1px solid #ddd; font-size: 13px; color: #222; text-decoration: none; vertical-align: top;">
<img src="https://joindiaspora.com/favicon.ico" style="border: 0px solid;" /> Diaspora*
</a>


this is also a good method to have a "follow me" twitter button in the menu.

However if one wants to include a lot of buttons, the result is going to be a mess and take a lot of time and patients to make it look in any way harmonious.

This is where JQuery comes in. There are several plugins, which I tested (because it was raining today) and here are some thoughts on them.

Jsshare
I had some real problem getting this to work properly, in in the end I gave up on the + button and slide effect and instead opted to simply display all the buttons next to "No comments". I suspect that it might work better with an older version of JQuery (1.8.3) more about how to use a different version of JQuery later.

Screenshot-1

It is very lightweight, I like the concise css, which is makes it easy to customise the look. One can simply replace the icons in the image folder and change background and border however one wants to. In this way I could make it play along nicely with the Diaspora button (the one in the end). It isn't possible to share via any of ones social media accounts (such as tweet via @yourname) and it has google buzz support, does this even still exist?

Sharrre
I like the name! This plugin might be great if you are a web-devloper and need something as customisable as possible. It was easy to add the diaspora button for example. Each social button can have an individual set up in terms of action, color, via, hashtag, count etc. If you know something about javascript, html and css and like to play around you will love it. I just ended up using one of the examples from the page. But it is a nice example.

sharrresharre2

The css is simply added to the main css file of the blog, which means faster loading time of the webpage.


Social-likes

This is by far the easiest to use one does not even need an initialization script. Customisation is difficult, though, the css file is huge and would take more time to work through than I was willing to spent, rain or no rain. I kind of managed to integrate the diaspora button, but it looks a bit clunky.

social-likessocial-likes2social-likes3

PrettySociable
It is pretty and easy to set up. Other than the pictures and background colour, I don't think there is any customisation. I like that it appears as a simple link on the page and thus does not get in the way, unless it is used, but I don't know if it is usable on mobile devices.

prettys1prettys2

It does not work with JQuery 1.9.1, so you would have to open sub.pl in a text editor, go to line 461 and change "1.9.1" to "1.8.3".





Posted on - Categories: how to


sendmail

No comments
Both the contact plugin as well as the standalone contact page rely on sendmail to be installed. I am aware that this might not be the case.

When I first started playing around with servers I spent one weekend trying to install friendica. After several hours of configuring the built in hiawatha server (in puppy) and reading man pages it dawned on me that it lacked several components needed (php for one) to run friendica. My next task was to try and add these, but I quickly abandoned the idea of compiling hiawatha on my system and opted for a lampp installation instead. After more hours of man pages I had it set up and ready and went on to actually installing friendica. I learned how to set up a database on the way, one of the many things I did not get right at first attempt. But by Sunday afternoon I had it up and running and was very proud of myself indeed. I went to set up my profile and had the password sent to me via...sendmail. Which was not installed on my computer. I checked for packages, none existed. I googled looked at documentation and finally gave up. So I shouted out for help at my usual "rescue me from my computer" person.
Bjarni asked the sensible question whether I actually needed to have mail send to me, or just be able to read the content. The latter was the case, so here is an easy way to get around using sendmail:

#!/bin/sh

cat >>/root/Mail/fake-email.txt


save the script under usr/lib/sendmail (make executable) and remember to check /root/Mail for new emails.
It is not pretty, but quick and easy.
Posted on - Categories: how to


pe_pplog v2a released!

No comments
Chachachachachanges!

There have been some major changes behind the scenes of the blog (it still looks pretty much the same and is compatible with posts from the old version of the pe_pplog) which is why I decided to call it version 2.
Mainly:
One can now set the login to only work over a secure (https) connection
there is a plugin system in place and three plugins are available (more will follow).
Style changes include a menu bar and a mobile layout.
Now there are two pets available, one for puppys with the hiawatha web server installed and one for puppys with a lampp installation,
please read this before installing them.
There is also a zip file available for those who do not use puppy, or have a different server set up. See the download link to your right.

Have fun!


Pages: ... [3] [4] [5] [6] [7] [8]