tar -xvf expat-2.2.10.tar.gz
cd expat-2.2.10
./configure --prefix=/usr/local/expat-2.2.10
make && make install
cd ..
tar -xvf apr-1.7.0.tar.gz
cd apr-1.7.0
./configure --prefix=/usr/local/apr-1.7.0
make && make install
cd ..
tar -xvf apr-util-1.6.1.tar.gz
cd apr-util-1.6.1
./configure --prefix=/usr/local/apr-util-1.6.1 --with-apr=/usr/local/apr-1.7.0 --with-expat=/usr/local/expat-2.2.10
make && make install
cd ..
tar -xvf pcre-8.44.tar.gz
cd pcre-8.44
./configure --prefix=/usr/local/pcre-8.44
make && make install
cd ..
tar -xvf perl-5.18.4.tar.gz
cd perl-5.18.4
./Configure -des -Dprefix=/usr/local/perl-5.18.4
make && make install
cd ..
tar -xvf openssl-1.1.1k.tar.gz
cd openssl-1.1.1k
./config --prefix=/usr/local/openssl-1.1.1k
make && make install
cd ..
tar -xvf httpd-2.4.48.tar.gz
cd httpd-2.4.48
./configure --prefix=/usr/local/apache24 --with-apr=/usr/local/apr-1.7.0 \
--with-apr-util=/usr/local/apr-util-1.6.1 --with-pcre=/usr/local/pcre-8.44 \
--enable-ssl --with-ssl=/usr/local/openssl-1.1.1k \
--enable-so --enable-cgi --enable-rewrite --with-zlib \
--enable-modules=most
make && make install
cd ..
#!/bin/sh
#
# PROVIDE: apache24
# REQUIRE: LOGIN cleanvar sshd
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable apache24:
# apache24_enable (bool): Set to "NO" by default.
# Set it to "YES" to enable apache24
# apache24_profiles (str): Set to "" by default.
# Define your profiles here.
# apache24limits_enable (bool):Set to "NO" by default.
# Set it to yes to run `limits $limits_args`
# just before apache starts.
# apache24_flags (str): Set to "" by default.
# Extra flags passed to start command.
# apache24limits_args (str): Default to "-e -C daemon"
# Arguments of pre-start limits run.
# apache24_http_accept_enable (bool): Set to "NO" by default.
# Set to yes to check for accf_http kernel
# module on start up and load if not loaded.
# apache24_fib (str): Set an altered default network view for apache
. /etc/rc.subr
name="apache24"
rcvar=apache24_enable
apache24_prefix="/usr/local/apache24"
start_precmd="apache24_prestart"
restart_precmd="apache24_checkconfig"
reload_precmd="apache24_checkconfig"
reload_cmd="apache24_graceful"
graceful_cmd="apache24_graceful"
gracefulstop_cmd="apache24_gracefulstop"
configtest_cmd="apache24_checkconfig"
command="${apache24_prefix}/bin/httpd"
_pidprefix="${apache24_prefix}/logs/httpd"
pidfile="${_pidprefix}.pid"
required_files="${apache24_prefix}/conf/httpd.conf"
envvars="${apache24_prefix}/bin/envvars"
[ -z "$apache24_enable" ] && apache24_enable="NO"
[ -z "$apache24limits_enable" ] && apache24limits_enable="NO"
[ -z "$apache24limits_args" ] && apache24limits_args="-e -C daemon"
[ -z "$apache24_http_accept_enable" ] && apache24_http_accept_enable="NO"
apache24_accf()
{
if checkyesno apache24_http_accept_enable; then
/sbin/kldstat -v | grep accf_http > /dev/null 2>&1 || /sbin/kldload accf_http || return ${?}
/sbin/kldstat -v | grep accf_data > /dev/null 2>&1 || /sbin/kldload accf_data || return ${?}
else
apache24_flags="${apache24_flags} -DNOHTTPACCEPT"
fi
}
load_rc_config $name
if [ -n "$2" ]; then
profile="$2"
if [ "x${apache24_profiles}" != "x" ]; then
pidfile="${_pidprefix}.${profile}.pid"
eval apache24_configfile="\${apache24_${profile}_configfile:-}"
if [ "x${apache24_configfile}" = "x" ]; then
echo "You must define a configuration file (apache24_${profile}_configfile)"
exit 1
fi
required_files="${apache24_configfile}"
eval apache24_enable="\${apache24_${profile}_enable:-${apache24_enable}}"
eval apache24_flags="\${apache24_${profile}_flags:-${apache24_flags}}"
eval apache24_http_accept_enable="\${apache24_${profile}_http_accept_enable:-${apache24_http_accept_enable}}"
eval apache24limits_enable="\${apache24limits_${profile}_enable:-${apache24limits_enable}}"
eval apache24limits_args="\${apache24limits_${profile}_args:-${apache24limits_args}}"
eval apache24_fib="\${apache24_${profile}_fib:-${apache24_fib}}"
eval command="\${apache24_${profile}_command:-${command}}"
eval pidfile="\${apache24_${profile}_pidfile:-${pidfile}}"
eval apache24_envvars="\${apache24_${profile}_envvars:-${envvars}}"
apache24_flags="-f ${apache24_configfile} -c \"PidFile ${pidfile}\" ${apache24_flags}"
else
echo "$0: extra argument ignored"
fi
else
eval apache24_envvars=${envvars}
if [ "x${apache24_profiles}" != "x" -a "x$1" != "x" ]; then
for profile in ${apache24_profiles}; do
eval _enable="\${apache24_${profile}_enable}"
case "x${_enable:-${apache24_enable}}" in
x|x[Nn][Oo]|x[Nn][Oo][Nn][Ee])
continue
;;
x[Yy][Ee][Ss])
;;
*)
if test -z "$_enable"; then
_var=apache24_enable
else
_var=apache24_"${profile}"_enable
fi
echo "Bad value" \
"'${_enable:-${apache24_enable}}'" \
"for ${_var}. " \
"Profile ${profile} skipped."
continue
;;
esac
echo "===> apache24 profile: ${profile}"
/usr/local/etc/rc.d/apache24 $1 ${profile}
retcode="$?"
if [ "0${retcode}" -ne 0 ]; then
failed="${profile} (${retcode}) ${failed:-}"
else
success="${profile} ${success:-}"
fi
done
exit 0
fi
fi
if [ "${1}" != "stop" ] ; then \
apache24_accf
fi
apache24_requirepidfile()
{
apache24_checkconfig
if [ ! "0`check_pidfile ${pidfile} ${command}`" -gt 1 ]; then
echo "${name} not running? (check $pidfile)."
exit 1
fi
}
apache24_checkconfig()
{
if test -f ${apache24_envvars}
then
. ${apache24_envvars}
fi
echo "Performing sanity check on apache24 configuration:"
eval ${command} ${apache24_flags} -t
}
apache24_graceful() {
apache24_requirepidfile
echo "Performing a graceful restart"
eval ${command} ${apache24_flags} -k graceful
}
apache24_gracefulstop() {
apache24_requirepidfile
echo "Performing a graceful stop"
eval ${command} ${apache24_flags} -k graceful-stop
}
apache24_precmd()
{
apache24_checkconfig
if checkyesno apache24limits_enable
then
eval `/usr/bin/limits ${apache24limits_args}` 2>/dev/null
else
return 0
fi
}
apache24_checkfib () {
if command -v check_namevarlist > /dev/null 2>&1; then
check_namevarlist fib && return 0
fi
$SYSCTL net.fibs >/dev/null 2>&1 || return 0
apache24_fib=${apache24_fib:-"NONE"}
if [ "x$apache24_fib" != "xNONE" ]
then
command="/usr/sbin/setfib -F ${apache24_fib} ${command}"
else
return 0
fi
}
apache24_prestart() {
apache24_checkfib
apache24_precmd
}
extra_commands="reload graceful gracefulstop configtest"
run_rc_command "$1"
chmod +x /usr/local/etc/rc.d/apache24
/usr/local/etc/rc.d/apache24 start
tar -xvf openssl-0.9.8g.tar.gz
cd openssl-0.9.8g
./config --prefix=/usr/local/openssl-0.9.8g
make && make install
cd ..
tar -xvf libxml2-2.7.8.tar.gz
cd libxml2-2.7.8
./configure --prefix=/usr/local/libxml2-2.7.8
make && make install
cd ..
tar xvf php-5.6.40.tar.gz
cd php-5.6.40
./configure --prefix=/usr/local/php-5.6.40 --with-openssl=/usr/local/openssl-0.9.8g \
--with-libxml-dir=/usr/local/libxml2-2.7.8 \
--without-pdo-sqlite --without-sqlite3 --with-mysql=/usr/local \
--with-apxs2=/usr/local/apache24/bin/apxs
make && make install
cp php.ini-production /usr/local/php-5.6.40/lib/php.ini
cd ..
tar -xvf m4-1.4.18.tar.gz
cd m4-1.4.18
./configure --prefix=/usr/local/m4-1.4.18
make && make install
cd ..
tar -xvf autoconf-2.69.tar.gz
cd autoconf-2.69
setenv M4 /usr/local/m4-1.4.18/bin/m4
./configure --prefix=/usr/local/autoconf-2.69
make && make install
cd ..
tar xvf xdebug-2.5.4.tgz
cd xdebug-2.5.4
setenv PHP_AUTOCONF /usr/local/autoconf-2.69/bin/autoconf
setenv PHP_AUTOHEADER /usr/local/autoconf-2.69/bin/autoheader
/usr/local/php-5.6.40/bin/phpize
./configure --enable-xdebug --with-php-config=/usr/local/php-5.6.40/bin/php-config
make && make install
cd ..
#!/bin/sh
# PROVIDE: nmbd smbd
# PROVIDE: winbindd
# REQUIRE: NETWORKING SERVERS DAEMON ldconfig resolv
# REQUIRE: cupsd
# BEFORE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
#samba_enable="YES"
# or, for fine grain control:
#nmbd_enable="YES"
#smbd_enable="YES"
# You need to enable winbindd separately, by adding:
#winbindd_enable="YES"
#
# Configuration file can be set with:
#samba_config="/usr/local/samba-3.6.25/lib/smb.conf"
#
. /etc/rc.subr
name="samba"
rcvar=`set_rcvar`
samba_prefix="/usr/local/samba-3.6.25"
load_rc_config "${name}"
# Custom commands
extra_commands="reload status"
start_precmd="samba_start_precmd"
start_cmd="samba_cmd"
stop_cmd="samba_cmd"
status_cmd="samba_cmd"
restart_precmd="samba_checkconfig"
reload_precmd="samba_checkconfig"
reload_cmd="samba_reload_cmd"
rcvar_cmd="samba_rcvar_cmd"
# Defaults
samba_enable="${samba_enable:=NO}"
samba_config_default="${samba_prefix}/lib/smb.conf"
samba_config="${samba_config=${samba_config_default}}"
command_args="${samba_config:+-s "${samba_config}"}" #"
samba_daemons="nmbd smbd"
samba_daemons="${samba_daemons} winbindd"
testparm_command="${samba_prefix}/bin/testparm"
smbcontrol_command="${samba_prefix}/bin/smbcontrol"
# Fetch parameters from configuration file
samba_parm="${testparm_command} -s -v --parameter-name"
samba_idmap=$(${samba_parm} 'idmap uid' ${samba_config:+"${samba_config}"} 2>/dev/null)
samba_lockdir=$(${samba_parm} 'lock directory' ${samba_config:+"${samba_config}"} 2>/dev/null)
# Setup dependent variables
if [ -n "${rcvar}" ] && checkyesno "${rcvar}"; then
nmbd_enable="${nmbd_enable=YES}"
smbd_enable="${smbd_enable=YES}"
# Check that winbindd is actually configured
if [ -n "${samba_idmap}" ]; then
winbindd_enable="${winbindd_enable=YES}"
fi
fi
# Hack to work around name change of pid file with non-default config
pid_extra=
if [ -n "${samba_config}" -a "${samba_config}" != "${samba_config_default}" ]; then
pid_extra="-$(basename "${samba_config}")"
fi
# Hack to enable check of dependent variables
eval real_${rcvar}="\${${rcvar}:=NO}" ${rcvar}="YES"
# Defaults for dependent variables
nmbd_enable="${nmbd_enable:=NO}"
nmbd_flags="${nmbd_flags=\"-D\"}"
smbd_enable="${smbd_enable:=NO}"
smbd_flags="${smbd_flags=\"-D\"}"
winbindd_enable="${winbindd_enable:=NO}"
winbindd_flags="${winbindd_flags=''}"
if [ -n "${samba_lockdir}" -a ! -e "${samba_lockdir}" ]; then
mkdir -p "${samba_lockdir}"
fi
# Requirements
required_files="${samba_config}"
required_dirs="${samba_lockdir}"
samba_checkconfig() {
echo -n "Performing sanity check on Samba configuration: "
if "${testparm_command}" -s ${samba_config:+"${samba_config}"} >/dev/null 2>&1; then
echo "OK"
else
echo "FAILED"
return 1
fi
}
samba_start_precmd() {
# XXX: Never delete winbindd_idmap, winbindd_cache and group_mapping
if [ -n "${samba_lockdir}" -a -d "${samba_lockdir}" ]; then
echo -n "Removing stale Samba tdb files: "
for file in brlock.tdb browse.dat connections.tdb gencache.tdb \
locking.tdb messages.tdb namelist.debug sessionid.tdb \
unexpected.tdb
do
rm "${samba_lockdir}/${file}" </dev/null 2>/dev/null && echo -n '.'
done
echo " done"
fi
}
samba_rcvar_cmd() {
# Prevent recursive calling
unset "${rc_arg}_cmd" "${rc_arg}_precmd" "${rc_arg}_postcmd"
# Check master variable
echo "# ${name}"
if [ -n "${rcvar}" ]; then
# Use original configured value
if checkyesno "real_${rcvar}"; then
echo "\$${rcvar}=YES"
else
echo "\$${rcvar}=NO"
fi
fi
# Check dependent variables
samba_cmd "${_rc_prefix}${rc_arg}" ${rc_extra_args}
}
samba_reload_cmd() {
local name rcvar command pidfile
# Prevent recursive calling
unset "${rc_arg}_cmd" "${rc_arg}_precmd" "${rc_arg}_postcmd"
# Apply to all the daemons
for name in ${samba_daemons}; do
rcvar=$(set_rcvar)
command="${samba_prefix}/sbin/${name}"
pidfile="${samba_lockdir}/${name}${pid_extra}.pid"
# Daemon should be enabled and running
if [ -n "${rcvar}" ] && checkyesno "${rcvar}"; then
if [ -n "$(check_pidfile "${pidfile}" "${command}")" ]; then
debug "reloading ${name} configuration"
echo "Reloading ${name}."
# XXX: Hack with pid_extra
"${smbcontrol_command}" "${name}${pid_extra}" 'reload-config' ${command_args} >/dev/null 2>&1
fi
fi
done
}
samba_cmd() {
local name rcvar command pidfile samba_daemons
# Prevent recursive calling
unset "${rc_arg}_cmd" "${rc_arg}_precmd" "${rc_arg}_postcmd"
# Stop processes in the reverse to order
if [ "${rc_arg}" = "stop" ] ; then
samba_daemons=$(reverse_list ${samba_daemons})
fi
# Apply to all the daemons
for name in ${samba_daemons}; do
rcvar=$(set_rcvar)
command="${samba_prefix}/sbin/${name}"
pidfile="${samba_lockdir}/${name}${pid_extra}.pid"
run_rc_command "${_rc_prefix}${rc_arg}" ${rc_extra_args}
done
}
run_rc_command "$1"
tar -xvf git-2.32.0.tar.gz
cd git-2.32.0
./configure --prefix=/usr/local/git-2.32.0
gmake && gmake install
ln -sf /usr/local/git-2.32.0/bin/git /usr/bin/git
cd ..
<VirtualHost *:80>
ServerName localhost
DocumentRoot "/usr/local/www/test/"
<Directory "/usr/local/www/test/">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>