From 0127671da68393966f7ff63a3e23475bcda812df Mon Sep 17 00:00:00 2001 From: Havard Sorli Date: Mon, 21 Mar 2011 00:34:49 +0100 Subject: [PATCH 1/2] new file: packaging/centos/vnstat-php.conf : apache config --- packaging/centos/vnstat-php.conf | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 packaging/centos/vnstat-php.conf diff --git a/packaging/centos/vnstat-php.conf b/packaging/centos/vnstat-php.conf new file mode 100644 index 0000000..893a1cd --- /dev/null +++ b/packaging/centos/vnstat-php.conf @@ -0,0 +1,20 @@ +# +# File: vnstat.conf +# $: vnstat/packaging/centos/vnstat.conf,v 1.0 2011/03/20 09:20:01 havard Exp $ +# +# This is the Vnstat Apache configuration file; it is included from +# the Apache httpd.conf file. This version is for Red Hat / Centos 4/5 systems. +# +# Copy file to: /etc/httpd/conf.d/ + +Alias /vnstat "/var/www/vnstat/" + + + Options -Indexes + order allow,deny + allow from 127.0.0.1 +# allow from all +# allow from example.com +# allow from 192.168.1.10 + + From e7fd5cfe962b052e9a89f086cc4eb11af6cafb5f Mon Sep 17 00:00:00 2001 From: Havard Sorli Date: Mon, 21 Mar 2011 00:45:21 +0100 Subject: [PATCH 2/2] =?UTF-8?q?=09new=20file:=20=20=20vnstat=5Fphp=5Ffront?= =?UTF-8?q?end.spec=20RPM=20.spec=20--=3D=20BETA=20=3D--=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20Testet=20p=C3=A5=20Centos=204.9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packaging/centos/vnstat_php_frontend.spec | 111 ++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 packaging/centos/vnstat_php_frontend.spec diff --git a/packaging/centos/vnstat_php_frontend.spec b/packaging/centos/vnstat_php_frontend.spec new file mode 100644 index 0000000..0f95bdb --- /dev/null +++ b/packaging/centos/vnstat_php_frontend.spec @@ -0,0 +1,111 @@ +# $Id$ +# Authority: havard +# Upstream: Bjorge Dijkstra + +Summary: vnstat PHP frontend - network traffic monitor +Name: vnstat_php_frontend +Version: 1.5.1 +Release: 1%{?dist} +License: GPL +Group: Applications/System +URL: http://www.sqweek.com/sqweek/index.php?p=1 + +Source: http://www.sqweek.com/sqweek/files/vnstat_php_frontend-%{version}.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root + +BuildArch: noarch + +#Requires: php-xxxxx>= x.x.x +#%{?el5:Requires: php-xxxx} +Requires: webserver vnstat php php-gd +Obsoletes: vnstat_php_frontend <= %{version}-%{release} +Provides: vnstat_php_frontend = %{version}-%{release} + +%description + +This is a PHP fronted end to vnStat, a network traffic logger. vnStat is console +mode only. This script makes a 'nice' report of the data collected by vnStat. + +vnstat is a network traffic monitor that keeps a log of daily network +traffic for the selected interface(s). vnstat is not a packet sniffer. +http://humdi.net/vnstat + +%prep + +%setup -q -n %{name}-%{version} + +#Todo: get setting for vnstat-php.conf +# $iface_list from vnstat.sysconfig +# $data_dir to /var/lib/vnstat/ or from /etc/vnstat.conf + +%{__cat} <vnstat-php.conf +# +# %{summary} +# + +Alias /vnstat %{_datadir}/%{name} + + + Order Deny,Allow + Deny from all + Allow from 127.0.0.1 + # Set the default handler. + DirectoryIndex index.php + #Allow from all + +EOF + + +%build + +%install +%{__rm} -rf %{buildroot} +%{__mkdir} -p %{buildroot}/%{_datadir}/%{name} +%{__mkdir} -p %{buildroot}/%{_sysconfdir}/httpd/conf.d/ + +%{__install} -d -m0755 %{buildroot}%{_datadir}/%{name}/ +%{__cp} -av *.{php,ttf} %{buildroot}%{_datadir}/%{name}/ +%{__cp} -av lang/ themes/ %{buildroot}%{_datadir}/%{name}/ + +%{__install} -Dp -m0644 config.php %{buildroot}%{_datadir}/%{name}/config.php +#%{__install} -Dp -m0644 packaging/centos/vnstat-php.conf %{buildroot}%{_sysconfdir}/httpd/conf.d/vnstat-php.conf +%{__install} -Dp -m0644 vnstat-php.conf %{buildroot}%{_sysconfdir}/httpd/conf.d/vnstat-php.conf + +# note +HOST=`hostname -f` +echo "" +echo "Next steps: " +echo "" +echo "[config apache access]" +echo " Use a editor and open this file:" +echo " /etc/httpd/conf.d/vnstat.conf" +echo "" +echo "[httpd services]" +echo " Restart httpd 'service httpd restart'" +echo "" +echo "[have fun.. ]" +echo " Use a webbrowser and open this link:" +echo " http://$HOST/vnstat" +echo "" +echo "" + +%clean +%{__rm} -rf %{buildroot} + +%files +%defattr(-, root, root, 0755) +%doc COPYING README vera_copyright.txt +%config(noreplace) %{_sysconfdir}/httpd/conf.d/vnstat-php.conf + +%defattr(0640, root, apache, 0755) +%config(noreplace) %{_datadir}/%{name}/config.php + +%defattr(0755, nobody, nobody, 0755) +%{_datadir}/%{name}/ + + +%changelog +* Sun Mar 20 2011 Havard Sorli - 1.5.1 +- Initial package. +- spec file based on: http://svn.rpmforge.net/svn/trunk/rpms/vnstat/vnstat.spec + http://svn.rpmforge.net/svn/trunk/rpms/phpmyadmin/phpmyadmin.spec