Showing posts with label configuration. Show all posts
Showing posts with label configuration. Show all posts

Saturday, November 26, 2016

Understanding how tftpd put works - Error code 2: Access violation

Trying to install a tftp server onto Debian? Yet, not succeeding in uploading files onto the tftp server? Getting the following error?  Error code 2: Access violation

You are likely running into the following "feature" (issue) that is being described in the tftpd documentation.

The use of tftp(1) does not require an account or password on the remote system.  Due to the lack of authentication information, tftpd will allow only publicly readable files to be accessed.  Files may be written  only if they already exist and are publicly writable.  Note that this extends the concept of “public” to include all users on all hosts that can be reached through the network;

To fix this, before putting any new file in your /tftpboot directory it has to:
  1. exist 
  2. be world writable and optionally be owned by nobody
Note: Certain tftp servers for Windows do allow the direct put of a file, even if it does not exist. I did not found any that do that under Linux.

Tip from: http://myhomelab.blogspot.be/2013/09/installing-tftp-server-in-linux.html

Sunday, November 20, 2016

Enable HTTPS for EmonCMS on Raspbian

Our EmonCMS installation at home currently runs only over HTTP, which is not secure at all. Enabling HTTPS is a must do. However, there's a small tweak needed for it to work at the AllowOverride option.
Tip: If you run into the issue where you have HTTPS enabled, but the logging in returns always the login screen with message 'undefined', follow the fix explained below.

Check if HTTPS is already enabled for your Apache installation:

root@raspi1:~# netstat -an | grep LISTEN
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
As you can see, there is nothing running on port 443 (HTTPS) yet, so we'll need to enable the HTTPS configuration for Apache.

Enable the default HTTPS (SSL) configuration for Apache:

1. Check if the SSL module is already enabled for Apache.
root@raspi1:~# ls -l /etc/apache2/mods-enabled/*ssl*
root@raspi1:~#

If nothing is returned, the module is not enabled yet and needs to be linked from /etc/apache2/mods-available/

2. Make a symbolic link for the SSL module.
root@raspi1:~# cd /etc/apache2/mods-enabled/
root@raspi1:~# ln -s ../mods-available/ssl.conf ssl.conf
root@raspi1:~# ln -s ../mods-available/ssl.load ssl.load

3. Make a symbolic link for the SSL config file.
root@raspi1:~# cd /etc/apache2/sites-enabled/
root@raspi1:~# ln -s ../sites-available/default-ssl 000-default-ssl

4. Change two lines in the config file.
        DocumentRoot /var/www
        <Directory />
                Options FollowSymLinks
                #Changed None to All on 18/11/2016
                AllowOverride All
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                #Changed None to All on 18/11/2016
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>

5. Restart your Apache now.
root@raspi1:~# /etc/init.d/apache2 restart

This tip came from here.