Posts

Showing posts with the label Apache

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...

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...