DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Packages and Ports

OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 18th April 2015
morophla morophla is offline
Port Guard
 
Join Date: Apr 2015
Posts: 11
Default Running Apache

After trying to chroot native httpd, I decided to move back to Apache 2.

But I can't start it. Is it blocked on OpenBSD 5.6?

Is there any trick to start Apache2 on OpenBSD 5.6?

Also, in rc.conf there's only a httpd_flags associated to hhtpd so I presume we cannot start Apache2 at boot?

Thanks...
Reply With Quote
  #2   (View Single Post)  
Old 18th April 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,934
Default

Hello, and welcome.

Apache 2 is not a built-in application. Instead, it is available as a 3rd party package, installable via pkg_add(1). The name of the package is apache-httpd. This was used to differentiate it, historically, from OpenBSD's fork of Apache 1.3 that used to be a built-in application. OpenBSD's Apache 1.3 is still available, as a package: apache-httpd-openbsd.

If you're unfamiliar with pkg_add(1) and OpenBSD's other third party package management tools, please refer to FAQ 15.

Last edited by jggimi; 18th April 2015 at 11:54 PM. Reason: clarity
Reply With Quote
  #3   (View Single Post)  
Old 19th April 2015
morophla morophla is offline
Port Guard
 
Join Date: Apr 2015
Posts: 11
Default

I know perfectly how to add a package... Apache 2 is properly installed on the system. It just don't start nor with sudo apachectl2 start neither with sudo httpd2 -k start.
I get absolutely no error message, the syntax of the conf file is ok. No httpd2 process runs after those commands.
Reply With Quote
  #4   (View Single Post)  
Old 19th April 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,934
Default

Quote:
Originally Posted by morophla View Post
I know perfectly how to add a package...
That was not clear from your initial post.

The pkg_info(1) tool has a handy -L option. The output will show what is installed, or, as shown in my example below, the output is from an inspection of an uninstalled package located at $PKG_PATH.

The executable programs installed with Apache 2 are highlighted, and the start/stop script for use in rc.conf.local(5) is highlighted in red.
Code:
$ pkg_info -L apache-httpd

Information for http://mirrors.gigenet.com/pub/OpenBSD/snapshots/packages/i386/apache-httpd-2.2.29p3.tgz

Files:
/usr/local/include/apache2/ap_compat.h
/usr/local/include/apache2/ap_config.h
/usr/local/include/apache2/ap_config_auto.h
.
.
.
[snip]
.
.
.
/usr/local/sbin/ab
/usr/local/sbin/apachectl2
/usr/local/sbin/apxs2
/usr/local/sbin/checkgid
/usr/local/sbin/dbmmanage2
/usr/local/sbin/envvars
/usr/local/sbin/envvars-std
/usr/local/sbin/htcacheclean
/usr/local/sbin/htdbm
/usr/local/sbin/htdigest2
/usr/local/sbin/htpasswd2
/usr/local/sbin/httpd2
/usr/local/sbin/httxt2dbm
/usr/local/sbin/logresolve2
/usr/local/sbin/rotatelogs2
/usr/local/sbin/suexec2
.
.
.
[snip]
.
.
.
/usr/local/share/examples/apache2/icons/world2.gif
/usr/local/share/examples/apache2/icons/world2.png
/etc/rc.d/apache2

Last edited by jggimi; 19th April 2015 at 03:15 AM. Reason: rc.conf.local man page link manually corrected
Reply With Quote
  #5   (View Single Post)  
Old 19th April 2015
morophla morophla is offline
Port Guard
 
Join Date: Apr 2015
Posts: 11
Default

I did the pkg_info output before to be sure all was properly installed. All is ok.
The problem is I can't start Apache2 in any way.
There's two methods I know for starting Apache2

sudo apachectl2 start

and

sudo httpd2 -k start

when I type those commands, absolutely no errors are displayed but the process doesn't start.

Also the /etc/rc.d/apache2 in /etc/rc.conf/local doesn't start Apache2 neither on startup.

I guess there is a tweak to start Apache2 on Openbsd.
Reply With Quote
  #6   (View Single Post)  
Old 19th April 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,934
Default

I'm going to guess that your Apache 2 installation starts, then stops, as it needs provisioning -- such as revisions to /etc/apache2/httpd2.conf.

I put 5.6-release on a USB stick, booted it, installed Apache 2, and ran it without making any provisioning changes. Here were my results:
Code:
# /etc/rc.d/apache2 -df start
doing _rc_parse_conf
doing _rc_quirks
    accounting    >NO<
     amd_flags    >NO<
    amd_master    >/etc/amd/master<
    apmd_flags    >NO<
    bgpd_flags    >NO<
  bootparamd_flags    >NO<
      check_quotas    >YES<
    cron_flags    ><
       dhcpd_flags    >NO<
    dhcrelay_flags    >NO<
      dvmrpd_flags    >NO<
    ftpd_flags    >NO<
    ftpproxy_flags    >NO<
     hostapd_flags    >NO<
    hotplugd_flags    >NO<
       httpd_flags    >NO<
      identd_flags    >NO<
    ifstated_flags    >NO<
    iked_flags    >NO<
       inetd_flags    >NO<
         ipsec    >NO<
       ipsec_rules    >/etc/ipsec.conf<
     isakmpd_flags    >NO<
      iscsid_flags    >NO<
       ldapd_flags    >NO<
    ldattach_flags    >NO<
       ldomd_flags    >NO<
    ldpd_flags    >NO<
       lockd_flags    >NO<
     lpd_flags    >NO<
    mopd_flags    >NO<
      mountd_flags    >NO<
     mrouted_flags    >NO<
    multicast_host    >NO<
  multicast_router    >NO<
       named_flags    >NO<
    nfsd_flags    >NO<
       nginx_flags    >NO<
       npppd_flags    >NO<
     nsd_flags    >NO<
    ntpd_flags    >NO<
      ospf6d_flags    >NO<
       ospfd_flags    >NO<
        pf    >YES<
      pf_rules    >/etc/pf.conf<
      pflogd_flags    ><
       pkg_scripts    ><
     portmap_flags    >NO<
       rarpd_flags    >NO<
      rbootd_flags    >NO<
      relayd_flags    >NO<
    ripd_flags    >NO<
     route6d_flags    >NO<
      rtadvd_flags    >NO<
      rtsold_flags    >NO<
     sasyncd_flags    >NO<
    savecore_flags    ><
    sendmail_flags    >NO<
    sensorsd_flags    >NO<
    shlib_dirs    ><
     slowcgi_flags    >NO<
       smtpd_flags    ><
      sndiod_flags    ><
       snmpd_flags    >NO<
       spamd_black    >NO<
       spamd_flags    >NO<
    spamlogd_flags    >NO<
    sshd_flags    ><
       statd_flags    >NO<
     syslogd_flags    ><
       tftpd_flags    >NO<
   tftpproxy_flags    >NO<
     unbound_flags    >NO<
   watchdogd_flags    >NO<
    wsmoused_flags    >NO<
     xdm_flags    >NO<
      ypbind_flags    >NO<
      ypldap_flags    >NO<
   yppasswdd_flags    >NO<
      ypserv_flags    >NO<
doing _rc_read_runfile
doing rc_check
apache2
doing rc_pre
doing rc_start
httpd2: apr_sockaddr_info_get() failed for foo.jggimi.homeip.net
httpd2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
doing _rc_rm_runfile
(failed)
#
Reply With Quote
  #7   (View Single Post)  
Old 19th April 2015
morophla morophla is offline
Port Guard
 
Join Date: Apr 2015
Posts: 11
Default

Here's my output:

doing _rc_read_runfile
doing rc_check
apache2
doing rc_pre
doing rc_start
doing _rc_rm_runfile
(failed)


In your example I guess the server doesn't start because it can't find a fully qualified domain name.

But in my case absolutely no error message appears!

How can find what's going wrong?
Reply With Quote
  #8   (View Single Post)  
Old 19th April 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,934
Default

I found these options in the httpd2(8) man page.
Code:
       -e     Sets the LogLevel to level during server startup. This is useful
              for temporarily increasing the verbosity of the error messages
              to find problems during startup.

       -X     Run httpd2 in debug mode. Only one worker will be started and
              the server will not detach from the console.
Reply With Quote
  #9   (View Single Post)  
Old 19th April 2015
morophla morophla is offline
Port Guard
 
Join Date: Apr 2015
Posts: 11
Default

Ok, problem solved.

It was a line missing in the /etc/hosts file. Lacks the IPV4 adress associated with my machine domain name.

Now it works perfectly!

Thank you for your kind help and for the time you spent answering!!
Reply With Quote
Old 19th April 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,934
Default

Glad you got it working!

(I've never used Apache 2. Currently my webservers are either nginx or httpd, depending on the application.)
Reply With Quote
Reply

Tags
apache2 httpd2

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting OpenBSD up and running Larry OpenBSD Installation and Upgrading 10 14th May 2010 11:14 PM
Upgrade Apache 1.3 mod_ssl to Apache 2.2 beandip FreeBSD Ports and Packages 11 26th March 2009 09:12 PM
Running your own web server JMJ_coder General software and network 28 13th February 2009 01:15 AM
can't start apache "httpd not running" disappearedng FreeBSD General 5 22nd September 2008 10:18 PM
Problems running jdk-1.7 incripshin OpenBSD Packages and Ports 10 10th August 2008 05:54 PM


All times are GMT. The time now is 07:41 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick