FreeVSD FAQ by Ben Kennish |
![]() |
$add_ons = "/usr/share/freevsd/pkgs"./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --with-siteconf=./site/linux-redhat --enable-addons=./freevsd-pkgs
cvs -d:pserver:anonymous@cvs.freevsd.org:/usr/local/cvsroot login
(type anonymous as password)
cvs -d:pserver:anonymous@cvs.freevsd.org:/usr/local/cvsroot checkout freevsd
cvs -d:pserver:anonymous@cvs.freevsd.org:/usr/local/cvsroot update -Pd
Note that as is with most CVS versions of any software, its probably not a good idea to use in live environments without considerable testing first (work is continuously in development and there's no guarantees that when you get the source that some features might be broken as Idaya work on others.) Instead you should use the latest stable release from standard FTP.
/home/vsd/skel/default/etc/httpd/conf/httpd.conf for an example.) Also, some files are hard-linked into the skel (ie the skel file and the VS files are one and the same part of the hard disk) whereas other files (like those in /etc/) are just copied from the skel to the VS at VS-creation time.
find /home/vsd/ -links +1 ! -type d ! -type l -printf "%i\t%n\t%p\n" | sortcp -R /home/vsd/skel/myskel /home/vsd/skel/myskel2.
cp -R /var/lib/rpm /home/vsd/skel/mysql2/rpm -ivh myrpm.rpm --root /home/vsd/skel/myskel2configure for your source install, specify the skel directories as your install location.
(s)vsdadm part_skeladd host.server.fqdn myskel2 1
vsd-linkvs.pl to move the VSs to the new skel (preferrably move some test ones first and check that everything went OK!/sbin/chkconfig --add httpd/sbin/chkconfig --level 345 httpd on
chmod 4711 /usr/sbin/suexecchmod 4711 /path/to/skel/usr/sbin/suexec
# Start Apache web server (as root)
httpd_enable="YES"
if [ "${httpd_enable}" = "YES" ]; then
echo -n 'starting web server: '
if [ -x "/bin/httpd" ]; then httpd_path="/bin/httpd"; fi
if [ -x "/usr/sbin/httpd" ]; then httpd_path="/usr/sbin/httpd"; fi
if [ -x "/usr/libexec/httpd" ]; then httpd_path="/usr/libexec/httpd"; fi
${httpd_path} -D SSL &
echo 'httpd'
fi# Start Apache web server
if [ "${httpd_enable}" = "YES" ]; then
echo -n 'starting web server: '
if [ -x "/bin/httpd" ]; then httpd_path="/bin/httpd"; fi
if [ -x "/usr/sbin/httpd" ]; then httpd_path="/usr/sbin/httpd"; fi
if [ -x "/usr/libexec/httpd" ]; then httpd_path="/usr/libexec/httpd"; fi
su - web -c "${httpd_path} -D SSL" &
echo 'httpd'
fi
<Virtualhost example.com>
Servername example.com
Documentroot /home/example
Port 80
</Virtualhost>
# ipchains -A input --dst 1.2.3.4 --dport 80 -p tcp -j REDIRECT 8081# ipchains -A input --dst 1.2.3.4 --dport 80 -p udp -j REDIRECT 8081
# ipchains -A input --dst 1.2.3.5 --dport 80 -p tcp -j REDIRECT 8082# ipchains -A input --dst 1.2.3.5 --dport 80 -p udp -j REDIRECT 8082
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
iptables -t nat -A PREROUTING -p udp --dport 80 -j REDIRECT --to-port 8080
iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 8443
iptables -t nat -A PREROUTING -p udp --dport 443 -j REDIRECT --to-port 8443
NB: This will also cause port 80 requests to the host server to be redirected to port 8080 so it will be necessary to ensure that the host server's Apache is listening on port 8080 instead.
# Start MySQL server
if [ "${mysql_enable}" = "YES" ]; then
if [ ! -d "/var/lib/mysql" ]; then
echo 'Initilializing MySQL Database'
/usr/sbin/useradd -d /var/lib/mysql mysql
su - mysql -c "/usr/bin/mysql_install_db"
echo 'Database Initialised'
fi
if [ -d "/var/lib/mysql" ]; then
echo -n 'Starting MySQL Server: '
su - mysql -c "/usr/bin/safe_mysqld --bind-address=`hostname -i`">/dev/null 2>&1 &
echo 'mysqld'
fi
fi# Set to YES to enable MySQL
mysql_enable="YES"# Start PostgreSQL server
if [ "${postgresql_enable}" = "YES" ]; then
if [ -d "/var/lib/postgres" ]; then
echo -n 'starting postgresql server: '
(postmaster -D /var/lib/postgres -p ${postgresql_port} -B 256 2>&1 | logger -p local5.notice) &
echo 'postgres'
fi
fi# Set to YES to enable PostgreSQL
postgresql_enable="NO"
postgresql_port=NONEauth required /lib/security/pam_vsd.so priv=telnet
netstat -lt | egrep "*:s?vsd"
and if you don't get an entry, freeVSD isn't running properly. Ensure that you have run vsd-install as this should setup (x)inetd properly for you.only_from = 127.0.0.1/32netstat --numeric-hosts -lt on the host server (0.0.0.0 means all IP addresses) and looking out for the right port. You'll need to either stop the daemon on the host server (if it's not necessary) or ensure that it's configured to only listen on the IP address of your host server.
NameVirtualHost ip.addr.of.server
<VirtualHost ip.addr.of.server>
ServerName fqdn.of.server
ServerAlias other.aliases go.here
DocumentRoot /home/httpd/html/whatever
<Location location/of/vsdadms_index.phtml/relative/to/DocumentRoot>
(Stuff mentionned in vsdadm READMEs)
</Location>
</VirtualHost>
vsdclient.exe -NOSSL/sbin/ipchains -N [vsname]
/sbin/ipchains -I input -j [vsname]
/sbin/ipchains -I output -j [vsname]
/sbin/ipchains -A [vsname] -s [vsip]/255.255.255.255 -p all
/sbin/ipchains -A [vsname] -d [vsip]/255.255.255.255 -p all/sbin/ipchains -L [vsname] -v" will now give you info on bytes in/out since the chain was created (you can output
this to a script or whatever.)/sbin/ipchains -Z [vsname]" will reset the counter to zero.