Install Apache 2.4 on NetBSD 7.1.2
Hello everyone,In this short tutorial, we will look at how to install apache 2.4 on a NetBSD 7.1.2 system.
The Apache HTTP Server is an open-source HTTP server for modern operating systems including UNIX and Windows.
This tutorial was written using the following system parameters
Hostname – server.example.com
IP Address – 192.168.234.152/24
Operating System – NetBSD 7.1.2
In this tutorial,we will install apache using the pkgin package manager.For more information on how to setup pkgin on NetBSD 7.1,visit the article on install packages on netbsd 7.1 using pkgin
Step 1 : Setup
We will start by searching for the available versions of apache available on NetBSD by running the command below:
pkgin search apache
Output should be similar to the below
#
pkgin search apache
xerces-j-1.4.4 The Apache Project's validating XML parser with DOM and SAX support xalan-j-1.2 The Apache Project's XSLT implementation wbm-htaccess-htpasswd-1.831 Webmin module to protect Apache web-accessible directories wbm-apache-1.831 Webmin module for configuring Apache servers py36-mod_wsgi-metrics-1.1.1 WSGI module for apache py36-cassandra-driver-3.12.0 DataStax Python Driver for Apache Cassandra py36-apache-libcloud-2.2.1 Python library for interacting with cloud service providers py36-ap24-mod_wsgi-4.5.24 WSGI module for apache py35-mod_wsgi-metrics-1.1.1 WSGI module for apache py35-cassandra-driver-3.12.0 DataStax Python Driver for Apache Cassandra py35-apache-libcloud-2.2.1 Python library for interacting with cloud service providers py35-ap24-mod_wsgi-4.5.24 WSGI module for apache py34-mod_wsgi-metrics-1.1.1 WSGI module for apache py34-cassandra-driver-3.12.0 DataStax Python Driver for Apache Cassandra py34-apache-libcloud-2.2.1 Python library for interacting with cloud service providers py34-ap24-mod_wsgi-4.5.24 WSGI module for apache py27-thrift-0.9.3nb1 Python bindings for the Apache Thrift RPC system py27-mod_wsgi-metrics-1.1.1 WSGI module for apache py27-cassandra-driver-3.12.0 DataStax Python Driver for Apache Cassandra py27-apache-libcloud-2.2.1 Python library for interacting with cloud service providers py27-ap24-mod_wsgi-4.5.24 WSGI module for apache p5-ap24-libapreq2-2.13nb2 Lots of Apache specific httpd handling modules p5-MasonX-Request-WithApacheSession-0.31nb9 Perl5 module adding a session to the Mason Request obj p5-Authen-Htpasswd-0.171nb6 Interface to read and modify Apache .htpasswd files p5-Apache2-AuthCookieDBI-2.17nb4 Perl5 module AuthCookie backed by a DBI database p5-Apache2-AuthCookie-3.27 Perl5 module for Authentication and Authorization via cookies p5-Apache2-AuthCASSimple-0.10nb9 Apache2 module to authenticate through a CAS server p5-Apache-Test-1.40 Wrapper for Test.pm to test an Apache server p5-Apache-Session-Wrapper-0.34nb3 Perl5 module doing a wrapper around Apache::Session p5-Apache-Session-SharedMem-0.6nb4 Apache::Session module that stores session data in shared memory p5-Apache-Session-1.93nb3 Perl5 module to provide persistent storage p5-Apache-SSI-2.19nb9 Perl5 module to implement Server Side Includes p5-Apache-LogFormat-Compiler-0.35 Compile a log format string to perl-code p5-Apache-Filter-1.024nb9 Perl5 module to alter the output of previous Apache handlers p5-Apache-DBILogger-0.93nb11 Database-independent httpd database logging module p5-Apache-DBILogConfig-0.02nb11 Database-independent Apache database logger p5-Apache-DBI-1.12nb3 DBI support for Apache+mod_perl p5-Apache-ASP-2.63 Perl5/Apache module of Perl-coded Active Server Pages nant-0.86beta1nb18 Free .NET build tool similar to Apache Ant librdkafka-0.11.3 Apache Kafka C/C++ library crimson-1.1.3nb1 Apache.org implementation of JAXP, SAX, and DOM apr-util-1.6.1nb1 = Apache Portable Runtime utilities apr-1.6.3 = Apache Portable Runtime apachetop-0.18.4 Real time apache log display apache-tomcat-8.5.29 Implementation of Java Servlet and JavaServer Pages technologies apache-tomcat-8.0.50 Implementation of Java Servlet and JavaServer Pages technologies apache-tomcat-7.0.85 Implementation of Java Servlet and JavaServer Pages technologies apache-tomcat-6.0.45 Implementation of Java Servlet and JavaServer Pages technologies apache-tomcat-5.5.35 The Apache Project's Java Servlet 2.4 and JSP 2.0 server apache-roller-5.1.2 Full-featured, multi-user and group-blog server apache-maven-3.5.0 Apache Project's software project management and comprehension tool apache-ivy-2.2.0 `Apache Project's Java-Based agile dependency manager` apache-cassandra-1.2.19nb1 Highly scalable, distributed structured key-value store apache-ant-1.5.4nb2 `Apache Project's Java-Based make(1) replacement` apache-ant-1.10.2 Apache Project's Java-Based make(1) replacement apache-2.4.33 = Apache HTTP (Web) server, version 2.4 ap24-xsendfile-0.12 Apache 2 module that processes X-SENDFILE headers ap24-subversion-1.9.7nb2 WebDAV server (Apache module) for Subversion ap24-ruby25-passenger-5.2.1 Passenger module for Apache 2.x ap24-ruby24-passenger-5.2.1 Passenger module for Apache 2.x ap24-ruby23-passenger-5.2.1 Passenger module for Apache 2.x ap24-ruby22-passenger-5.2.1 Passenger module for Apache 2.x ap24-py34-python-3.5.0nb1 Apache module that embeds the Python interpreter ap24-py27-python-3.5.0nb1 Apache module that embeds the Python interpreter ap24-php72-7.2.5 = Apache (apache24) module for PHP7.2 ap24-php71-7.1.17 Apache (apache24) module for PHP7.1 ap24-php70-7.0.30 Apache (apache24) module for PHP7.0 ap24-php56-5.6.36 Apache (apache24) module for PHP5.6 ap24-perl-2.0.10nb1 Module that embeds a Perl interpreter into Apache ap24-mono-3.12nb6 Apache module that provides ASP.NET support ap24-limitipconn-0.24nb1 Limits per-IP connections to an Apache 2 server ap24-jk-1.2.37 Apache connector for accessing Jakarta Tomcat ap24-dnssd-0.6nb8 Apache module which adds Zeroconf support via DNS-SD using Avahi ap24-authz-ldap-0.30nb2 Apache LDAP Authorization module ap24-authnz-external-3.3.1 Apache module for external program authentication ap24-authnz-crowd-2.2.2nb12 Apache module for Crowd authentication ap24-auth-kerb-5.4 Module to allow Apache authentication using Kerberos ant-contrib-0.6 Collection of tasks and tools for apache-ant Apache-Gallery-1.0.2 Perl5/Apache module for handling image directories =: package is installed and up-to-date <: package is installed but newer version is available >: installed package has a greater version than available package
step 2: Installation
We will proceed by installing nginx by running the command:
pkgin install apache
This will install the latest version of apache, which from the above command is apache-2.4.33
After Installation is completed,we need to enable the nginx service by running the following commands
cp /usr/pkg/share/examples/rc.d/apache /usr/rc.d/
And then set apache=YES in the /etc/rc.conf file or run the below:
echo “apache=YES” >> /etc/rc.conf
Now start apache by running :
/etc/rc.d/apache start
output should be similar to the below
# /etc/rc.d/apache start Starting apache. AH00557: httpd: apr_sockaddr_info_get() failed for AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
We can confirm apache is running by checking if server is listening on port and http service is running by running the command
sockstat -4 -l | grep http
Output should be be similar to the below:
# sockstat -4 -l | grep http # sockstat -4 -l | grep http www httpd 583 3 tcp *.http *.* root httpd 599 3 tcp *.http *.* www httpd 644 3 tcp *.http *.* www httpd 662 3 tcp *.http *.*
We can check the vaerion of the apache by running the command:
httpd -v
Output should be similar to the following
# httpd -v Server version: Apache/2.4.33 (Unix) Server built: Mar 28 2018 00:54:43
The configuation files are located in the /usr/pkg/etc/httpd directory and the default Document Root is /usr/pkg/share/httpd/htdocs.In part 2 of this article,we will look at how we can install php on NetBsd 7.1.2
step 3 : Testing
Open a web browser and type the URL in the format http://IP .In this tutorial our system is configured with IP – 192.168.234.152/24.Output should should be similar to the below.
Congratulation, server is running Apache 2.4
References:
https://www.netbsd.org/
https://httpd.apache.org/