Kód: Vybrat vše
# /etc/profile.d/99common.sh
# Common bash settings as proxy, aliases etc.
### Midnight commander
if [ -f /usr/share/mc/mc.gentoo ]; then
. /usr/share/mc/mc.gentoo
fi
### Proxy
if ifconfig | fgrep -q 'dr:10.3.45.'
then
#Bouraci ucebna!
export http_proxy="http://proxy.ucebny:3128"
fi
export https_proxy="$http_proxy"
export no_proxy="localhost,127.0.0.1,biawd,it.fit.cvut.cz"
### XResources
export XAPPLRESDIR=/etc/X11/app-defaults
### editor
export EDITOR='vim'
export VISUAL='vim'
### Aliases
alias cp='cp -i'
alias ll='ls -lah'
alias ls='ls --color=auto'
alias mv='mv -i'
alias rm='rm -i'
#alias xterm='xterm -bg black -fs 15'
#alias urxvt='urxvt -ls'
alias man='LC_ALL=C LANG=C man'
Kód: Vybrat vše
# Priprava image
LC_ALL=C
LANG=C
for i in /sys/class/net/e*; do
grep -q '1' "$i"/carrier 2>/dev/null && {
IFACE="${i##*/}";
break;
}
done
# vytvoreni interface aliasu kvuli vhostingu
IP1=`ifconfig $IFACE | awk '/inet addr/ {split ($2, parts, "."); print parts[4]}'`
for SUB in {1..4}; do
ifconfig $IFACE:$SUB 172.16.$IP1.$SUB netmask 255.255.0.0
done
UKOL 1
http://apache.miloslavbrada.cz/httpd/
http://apache.miloslavbrada.cz/httpd/ht ... .29.tar.gz
cat /etc/profile.d/99common.sh
cat /etc/local.d/10-net.start
Kód: Vybrat vše
# Priprava image
LC_ALL=C
LANG=C
for i in /sys/class/net/e*; do
grep -q '1' "$i"/carrier 2>/dev/null && {
IFACE="${i##*/}";
break;
}
done
# vytvoreni interface aliasu kvuli vhostingu
IP1=`ifconfig $IFACE | awk '/inet addr/ {split ($2, parts, "."); print parts[4]}'`
for SUB in {1..4}; do
ifconfig $IFACE:$SUB 172.16.$IP1.$SUB netmask 255.255.0.0
done
------------------
Kód: Vybrat vše
wget http://apache.miloslavbrada.cz/httpd/httpd-2.2.29.tar.gz
tar xvzf httpd-2.2.29.tar.gz
cd httpd-2.2.29/
./configure && make && sudo make install
sudo /usr/local/apache2/bin/apachectl start
pgrep -l httpd
netstat -tl
google-chrome-stable localhost
/usr/local/apache2/bin/apachectl -l
#wait
# second copy pasta
sudo leafpad /usr/local/apache2/conf/httpd.conf
# third
sudo leafpad /usr/local/apache2/conf/extra/httpd-info.conf
sudo /usr/local/apache2/bin/apachectl restart
google-chrome-stable http://localhost/server-status
#wait
/usr/local/apache2/bin/apachectl stop
# NOT REQUIRED - hide localhost warnings
# ServerName localhost
# add into httpd.conf or apache2.conf in /etc/apache2 and restart apache
Kód: Vybrat vše
# Real-time info on requests and configuration
Include conf/extra/httpd-info.conf
Kód: Vybrat vše
#
# Get information about the requests being processed by the server
# and the configuration of the server.
#
# Required modules: mod_status (for the server-status handler),
# mod_info (for the server-info handler)
#
# Allow server status reports generated by mod_status,
# with the URL of http://servername/server-status
# Change the ".example.com" to match your domain to enable.
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from localhost
</Location>
#
# ExtendedStatus controls whether Apache will generate "full" status
# information (ExtendedStatus On) or just basic information (ExtendedStatus
# Off) when the "server-status" handler is called. The default is Off.
#
#ExtendedStatus On
#
# Allow remote server configuration reports, with the URL of
# http://servername/server-info (requires that mod_info.c be loaded).
# Change the ".example.com" to match your domain to enable.
#
<Location /server-info>
SetHandler server-info
Order deny,allow
Deny from all
Allow from .example.com
</Location>
Kód: Vybrat vše
sudo rm -rf /usr/local/apache2
make distclean
./configure --prefix=/opt/apache2 --with-mpm=worker --enable-info
echo $?
make && make install
/opt/apache2/bin/apachectl -l
/opt/apache2/bin/apachectl -t -D DUMP_MODULES -D DUMP_VHOSTS
#copy pasta 5
sudo leafpad /opt/apache2/conf/httpd.conf
#copy pasta 6
sudo leafpad /opt/apache2/conf/extra/httpd-info.conf
/opt/apache2/bin/apachectl start
google-chrome-stable http://localhost/ http://localhost/server-status http://localhost/server-info
Kód: Vybrat vše
# Real-time info on requests and configuration
Include conf/extra/httpd-info.conf
Kód: Vybrat vše
#
# Get information about the requests being processed by the server
# and the configuration of the server.
#
# Required modules: mod_status (for the server-status handler),
# mod_info (for the server-info handler)
#
# Allow server status reports generated by mod_status,
# with the URL of http://servername/server-status
# Change the ".example.com" to match your domain to enable.
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from localhost
</Location>
#
# ExtendedStatus controls whether Apache will generate "full" status
# information (ExtendedStatus On) or just basic information (ExtendedStatus
# Off) when the "server-status" handler is called. The default is Off.
#
#ExtendedStatus On
#
# Allow remote server configuration reports, with the URL of
# http://servername/server-info (requires that mod_info.c be loaded).
# Change the ".example.com" to match your domain to enable.
#
<Location /server-info>
SetHandler server-info
Order deny,allow
Deny from all
Allow from localhost
</Location>
UKOL 3
Kód: Vybrat vše
sudo leafpad /etc/init.d/apache2
sudo chmod +x /etc/init.d/apache2
sudo /etc/init.d/apache2 start
grep DocumentRoot /opt/apache2/conf/httpd.conf
cd /opt/apache2/htdocs
sudo leafpad index.html
google-chrome-stable http://localhost
sudo /etc/init.d/apache2 stop
Kód: Vybrat vše
#!/sbin/runscript
start() {
ebegin "Startuji apache2"
/opt/apache2/bin/apachectl start
eend $?
}
stop() {
ebegin "Zastavuji apache2"
/opt/apache2/bin/apachectl stop
eend $?
}
Funkci (akci) restart není možné v Gentoo předefinovat (bude vždy: stop a start). Je ale možné nadefinovat jinou funkci (např. restartdelay) a tu povolit pomocí extra_commands=„restartdelay“.