Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 1 commit
  • 5 files changed
  • 0 commit comments
  • 1 contributor
View
193 SFEyaws.spec
@@ -0,0 +1,193 @@
+#
+# spec file for package: SFEyaws
+#
+# This file and all modifications and additions to the pristine
+# package are under the same license as the package itself.
+#
+# includes module(s):
+#
+
+%include Solaris.inc
+%include base.inc
+
+Name: SFEyaws
+Version: 1.90
+Summary: Yet Another Web Server
+License: BSD
+Url: http://yaws.hyber.org/
+SUNW_Basedir: /
+SUNW_Copyright: %{name}.copyright
+
+Source0: http://yaws.hyber.org/download/%{sname}-%{version}.tar.gz
+Source1: http-yaws.xml
+Source2: http-yaws
+Patch0: yaws-01-revproxy-fix.diff
+
+%include default-depend.inc
+BuildRequires: SFEerlang
+Requires: SFEerlang
+
+Meta(info.maintainer): James Lee <jlee@thestaticvoid.com>
+Meta(info.upstream): Claes Wikström <klacke@hyber.org>
+Meta(info.upstream_url): http://yaws.hyber.org/
+Meta(info.classification): org.opensolaris.category.2008:System/Services
+
+%description
+Yaws is a HTTP high perfomance 1.1 webserver particularly well suited for
+dynamic-content webapplications. Yaws is entirely written in Erlang
+furthermore it is a multithreaded webserver where one Erlang light weight
+process is used to handle each client.
+
+%prep
+%setup -q -n %{sname}-%{version}
+%patch0 -p1
+
+%build
+ERL=%{_bindir}/%{base_isa}/erl ./configure --prefix=%{_prefix} --sysconfdir=%{_sysconfdir} --localstatedir=%{_localstatedir}
+make
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make DESTDIR=$RPM_BUILD_ROOT install
+mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/svc/manifest/network
+cp %{SOURCE1} $RPM_BUILD_ROOT%{_localstatedir}/svc/manifest/network/http-yaws.xml
+mkdir -p $RPM_BUILD_ROOT/lib/svc/method
+cp %{SOURCE2} $RPM_BUILD_ROOT/lib/svc/method/http-yaws
+
+rm -f $RPM_BUILD_ROOT%{_sysconfdir}/yaws/yaws-cert.pem
+rm -f $RPM_BUILD_ROOT%{_sysconfdir}/yaws/yaws-key.pem
+rm -f $RPM_BUILD_ROOT%{_libdir}/yaws/ebin/.empty
+rm -rf $RPM_BUILD_ROOT%{_prefix}/etc
+
+# remove example vhost configuration and replace
+# autogenerated vhost containing the build hostname with "localhost"
+sed '/<server localhost>/,//d; s/<server .*>/<server localhost>/; s@/usr/var/log/yaws@/var/log/yaws@' $RPM_BUILD_ROOT%{_sysconfdir}/yaws/yaws.conf > $RPM_BUILD_ROOT%{_sysconfdir}/yaws/yaws.conf.new
+mv -f $RPM_BUILD_ROOT%{_sysconfdir}/yaws/yaws.conf.new $RPM_BUILD_ROOT%{_sysconfdir}/yaws/yaws.conf
+
+# move epam to correct directory
+mv -f $RPM_BUILD_ROOT%{_libdir}/yaws/priv/lib/epam $RPM_BUILD_ROOT%{_libdir}/yaws/priv/
+
+# set pipe dir to /tmp because /var/run is only writable by root
+sed 's@PIPE_DIR=.*@PIPE_DIR="/tmp/yaws/pipe/$1"@' $RPM_BUILD_ROOT%{_bindir}/yaws > $RPM_BUILD_ROOT%{_bindir}/yaws.new
+mv -f $RPM_BUILD_ROOT%{_bindir}/yaws.new $RPM_BUILD_ROOT%{_bindir}/yaws
+chmod +x $RPM_BUILD_ROOT%{_bindir}/yaws
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%if %(test -f /usr/sadm/install/scripts/i.manifest && echo 0 || echo 1)
+%iclass manifest -f i.manifest
+%endif
+
+%files
+%defattr(-,root,bin)
+%dir /lib
+%dir /lib/svc
+%dir /lib/svc/method
+%attr(555,root,bin) /lib/svc/method/http-yaws
+%attr(755,root,sys) %dir %{_prefix}
+%dir %{_bindir}
+%{_bindir}/yaws
+%dir %{_libdir}
+%dir %{_libdir}/yaws
+%dir %{_libdir}/yaws/examples
+%dir %{_libdir}/yaws/examples/ebin
+%dir %{_libdir}/yaws/examples/include
+%dir %{_libdir}/yaws/priv
+%{_libdir}/yaws/priv/wsdl.xsd
+%{_libdir}/yaws/priv/soap.xsd
+%dir %{_libdir}/yaws/priv/lib
+%{_libdir}/yaws/priv/lib/setuid_drv.so
+%attr(4755,root,bin) %{_libdir}/yaws/priv/epam
+%{_libdir}/yaws/priv/envelope.xsd
+%dir %{_libdir}/yaws/ebin
+%{_libdir}/yaws/ebin/yaws_app.beam
+%{_libdir}/yaws/ebin/haxe.beam
+%{_libdir}/yaws/ebin/yaws_compile.beam
+%{_libdir}/yaws/ebin/yaws_log.beam
+%{_libdir}/yaws/ebin/yaws_generated.beam
+%{_libdir}/yaws/ebin/yaws_api.beam
+%{_libdir}/yaws/ebin/yaws_sup.beam
+%{_libdir}/yaws/ebin/yaws.app
+%{_libdir}/yaws/ebin/yaws_xmlrpc.beam
+%{_libdir}/yaws/ebin/yaws_appmod_cgi.beam
+%{_libdir}/yaws/ebin/yaws_html.beam
+%{_libdir}/yaws/ebin/yaws_outmod.beam
+%{_libdir}/yaws/ebin/yaws_revproxy.beam
+%{_libdir}/yaws/ebin/yaws_config.beam
+%{_libdir}/yaws/ebin/authmod_gssapi.beam
+%{_libdir}/yaws/ebin/yaws_cgi.beam
+%{_libdir}/yaws/ebin/yaws_soap_lib.beam
+%{_libdir}/yaws/ebin/yaws_jsonrpc.beam
+%{_libdir}/yaws/ebin/yaws_stats.beam
+%{_libdir}/yaws/ebin/yaws_ls.beam
+%{_libdir}/yaws/ebin/yaws_rss.beam
+%{_libdir}/yaws/ebin/yaws.beam
+%{_libdir}/yaws/ebin/yaws_log_file_h.beam
+%{_libdir}/yaws/ebin/yaws_rpc.beam
+%{_libdir}/yaws/ebin/yaws_sendfile.beam
+%{_libdir}/yaws/ebin/yaws_sup_restarts.beam
+%{_libdir}/yaws/ebin/json.beam
+%{_libdir}/yaws/ebin/jsonrpc.beam
+%{_libdir}/yaws/ebin/yaws_zlib.beam
+%{_libdir}/yaws/ebin/yaws_ctl.beam
+%{_libdir}/yaws/ebin/yaws_pam.beam
+%{_libdir}/yaws/ebin/yaws_session_server.beam
+%{_libdir}/yaws/ebin/yaws_server.beam
+%{_libdir}/yaws/ebin/yaws_ticker.beam
+%{_libdir}/yaws/ebin/yaws_soap_srv.beam
+%{_libdir}/yaws/ebin/yaws_debug.beam
+%{_libdir}/yaws/ebin/yaws_dav.beam
+%{_libdir}/yaws/ebin/yaws_multipart.beam
+%{_libdir}/yaws/ebin/yaws_appmod_fcgi.beam
+%{_libdir}/yaws/ebin/yaws_websockets.beam
+%{_libdir}/yaws/ebin/yaws.appup
+%{_libdir}/yaws/ebin/json2.beam
+%{_libdir}/yaws/ebin/mime_types.beam
+%{_libdir}/yaws/ebin/yaws_logger.beam
+%{_libdir}/yaws/ebin/yaws_shaper.beam
+%{_libdir}/yaws/ebin/yaws_vdir.beam
+%dir %{_libdir}/yaws/include
+%{_libdir}/yaws/include/yaws_api.hrl
+%{_libdir}/yaws/include/yaws.hrl
+%{_libdir}/yaws/include/yaws_dav.hrl
+%{_libdir}/yaws/include/soap.hrl
+%attr(755,root,other) %dir %{_libdir}/pkgconfig
+%{_libdir}/pkgconfig/yaws.pc
+%attr(755,root,sys) %dir %{_datadir}
+%dir %{_mandir}
+%dir %{_mandir}/man1
+%dir %{_mandir}/man5
+%{_mandir}/man1/yaws.1
+%{_mandir}/man5/yaws_api.5
+%{_mandir}/man5/yaws.conf.5
+%attr(755,root,other) %dir %{_docdir}
+%dir %{_docdir}/yaws
+%defattr(-,root,sys)
+%dir %{_sysconfdir}
+%dir %{_sysconfdir}/yaws
+%attr(640,root,webservd) %config %{_sysconfdir}/yaws/yaws.conf
+%dir %{_localstatedir}/log
+%attr(755,webservd,webservd) %dir %{_localstatedir}/log/yaws
+%{_localstatedir}/yaws
+%dir %{_localstatedir}/svc
+%dir %{_localstatedir}/svc/manifest
+%dir %{_localstatedir}/svc/manifest/network
+%class(manifest) %attr(444,root,sys) %{_localstatedir}/svc/manifest/network/http-yaws.xml
+
+%changelog
+* Tue Jun 28 2011 - James Lee <jlee@thestaticvoid.com>
+- Bump to version 1.90.
+- Update for SFE inclusion.
+* Tue Feb 15 2011 - James Lee <jlee@thestaticvoid.com>
+- Bump to version 1.89
+- Run under 'webservd' user
+- Require my version of Erlang
+* Thu Jan 21 2010 - James Lee <jlee@thestaticvoid.com>
+- Bump to version 1.87
+* Mon Dec 28 2009 - James Lee <jlee@thestaticvoid.com>
+- Bump to version 1.86
+* Thu Nov 26 2009 - James Lee <jlee@thestaticvoid.com>
+- Bump to version 1.85
+* Sat Jul 30 2009 - James Lee <jlee@thestaticvoid.com>
+- Initial version
View
27 copyright/SFEyaws.copyright
@@ -0,0 +1,27 @@
+
+Copyright (c) 2006, Claes Wikstrom, klacke@hyber.org
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of "Yaws" nor the names of its contributors may be
+ used to endorse or promote products derived from this software without
+ specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
View
34 ext-sources/http-yaws
@@ -0,0 +1,34 @@
+#!/sbin/sh
+
+. /lib/svc/share/smf_include.sh
+
+io_pipe_name=$(svcprop -p options/io_pipe_name $SMF_FMRI)
+mnesia_dir=$(svcprop -p options/mnesia_dir $SMF_FMRI)
+
+case "$1" in
+ "start")
+ if [ "$io_pipe_name" != '""' ]; then
+ args="--run_erl $io_pipe_name "
+ else
+ args="--daemon "
+ fi
+
+ [ "$mnesia_dir" != '""' ] && args="${args}--mnesiadir $mnesia_dir"
+
+ TERM=vt100 /usr/bin/yaws $args --sname yaws
+ ;;
+
+ "stop")
+ /usr/bin/yaws --stop
+ ;;
+
+ "refresh")
+ /usr/bin/yaws --hup
+ ;;
+
+ *)
+ echo "Usage: $0 { start | stop | refresh }"
+ exit $SMF_EXIT_ERR_CONFIG
+esac
+
+exit $SMF_EXIT_OK
View
109 ext-sources/http-yaws.xml
@@ -0,0 +1,109 @@
+<?xml version="1.0"?>
+<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
+
+<service_bundle type='manifest' name='yaws'>
+
+<service
+ name='network/http'
+ type='service'
+ version='1'>
+
+ <single_instance />
+
+ <dependency
+ name='fs-local'
+ grouping='require_all'
+ restart_on='none'
+ type='service'>
+ <service_fmri value='svc:/system/filesystem/local' />
+ </dependency>
+
+ <dependency
+ name='network-service'
+ grouping='require_all'
+ restart_on='none'
+ type='service'>
+ <service_fmri value='svc:/network/service' />
+ </dependency>
+
+ <dependency
+ name='name-services'
+ grouping='require_all'
+ restart_on='refresh'
+ type='service'>
+ <service_fmri value='svc:/milestone/name-services' />
+ </dependency>
+
+ <dependency
+ name='network-epmd'
+ grouping='require_all'
+ restart_on='restart'
+ type='service'>
+ <service_fmri value='svc:/network/epmd' />
+ </dependency>
+
+ <instance name='yaws' enabled='false'>
+
+ <dependency
+ name='config-file'
+ grouping='require_all'
+ restart_on='refresh'
+ type='path'>
+ <service_fmri
+ value='file://localhost/etc/yaws/yaws.conf' />
+ </dependency>
+
+ <exec_method
+ type='method'
+ name='start'
+ exec='/lib/svc/method/http-yaws start'
+ timeout_seconds='10'>
+ <method_context>
+ <method_credential user='webservd' group='webservd' privileges="basic,net_privaddr" />
+ </method_context>
+ </exec_method>
+
+ <exec_method
+ type='method'
+ name='stop'
+ exec='/lib/svc/method/http-yaws stop'
+ timeout_seconds='10'>
+ <method_context>
+ <method_credential user='webservd' group='webservd' />
+ </method_context>
+ </exec_method>
+
+ <exec_method
+ type='method'
+ name='refresh'
+ exec='/lib/svc/method/http-yaws refresh'
+ timeout_seconds='10'>
+ <method_context>
+ <method_credential user='webservd' group='webservd' />
+ </method_context>
+ </exec_method>
+
+ <property_group name='options' type='application'>
+ <propval name='io_pipe_name' type='astring' value='svc' />
+ <propval name='mnesia_dir' type='astring' value='' />
+ </property_group>
+
+ <template>
+ <common_name>
+ <loctext xml:lang='C'>
+ Yet Another Web Server
+ </loctext>
+ </common_name>
+ <documentation>
+ <manpage title='yaws' section='1M'
+ manpath='/usr/share/man' />
+ </documentation>
+ </template>
+
+ </instance>
+
+ <stability value='Unstable' />
+
+</service>
+
+</service_bundle>
View
71 patches/yaws-01-revproxy-fix.diff
@@ -0,0 +1,71 @@
+commit 5cc39b7757c312e592a84763717c562a2804191f
+Author: Steve Vinoski <vinoski@ieee.org>
+Date: Mon Jun 20 22:29:42 2011 -0400
+
+ fix reverse proxy problem (issue #60)
+
+ Change yaws_server.erl to not exit on {'EXIT', From, Reason} messages
+ found when erasing transient messages, a change originally introduced
+ in commit c0755739. Doing so was causing reverse proxy to no longer
+ work, as reported in issue #60 on github and as experienced by several
+ users. Note however that this might be a temporary fix, since it might
+ be better to figure out the source of the EXIT message, but I'm
+ committing and pushing this fix now for the benefit of those waiting
+ to use the reverse proxy feature.
+
+ Thanks to Manuel Durán Aguete for providing a test case making it easy
+ to reproduce the problem and test the fix.
+
+diff --git a/src/yaws_server.erl b/src/yaws_server.erl
+index 49ae1b7..7c57424 100644
+--- a/src/yaws_server.erl
++++ b/src/yaws_server.erl
+@@ -1182,9 +1182,8 @@ init_db() ->
+ put(init_db, lists:keydelete(init_db, 1, get())).
+
+ erase_transients() ->
+- %% flush all messages. If exit message found, rethrow it
++ %% flush all messages
+ Fun = fun(G) -> receive
+- {'EXIT', _From, Reason} -> exit(Reason);
+ _X -> G(G)
+ after 0 -> ok
+ end
+
+commit a922ccb753c4d17f3f6b4da0398493786b2fe67a
+Author: Christopher Faulet <christopher@yakaz.com>
+Date: Tue Jun 21 09:44:07 2011 +0200
+
+ catch exit signals sent by gserv process
+
+ In commit 5cc39b7, the temporary fix for issue #60, all exit signals
+ found when erasing transient messages are ignored. This commit
+ completes that fix. Exit signals coming specifically from the gserv
+ process to shutdown the connection are also ignored. So, only signals
+ from gserv are now processed and all others are flushed.
+
+diff --git a/src/yaws_server.erl b/src/yaws_server.erl
+index 7c57424..8415964 100644
+--- a/src/yaws_server.erl
++++ b/src/yaws_server.erl
+@@ -956,6 +956,7 @@ acceptor(GS) ->
+ end.
+ acceptor0(GS, Top) ->
+ ?TC([{record, GS, gs}]),
++ put(gserv_pid, Top),
+ put(gc, GS#gs.gconf),
+ X = do_accept(GS),
+ Top ! {self(), next, X},
+@@ -1182,8 +1183,11 @@ init_db() ->
+ put(init_db, lists:keydelete(init_db, 1, get())).
+
+ erase_transients() ->
+- %% flush all messages
++ %% flush all messages.
++ %% If exit signal is received from the gserv process, rethrow it
++ Top = get(gserv_pid),
+ Fun = fun(G) -> receive
++ {'EXIT', Top, Reason} -> exit(Reason);
+ _X -> G(G)
+ after 0 -> ok
+ end

No commit comments for this range

Something went wrong with that request. Please try again.