Dre4m Shell
Server IP : 85.214.239.14  /  Your IP : 18.227.0.21
Web Server : Apache/2.4.62 (Debian)
System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.18
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /proc/3/root/usr/share/doc/apache2/examples/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /proc/3/root/usr/share/doc/apache2/examples/setup-instance
#!/bin/sh

set -eu

if [ $# != 1 ] ; then
	echo usage: $0 '<suffix>'
	exit 1
fi

is_systemd () {
	case "$(readlink -f /proc/1/exe || true)" in
	*systemd*)
		return 0
		;;
	*)
		return 1
		;;
	esac
}

# the SUFFIX must not contain spaces or shell meta characters
SUFFIX=$1

if [ -e /etc/apache2-$SUFFIX ] ; then
	echo ERROR: /etc/apache2-$SUFFIX already exists
	exit 2
fi

echo Setting up /etc/apache2-$SUFFIX ...
cp -a /etc/apache2 /etc/apache2-$SUFFIX

if is_systemd ; then
    echo "systemd is in use, no init script installed"
    echo "use the 'apache2@$SUFFIX.service' service to control your new instance"
    echo "sample commands:"
    echo "systemctl start apache2@$SUFFIX.service"
    echo "systemctl enable apache2@$SUFFIX.service"
else
    echo "Setting up /etc/init.d/apache2-$SUFFIX ..."
    cp /usr/share/doc/apache2/examples/secondary-init-script /etc/init.d/apache2-$SUFFIX
    # adjust service name (this prevents us from using a simple symlink)
    perl -p -i -e s,XXX,$SUFFIX, /etc/init.d/apache2-$SUFFIX
    chmod 755 /etc/init.d/apache2-$SUFFIX
fi

echo -n Setting up symlinks: 
for a in a2enmod a2dismod a2ensite a2dissite a2enconf a2disconf apache2ctl ; do
	echo -n " $a-$SUFFIX"
	ln -s /usr/sbin/$a /usr/local/sbin/$a-$SUFFIX
done
echo

echo Setting up /etc/logrotate.d/apache2-$SUFFIX and /var/log/apache2-$SUFFIX ...
cp -a /etc/logrotate.d/apache2 /etc/logrotate.d/apache2-$SUFFIX
perl -p -i -e s,/var/log/apache2,/var/log/apache2-$SUFFIX,g /etc/logrotate.d/apache2-$SUFFIX
if is_systemd ; then
	perl -p -i -e "s,\sapache2\s, apache2\@$SUFFIX ,g" /etc/logrotate.d/apache2-$SUFFIX
else
	perl -p -i -e "s,\sapache2\s, apache2-$SUFFIX ,g" /etc/logrotate.d/apache2-$SUFFIX
fi
mkdir /var/log/apache2-$SUFFIX
chmod 750 /var/log/apache2-$SUFFIX
chown root:adm /var/log/apache2-$SUFFIX

echo "Setting up /etc/default/apache-htcacheclean-$SUFFIX"
cp -a /etc/default/apache-htcacheclean /etc/default/apache-htcacheclean-$SUFFIX

Anon7 - 2022
AnonSec Team