Strona główna / Społeczność / Blog

I had a case:

  • Have a service in home local network.
  • I would like to access this service from outside.
  • I don't have routed IP in home.
  • I have VPS with public IP, but I can't run OpenVPN on it.

As workaround you can use SSH tunnel with remote port forwarding.

In my example service is running on machine 192.168.3.28:8080 and I want to have access on port 8090.

First of all you have to add to your /etc/ssh/sshd_config file:

On my router (it doesn't matter, but it has address 192.168.3.3) I've run command:

This command create a tunnel between server (jaqb.gda.pl) on port 8090 through my router (192.168.3.3) to port 8080 on host 192.168.3.28 in home network.

Now I can access it from anywhere.

In fact, my (great!) VPS provider allow me to run OpenVPN in less than 10 minutes so it wasn't necessary.

You can use Let's encrypt certificates to secure communication with your e-mail server.

After you generate certificate for your mail server:

they have to be copied to new location because Postfix/CyrusIMAP cannot read them, the /etc/letsencrypt/live directory can be read only by root.

The solution is simple. I've copied them into /etc/postfix directory and change group to mail:

I've added this commands to /etc/cron.monthly/letsencrypt-auto.bash file (from my last post).

Of course you have to set that appropriate options, at least in /etc/postfix/main.cf:

and in /etc/imapd.conf:

After restart:

everything should work. Good luck!

If you want to create a certificate you should download certbot-auto and install them in your system:

Then you can request your first (test) certificate:

If you want to recreate certificate after tests you have to delete them, and then create again (without --test-cert option)

Of course you can obtain more than one certificate:

All certificates are stored in /etc/letsencrypt/live directory.

The certificates are valid only for 3 months, but don't worry everything can be automated - I've added to cron (/etc/cron.monthly/letsencrypt-auto.bash):

I hope it will work... ;-)

To get images placed on map based on GPS tags in Piwigo (2.9) I had to install and enable "Exiftool GPS" plugin and install exiftools.

I've downloaded it and unpack in /tmp directory:

Prepare directory and copy files

Prepare symbolic links

and now it works:

Today I've run Domoticz on my NAS (ReadyNAS OS 6 running on Ultra 4). Installation is very simple (in contrast to run on CentOS 7). I've downloaded domoticz from their site:

Extracted files:

Created file /lib/systemd/system/domoticz.service:

and register service to start automatically :

and that's all. Now you can check if it's work: http://192.168.1.1:8080/ - of course you have to change IP address.

First installation. It's simple

Turn on automatic start:

Check:

Add

in main.cf file as last element smtpd_recipient_restrictions option:

Now it looks like this:

Restart postfix. Done.

You can check in maillog if it works:

If you want be able to download all attachments at once you have to explicitly enable zipdownload plugin in config.inc.php file:

so simple...

If you would like to use F*EX, but you have only one IP and you can't/don't want to use different port there is a solution!

The Morten Minde Neergaard method almost work. In my case I've prepared file (let's say fex.conf) in /etc/httpd/conf.d/:

and setup F*EX (/etc/xinetd.d/fex):

note I've changed also the port F*EX listen on.

The only thing I had to change in F*EX source code was one line added in lib/fex.pp file:

to fix links to files sent by F*EX to point to port 80 instead of 88. Without this little change links looks like this:

I don't know if there is other method not to sent F*EX port to clients or maybe there are some changes in newest version. I've tested it on, quite old, 20130805 release.

If you want to use Submin, or any other web application that resides outside default Apache directory (/var/www/html) you have to set proper SELinux context for all files. In this case all files are located in /var/lib/submin directory. Without this you will get some error messages in /var/log/audit/audit.log:

and in /var/log/messages:

You should change context of /var/lib/submin/cgi-bin/submin.cgi to httpd_sys_script_exec_t and whole /var/lib/submin/conf/ directory to httpd_sys_script_rw_t:

additionally if You want Submin to work with Apache on different port (ie. 88), you have to change http_vhost options:

note there is no tailing slash (/) in address.

Ten kto umie pisze kod, ten kto nie umie pisze książki..., albo blog.

Pon Wt Śr Czw Pt So N
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30