Posts

Showing posts from December, 2017

FreeBSD: Configuring Apache to permit CGI

In httpd.conf file make sure the "cgi" LoadModule directive has not been commented out. A correctly configured directive may look like this: <IfModule mpm_prefork_module> LoadModule cgi_module libexec/apache24/mod_cgi.so </IfModule> Explicitly using Options to permit CGI execution To allow CGI program execution for any file ending in .cgi in users' directories, you can use the following configuration. <VirtualHost *:80> DocumentRoot "/usr/local/www/apache24/e" ServerName www.example.com ErrorLog "/var/log/e-error_log" CustomLog "/var/log/e-access_log" common <Directory "/usr/local/www/apache24/e/"> Order allow,deny Allow from all Require all granted Options +ExecCGI AddHandler cgi-script .cgi </Directory> </VirtualHost> <Directory "/home/*/public_html"> Options +ExecCGI AddHandler cgi-script .cgi </Di...

Installing Apache2.4, PHP7.1 on FreeBSD

1.Install and configure Apache 2.4 Let's install Apache 2.4 first. please refer to this link . 2.Install and configure PHP 7.1 $ sudo pkg install mod_php71 Updating FreeBSD repository catalogue... FreeBSD repository is up to date. All repositories are up to date. The following 1 package(s) will be affected (of 0 checked): New packages to be INSTALLED: mod_php71: 7.1.12 Number of packages to be installed: 1 The process will require 4 MiB more space. 1 MiB to be downloaded. Proceed with this action? [y/N]: y [1/1] Fetching mod_php71-7.1.12.txz: 100% 1 MiB 1.2MB/s 00:01 Checking integrity... done (0 conflicting) [1/1] Installing mod_php71-7.1.12... Extracting mod_php71-7.1.12: 100% [activating module `php7' in /usr/local/etc/apache24/httpd.conf] Message from mod_php71-7.1.12: *************************************************************** Make sure index.php is part of your DirectoryIndex. You should add the following to your Apache configuration file: ...

Configuring Apache to Proxy Tomcat Using the AJP Protocol.

Step 1. Configure Tomcat Comment out the normal connector above, and uncomment the AJP connector: Adjust the port if you wish and add in the URIEncoding="UTF-8" attribute. <!-- <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> --> <!-- Define an AJP 1.3 Connector on port 8009 --> <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> Step 2. Configure Apache Open httpd.conf and scroll to the large LoadModule section. Ensure you have the following uncommented #LoadModule proxy_module libexec/apache24/mod_proxy.so #LoadModule proxy_ajp_module libexec/apache24/mod_proxy_ajp.so In my httpd.conf, right at the bottom there is a line: Include etc/apache24/Includes/*.conf Create an ajp.conf file. You could put the configuration for AJP in the main httpd.conf file but I prefer t...

Install Tomcat8.5 on FreeBSD

Perform this command to install Tomcat8.5 $ sudo pkg install tomcat85 Updating FreeBSD repository catalogue... FreeBSD repository is up to date. All repositories are up to date. The following 2 package(s) will be affected (of 0 checked): New packages to be INSTALLED: tomcat85: 8.5.23 jakarta-commons-daemon: 1.0.15 Number of packages to be installed: 2 The process will require 13 MiB more space. 9 MiB to be downloaded. Proceed with this action? [y/N]: y [1/2] Fetching tomcat85-8.5.23.txz: 100% 9 MiB 9.0MB/s 00:01 [2/2] Fetching jakarta-commons-daemon-1.0.15.txz: 100% 89 KiB 91.5kB/s 00:01 Checking integrity... done (0 conflicting) [1/2] Installing jakarta-commons-daemon-1.0.15... [1/2] Extracting jakarta-commons-daemon-1.0.15: 100% [2/2] Installing tomcat85-8.5.23... Extracting tomcat85-8.5.23: 100% add tomcat85_enable=YES to /etc/rc.conf file. $ sudo sysrc tomcat85_enable=YES tomcat85_enable: -> YES start tomcat8.5 $ sudo service tomcat85 s...

How To Install JDK on FreeBSD

To install OpenJDK® 8 package use the pkg utility: $ sudo pkg install openjdk8 Updating FreeBSD repository catalogue... FreeBSD repository is up to date. All repositories are up to date. The following 31 package(s) will be affected (of 0 checked): New packages to be INSTALLED: openjdk8: 8.144.1 libXtst: 1.2.3 recordproto: 1.14.2 libXi: 1.7.9,1 xproto: 7.0.31 libXfixes: 5.0.3 libX11: 1.6.5,1 libxcb: 1.12_2 libXdmcp: 1.1.2 libXau: 1.0.8_3 libpthread-stubs: 0.4 kbproto: 1.0.7 fixesproto: 5.0 libXext: 1.3.3_1,1 xextproto: 7.3.0 inputproto: 2.3.2 libXrender: 0.9.10 renderproto: 0.11.1 libXt: 1.1.5,1 libSM: 1.2.2_3,1 libICE: 1.0.9_1,1 fontconfig: 2.12.1,1 freetype2: 2.8 dejavu: 2.37 mkfontscale: 1.1.2 libfontenc: 1.1.3_1 mkfontdir: 1.0.7 javavmwrapper: 2.5_2 ja...

Apache24 SSL(HTTPS) Basic Configuration and Force HTTPS connections

step 1. Edit config file '/usr/local/etc/apache24/httpd.conf' remove the # sign before these lines. #LoadModule socache_shmcb_module libexec/apache24/mod_socache_shmcb.so #LoadModule ssl_module libexec/apache24/mod_ssl.so #Include etc/apache24/extra/httpd-ssl.conf In Apache2.2 [mod_socache_shmcb] is uncommented in httpd.conf by default.From Apache 2.4 [mod_socache_shmcb] is commented step 2. edit /usr/local/etc/apache24/extra/httpd-ssl.conf file. Modify these lines and configure the appropriate settings. ServerName www.example.com:443 [optional] ServerAdmin you@example.com [optional] SSLCertificateFile "/usr/local/etc/apache24/server.crt" SSLCertificateKeyFile "/usr/local/etc/apache24/server.key" >>> ServerName domain_or_ip:443 ServerAdmin master@mail_server SSLCertificateFile "path/fullchain.pem" SSLCertificateKeyFile "path/privkey.pem" step 3. Force HTTPS connections 3 solutions. Redirect Request to SSL. Usi...

Installing Apache24 on FreeBSD.

Step 1. Perform an update on your system. freebsd-update fetch freebsd-update install Step 2. Install and configure Apache24. $ sudo pkg install apache24 Updating FreeBSD repository catalogue... FreeBSD repository is up to date. All repositories are up to date. The following 6 package(s) will be affected (of 0 checked): New packages to be INSTALLED: apache24: 2.4.27_1 expat: 2.2.1 pcre: 8.40_1 apr: 1.6.2.1.6.0 gdbm: 1.13_1 db5: 5.3.28_6 Number of packages to be installed: 6 The process will require 83 MiB more space. 19 MiB to be downloaded. Proceed with this action? [y/N]: y [1/6] Fetching apache24-2.4.27_1.txz: 100% 5 MiB 5.1MB/s 00:01 [2/6] Fetching expat-2.2.1.txz: 100% 111 KiB 113.2kB/s 00:01 [3/6] Fetching pcre-8.40_1.txz: 100% 1 MiB 1.2MB/s 00:01 [4/6] Fetching apr-1.6.2.1.6.0.txz: 100% 453 KiB 464.0kB/s 00:01 [5/6] Fetching gdbm-1.13_1.txz: 100% 151 KiB 155.0kB/s 00:01 [6/6] Fetching db5-5.3.28...

How do I configure Dynamic DNS Client on FreeBSD.

In First, Confirm your Domain's Nameserver has been modified. NS1.AFRAID.ORG NS2.AFRAID.ORG NS3.AFRAID.ORG NS4.AFRAID.ORG step 1. Install ddClient from ports. $ sudo pkg install ddclient Updating FreeBSD repository catalogue... FreeBSD repository is up to date. All repositories are up to date. The following 4 package(s) will be affected (of 0 checked): New packages to be INSTALLED: ddclient: 3.8.3_3 p5-IO-Socket-SSL: 2.051 p5-Mozilla-CA: 20160104 p5-Net-SSLeay: 1.81 Number of packages to be installed: 4 The process will require 2 MiB more space. 590 KiB to be downloaded. Proceed with this action? [y/N]: y [1/4] Fetching ddclient-3.8.3_3.txz: 100% 43 KiB 44.5kB/s 00:01 [2/4] Fetching p5-IO-Socket-SSL-2.051.txz: 100% 158 KiB 162.1kB/s 00:01 [3/4] Fetching p5-Mozilla-CA-20160104.txz: 100% 147 KiB 150.0kB/s 00:01 [4/4] Fetching p5-Net-SSLeay-1.81.txz: 100% 242 KiB 247.4kB/s 00:01 Checking integrity... done (0 conflicting) [1...

NAP,DZM,UPnP How to do Port- Forwarding (Open a Port) in your Router.

1.NAP Network address translation (NAT) is a method of remapping one IP address space into another by modifying network address information in Internet Protocol (IP) datagram packet headers while they are in transit across a traffic routing device.[1] The technique was originally used for ease of rerouting traffic in IP networks without readdressing every host. In more advanced NAT implementations featuring IP masquerading, it has become a popular and essential tool in conserving global address space allocations in face of IPv4 address exhaustion by sharing one Internet-routable IP address of a NAT gateway for an entire private network. 2.DMZ n computer security, a DMZ or demilitarized zone (sometimes referred to as a perimeter network) is a physical or logical subnetwork that contains and exposes an organization's external-facing services to an untrusted network, usually a larger network such as the Internet. The purpose of a DMZ is to add an additional layer of security to an...

What does '>/dev/null 2>&1' mean in SHELL?

'>' is for redirection '/dev/null' is a black hole where any data sent, will be discarded '2' is the file descriptor for Standard Error '&' is the symbol for file descriptor (without it, the following 1 would be considered a filename) '1' is the file descriptor for Standard Out $ cat foo.txt foo bar baz redirection is the mechanism used to send the output of a command to another place. Here, for example, we are redirecting it to a file called out.txt: $ cat foo.txt > out.txt we could rewrite the command like this: $ cat foo.txt 1> out.txt we don’t see any output in the screen. We changed the standard output (stdout) location to a file. $ cat out.txt foo bar baz if we try to cat a file that doesn’t exist, like this: $ cat nop.txt > out.txt cat: nop.txt: No such file or directory we see the error output in the screen, because we are redirecting just the standard output, not the standard error. Using std...