--- /dev/null
+user: nobody
+hosts:
+ "localhost:443":
+ listen:
+ port: 443
+ host: 0.0.0.0
+ ssl:
+ certificate-file: "/etc/pki/tls/certs/localhost.crt"
+ key-file: "/etc/pki/tls/private/localhost.key"
+ paths:
+ "/":
+ file.dir: /var/www/html
+ "localhost:80":
+ listen:
+ port: 80
+ host: 0.0.0.0
+ paths:
+ "/":
+ file.dir: /var/www/html
+access-log: /var/log/h2o/access.log
+error-log: /var/log/h2o/error.log
+pid-file: /var/run/h2o/h2o.pid
--- /dev/null
+#!/bin/bash
+#
+# chkconfig: - 85 15
+# description: H2O - the optimized HTTP/1, HTTP/2 server
+# processname: h2o
+# config: /etc/h2o/h2o.conf
+# pidfile: /var/run/h2o/h2o.pid
+
+### BEGIN INIT INFO
+# Provides: h2o
+# Required-Start: $local_fs $remote_fs $network $named
+# Required-Stop: $local_fs $remote_fs $network
+# Should-Start: distcache
+# Short-Description: start and stop h2o HTTP Server
+# Description: H2O - the optimized HTTP/1, HTTP/2 server
+### END INIT INFO
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+if [ -f /etc/sysconfig/h2o ]; then
+ . /etc/sysconfig/h2o
+fi
+
+# Path to the server binary, and short-form for messages.
+h2o=/usr/sbin/h2o
+prog=h2o
+configfile=/etc/h2o/h2o.conf
+lockfile=${LOCKFILE-/var/lock/subsys/h2o}
+RETVAL=0
+options="-m daemon -c $configfile"
+
+pidfile=`sed -ne 's|pid-file:\s*\([-_./0-9a-zA-Z]\{1,\}\)|\1|p' $configfile`
+if [ -z "$pidfile" ]; then
+ echo $"pid-file must be defined in $configfile"
+ exit 1
+fi
+
+start() {
+ echo -n $"Starting $prog: "
+ daemon --pidfile=${pidfile} $h2o $options
+ RETVAL=$?
+ echo
+ [ $RETVAL = 0 ] && touch ${lockfile}
+ return $RETVAL
+}
+
+stop() {
+ echo -n $"Stopping $prog: "
+ killproc -p ${pidfile} $h2o -TERM
+ RETVAL=$?
+ echo
+ [ $RETVAL = 0 ] && rm -f ${lockfile}
+}
+
+reload() {
+ echo -n $"Reloading $prog: "
+ if ! $h2o -t -c ${configfile} >&/dev/null; then
+ RETVAL=6
+ echo $"not reloading due to configuration syntax error"
+ failure $"not reloading $h2o due to configuration syntax error"
+ else
+ # Force LSB behaviour from killproc
+ LSB=1 killproc -p ${pidfile} $h2o -HUP
+ RETVAL=$?
+ if [ $RETVAL -eq 7 ]; then
+ failure $"h2o shutdown"
+ fi
+ fi
+ echo
+}
+
+configtest() {
+ $h2o -t -c ${configfile}
+}
+
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ status)
+ status -p ${pidfile} $h2o
+ RETVAL=$?
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ condrestart|try-restart)
+ if status -p ${pidfile} $h2o >&/dev/null; then
+ stop
+ start
+ fi
+ ;;
+ force-reload|reload)
+ reload
+ ;;
+ configtest)
+ configtest
+ RETVAL=$?
+ ;;
+ *)
+ echo $"Usage: $prog {start|stop|restart|condrestart|try-restart|force-reload|reload|status|configtest}"
+ RETVAL=2
+esac
+
+exit $RETVAL
--- /dev/null
+/var/log/h2o/error.log {
+ missingok
+ notifempty
+ delaycompress
+ copytruncate
+}
+
+/var/log/h2o/access.log {
+ missingok
+ notifempty
+ sharedscripts
+ delaycompress
+ postrotate
+ /bin/systemctl reload h2o.service > /dev/null 2>/dev/null || true
+ endscript
+}
--- /dev/null
+[Unit]
+Description=H2O - the optimized HTTP/1, HTTP/2 server
+After=network.target remote-fs.target nss-lookup.target
+
+[Service]
+Type=simple
+ExecStart=/usr/sbin/h2o -m master -c /etc/h2o/h2o.conf
+ExecReload=/bin/kill -HUP ${MAINPID}
+ExecStop=/bin/kill -TERM ${MAINPID}
+PrivateTmp=true
+LimitNOFILE=infinity
+
+[Install]
+WantedBy=multi-user.target
Summary: H2O - an optimized HTTP server with support for HTTP/1.x and HTTP/2
Name: h2o
Version: 2.2.2
-Release: 0.1
+Release: 0.2
License: MIT
Group: Networking/Daemons/HTTP
Source0: https://github.com/h2o/h2o/archive/v%{version}/%{name}-%{version}.tar.gz
# Source0-md5: efc3a98cd21d3b91d66b2a99b1518255
+Source1: index.html
+Source2: %{name}.logrotate
+Source3: %{name}.init
+Source4: %{name}.service
+Source5: %{name}.conf
Patch0: system-ca.patch
URL: https://h2o.examp1e.net/
BuildRequires: cmake >= 2.8.11
%{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
+install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},/etc/{rc.d/init.d,logrotate.d},%{systemdunitdir},%{systemdtmpfilesdir},%{_localstatedir}/{log,run}/h2o}
+
+cp -p %{_sourcedir}/h2o.conf $RPM_BUILD_ROOT%{_sysconfdir}/h2o/h2o.conf
+cp -p %{_sourcedir}/h2o.service $RPM_BUILD_ROOT%{systemdunitdir}/h2o.service
+cp -p %{_sourcedir}/h2o.tmpfiles $RPM_BUILD_ROOT%{systemdtmpfilesdir}/h2o.conf
+install -p %{_sourcedir}/h2o.init $RPM_BUILD_ROOT/etc/rc.d/init.d/h2o
+cp -p %{_sourcedir}/h2o.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/h2o
+
%clean
rm -rf $RPM_BUILD_ROOT
+%post
+/sbin/chkconfig --add %{name}
+%service %{name} restart
+%systemd_post %{name}.service
+
+%preun
+if [ "$1" = "0" ]; then
+ %service -q %{name} stop
+ /sbin/chkconfig --del %{name}
+fi
+%systemd_preun %{name}.service
+
+%postun
+%systemd_reload
+
%post -n libh2o -p /sbin/ldconfig
%postun -n libh2o -p /sbin/ldconfig
%defattr(644,root,root,755)
%doc README.md Changes LICENSE
%attr(755,root,root) %{_sbindir}/h2o
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/h2o.conf
+%config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/h2o
+%attr(754,root,root) /etc/rc.d/init.d/h2o
+%{systemdunitdir}/h2o.service
+%{systemdtmpfilesdir}/h2o.conf
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/status
%attr(755,root,root) %{_datadir}/%{name}/annotate-backtrace-symbols
--- /dev/null
+#Type Path Mode UID GID Age Argument
+d /var/run/h2o 770 root nobody - -
--- /dev/null
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Welcome to H2O</title>
+ </head>
+ <body>
+ <p>Welcome to H2O - an optimized HTTP server</p>
+ <p>It works!</p>
+ </body>
+</html>