Код: Выделить всё
# uname -v
FreeBSD 10.1-RELEASE #0
Код: Выделить всё
# pkg info
apache24-2.4.10_2 Version 2.4.x of Apache web server
apr-1.5.1.1.5.4 Apache Portability Library
autoconf-2.69 Automatically configure source code on many Un*x platforms
autoconf-wrapper-20131203 Wrapper script for GNU autoconf
automake-1.14_1 GNU Standards-compliant Makefile generator
automake-wrapper-20131203 Wrapper script for GNU automake
barnyard2-1.13 Interpreter for Snort unified2 binary output files
bash-4.3.30 The GNU Project's Bourne Again SHell
bison-2.7.1,1 Parser generator from FSF, (mostly) compatible with Yacc
ca_root_nss-3.17.2 The root certificate bundle from the Mozilla Project
cairo-1.12.18_1,2 Vector graphics library with cross-device output support
cmake-3.0.2 Cross-platform Makefile generator
cmake-modules-3.0.2 Modules and Templates for CMake
convmv-1.15 Convert filenames from one encoding to another
curl-7.38.0_1 Non-interactive tool to get files from FTP, GOPHER, HTTP(S) servers
daq-2.0.2_1 Data Acquisition abstraction library for snort 2.9+
db5-5.3.28_2 The Oracle Berkeley DB, revision 5.3
dejavu-2.34_4 Bitstream Vera Fonts clone with a wider range of characters
dialog4ports-0.1.5_2 Console Interface to configure ports
elinks-0.11.7_5 Elinks - links text WWW browser with enhancements
encodings-1.0.4_1,1 X.Org Encoding fonts
expat-2.1.0_2 XML 1.0 parser written in C
expect-5.45_1 Sophisticated scripter based on Tcl/Tk
font-bh-ttf-1.0.3_1 X.Org Bigelow & Holmes TTF font
font-misc-ethiopic-1.0.3_1 X.Org miscellaneous Ethiopic font
font-misc-meltho-1.0.3_1 X.Org miscellaneous Meltho font
font-util-1.3.0_1 Create an index of X font files in a directory
fontconfig-2.11.1,1 XML-based font configuration API for X Windows
freetype2-2.5.4_1 Free and portable TrueType font rendering engine
gawk-4.1.1_1 The GNU version of Awk
gdbm-1.11_2 GNU database manager
gettext-0.19.3 GNU gettext meta package
gettext-runtime-0.19.3 GNU gettext runtime libraries and programs
gettext-tools-0.19.3 GNU gettext development and translation tools
glib-2.42.1 Some useful routines of C programming (current stable version)
gmake-4.1_1 GNU version of 'make' utility
gmake-lite-3.82 Minimalist version of gnu make
graphite2-1.2.4 Rendering capabilities for complex non-Roman writing systems
harfbuzz-0.9.36 OpenType text shaping engine
help2man-1.43.3_1 Automatically generating simple manual pages from program output
icu-53.1 International Components for Unicode (from IBM)
iftop-0.17 Display bandwidth usage on an interface by host
indexinfo-0.2.2 Utility to regenerate the GNU info page index
iperf-2.0.5 Tool to measure maximum TCP and UDP bandwidth
jpeg-8_5 IJG's jpeg compression utilities
kbproto-1.0.6 KB extension headers
libICE-1.0.9,1 Inter Client Exchange library for X11
libSM-1.2.2_2,1 Session Management library for X11
libX11-1.6.2_2,1 X11 library
libXau-1.0.8_2 Authentication Protocol library for X11
libXaw-1.0.12_2,2 X Athena Widgets library
libXdmcp-1.1.1_2 X Display Manager Control Protocol library
libXext-1.3.3,1 X11 Extension library
libXft-2.3.1_2 Client-sided font API for X applications
libXmu-1.1.2_2,1 X Miscellaneous Utilities libraries
libXp-1.0.2_2,1 X print library
libXpm-3.5.11_2 X Pixmap library
libXrender-0.9.8_2 X Render extension library
libXt-1.1.4_2,1 X Toolkit library
libdnet-1.12_1 Simple interface to low level networking routines
libedit-3.1.20150325_2 Command line editor library
libevent2-2.0.21_2 API for executing callback functions on events or timeouts
libffi-3.0.13_3 Foreign Function Interface
libfontenc-1.1.2_2 The fontenc Library
libiconv-1.14_6 Character set conversion library
libidn-1.29 Internationalized Domain Names command line tool
libltdl-2.4.2_3 System independent dlopen wrapper
libmcrypt-2.5.8_2 Multi-cipher cryptographic library (used in PHP)
libnet-1.1.6_2,1 C library for creating IP packets
libpthread-stubs-0.3_6 This library provides weak aliases for pthread functions
libsigsegv-2.10_1 Handling page faults in user mode
libtool-2.4.2_3 Generic shared library support script
libxcb-1.11 The X protocol C-language Binding (XCB) library
libxml2-2.9.2_2 XML parser library for GNOME
libzip-0.11.2_1 C library for reading, creating, and modifying ZIP archives
m4-1.4.17_1,1 GNU m4
mc-light-4.1.40.p9_9 Lightweight Midnight Commander clone
mkfontdir-1.0.7 Create an index of X font files in a directory
mkfontscale-1.1.1_1 Creates an index of scalable font files for X
mod_php56-5.6.0_1 PHP Scripting Language
mpd5-5.7_1 Multi-link PPP daemon based on netgraph(4)
mysql56-client-5.6.27 Multithreaded SQL database (client)
mysql56-server-5.6.27 Multithreaded SQL database (server)
net-snmp-5.7.3_11 Extendable SNMP implementation
ntp-devel-4.2.7p475 The Network Time Protocol Distribution
oniguruma4-4.7.1_1 BSDL Regular Expressions library compatible with POSIX/GNU/Perl
p5-Locale-gettext-1.05_3 Message handling functions
pango-1.36.8 Open-source framework for the layout and rendering of i18n text
pcre-8.35_2 Perl Compatible Regular Expressions library
perl5-5.20.3_11 Practical Extraction and Report Language
perl5.18-5.18.4_20 Practical Extraction and Report Language
php56-5.6.20 PHP Scripting Language
php56-bcmath-5.6.0_1 The bcmath shared extension for php
php56-bz2-5.6.0_1 The bz2 shared extension for php
php56-calendar-5.6.0_1 The calendar shared extension for php
php56-ctype-5.6.0_1 The ctype shared extension for php
php56-curl-5.6.0_1 The curl shared extension for php
php56-dom-5.6.0_1 The dom shared extension for php
php56-extensions-1.0 "meta-port" to install PHP extensions
php56-filter-5.6.0_1 The filter shared extension for php
php56-gd-5.6.0_1 The gd shared extension for php
php56-hash-5.6.0_1 The hash shared extension for php
php56-iconv-5.6.0_1 The iconv shared extension for php
php56-json-5.6.0_1 The json shared extension for php
php56-mbstring-5.6.0_1 The mbstring shared extension for php
php56-mcrypt-5.6.0_1 The mcrypt shared extension for php
php56-mysql-5.6.0_1 The mysql shared extension for php
php56-mysqli-5.6.0_1 The mysqli shared extension for php
php56-opcache-5.6.0_1 The opcache shared extension for php
php56-openssl-5.6.0_1 The openssl shared extension for php
php56-pdo-5.6.0_1 The pdo shared extension for php
php56-pdo_sqlite-5.6.0_1 The pdo_sqlite shared extension for php
php56-phar-5.6.0_1 The phar shared extension for php
php56-posix-5.6.0_1 The posix shared extension for php
php56-session-5.6.0_1 The session shared extension for php
php56-simplexml-5.6.0_1 The simplexml shared extension for php
php56-snmp-5.6.0_1 The snmp shared extension for php
php56-sqlite3-5.6.0_1 The sqlite3 shared extension for php
php56-tokenizer-5.6.0_1 The tokenizer shared extension for php
php56-xml-5.6.0_1 The xml shared extension for php
php56-xmlreader-5.6.0_1 The xmlreader shared extension for php
php56-xmlwriter-5.6.0_1 The xmlwriter shared extension for php
php56-zip-5.6.0_1 The zip shared extension for php
php56-zlib-5.6.0_1 The zlib shared extension for php
phpMyAdmin-4.2.10.1 Set of PHP-scripts to manage MySQL over the web
pixman-0.32.6 Low-level pixel manipulation library
pkg-1.7.2 Package manager
pkgconf-0.9.7 Utility to help to configure compiler and linker flags
png-1.5.18 Library for manipulating PNG images
printproto-1.0.5 Print extension headers
py27-Babel-1.3_2 Collection of tools for internationalizing Python applications
py27-Jinja2-2.7.3 Fast and easy to use stand-alone template engine
py27-MarkupSafe-0.23 Implements a XML/HTML/XHTML Markup safe string for Python
py27-docutils-0.12 Python Documentation Utilities
py27-pygments-1.6_2 Syntax highlighter written in Python
py27-pytz-2014.4,1 World Timezone Definitions for Python
py27-setuptools27-5.5.1 Python packages installer
py27-sphinx-1.2.3 Python documentation generator
python27-2.7.9 Interpreted object-oriented programming language
renderproto-0.11.1 RenderProto protocol headers
rrdtool-1.4.8_6 Round Robin Database Tools
smartmontools-6.3 S.M.A.R.T. disk monitoring tools
sqlite3-3.8.6 SQL database engine in a C library
sudo-1.8.11.p1 Allow others to run commands as root
t1lib-5.1.2_4,1 Type 1 font rasterization library for Unix/X11
tcl86-8.6.2_1 Tool Command Language
wget-1.15_2 Retrieve files from the Net via HTTP(S) and FTP
xcb-util-0.3.9_3,1 Module with libxcb/libX11 extension/replacement libraries
xcb-util-renderutil-0.3.9 Convenience functions for the Render extension
xextproto-7.3.0 XExt extension headers
xorg-fonts-truetype-7.7_1 X.Org TrueType fonts
xorg-macros-1.19.0 X.Org development aclocal macros
xproto-7.0.26 X11 protocol headers
xtrans-1.3.4_1 Abstract network code for X
Код: Выделить всё
www
total 32
drwxr-xr-x 4 www www 512 Apr 15 00:29 .
drwxr-xr-x 14 root wheel 512 Apr 14 01:43 ..
drwxrwxrwx 6 www www 512 Jan 4 2015 apache24
drwxr-xr-x 9 root wheel 3072 Jul 1 14:58 phpMyAdmin
cgi-bin,data
total 48
drwxrwxrwx 6 www www 512 Jan 4 2015 .
drwxr-xr-x 4 www www 512 Apr 15 00:29 ..
drwxr-xr-x 2 www www 512 Aug 30 17:10 cgi-bin
drwxrwxrwt 7 www www 2048 Aug 30 22:35 data
drwxr-xr-x 3 root wheel 1024 Jan 4 2015 error
drwxr-xr-x 3 root wheel 4096 Jan 4 2015 icons
if5683.sh
-rwxrwxrwt 1 www www 20967 Aug 31 12:14 /usr/local/www/apache24/cgi-bin/if5683.sh
ofonu
-rw-r--r-- 1 root wheel 96 Aug 31 12:20 /usr/scripts/ofonu.log
start if5683
start uid=80(www) gid=80(www) groups=80(www)
stop uid=80(www) gid=80(www) groups=80(www)
Но скрипт не пишет, т.к. нет прав?! Вот что в логе апача:
Код: Выделить всё
[Wed Aug 31 12:33:27.436495 2016] [cgi:error] [pid 5764] [client 192.168.0.2:10927] AH01215: /usr/local/www/apache24/cgi-bin/if5683.sh: cannot create /usr/scripts/ofonu.log: Permission denied, referer: http://192.168.0.12/cgi-bin/test.cgi
[Wed Aug 31 12:33:27.447673 2016] [cgi:error] [pid 5764] [client 192.168.0.2:10927] AH01215: /usr/local/www/apache24/cgi-bin/if5683.sh: cannot create /usr/local/www/apache24/data/5683.html: Permission denied, referer: http://192.168.0.12/cgi-bin/test.cgi
Отправлено спустя 55 минут 41 секунду:
Забыл написать, что скрипт работает по крону или при запуске с командной строки без проблем.