Openvz + fedora 17 32 bit container setup guide

Post Reply
syleishere
Posts: 1
Joined: Wed Nov 07, 2012 10:39 am

Openvz + fedora 17 32 bit container setup guide

Post by syleishere » Wed Nov 07, 2012 3:47 pm

#install 32 bit version of fedora, we need latest gcc which centos etc don't use
yum install nano
alias pico='nano -w'
cd /vz/templates/cache
wget http://download.openvz.org/template/pre ... x86.tar.gz
vzctl create 104 --ostemplate fedora-17-x86
pico /etc/vz/conf/104.conf
****************at a bare minimum at least add/edit these*********************
DISKSPACE="10G:20G"
OSTEMPLATE="fedora-17-x86"
ONBOOT="yes"
HOSTNAME="blah.blah.com"
IP_ADDRESS="1.1.1.1"
NAMESERVER="8.8.8.8 4.2.2.2"
*****************************************************************************
vzctl enter 104
#change your timezone to something appropriate for you
cp /usr/share/zoneinfo/America/Winnipeg /etc/localtime
chkconfig rpcbind off
chkconfig httpd off
chkconfig sendmail off
chkconfig saslauthd off
chkconfig xinetd off
chkconfig nscd on
chkconfig rc-local on
service rpcbind stop
service httpd stop
service sendmail stop
service saslauthd stop
service xinetd stop
service nscd start
touch /etc/rc.d/rc.local; chmod 755 /etc/rc.d/rc.local

yum update
yum install gcc gcc-c++ pkgconfig mysql mysql-devel mysql-libs mysql-server mysqlreport subversion vim screen patch autogen automake autoconf lua lua-devel
chkconfig mysqld on
service mysqld start
mysql -u root
-----------------------------------------------------------------------------------------
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('love');
SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('love');
DROP USER ''@'localhost';
create user 'dspdb'@'localhost' IDENTIFIED BY 'ffxi';
create database dspdb;
GRANT USAGE ON * . * TO 'dspdb'@'localhost' IDENTIFIED BY 'ffxi' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
GRANT ALL PRIVILEGES ON `dspdb` . * TO 'dspdb'@'localhost';
exit;
-----------------------------------------------------------------------------------------
svn co http://onetimexi.googlecode.com/svn/trunk/ dsp/
lynx http://forums.dspt.info/download/file.php?id=29 (download dssearchv6.zip)
unzip dssearchv6.zip
cp dssearchv6.diff dsp
cd dsp
patch -p0 -i dssearchv6.diff
sh autogen.sh
./configure --enable-debug LUA_LIBS=/usr/lib LUA_CFLAGS=llua
(if it breaks on mysql error do following:)
pico Makefile
*******************************************************************************************
FROM:
LIBS_ALL = $(DARKSTAR_LIBS) $(LIBS_LUA) -llua $(LIBS_MYSQL) \
-lmysqlclient $(am__append_1) $(am__append_2)

TO:
LIBS_ALL = $(DARKSTAR_LIBS) $(LIBS_LUA) -llua $(LIBS_MYSQL) \
-L/usr/lib/mysql -lmysqlclient -lpthread $(am__append_1) $(am__append_2)
*******************************************************************************************
(if breaks on error: src/map/zoneutils.cpp:92:22: error: unable to find string literal operator ‘operator"" CL_RESET )
pico src/map/zoneutils.cpp (change ShowDebug(CL_CYAN"UpdateWeather Finished\n"CL_RESET); to ShowDebug(CL_CYAN"UpdateWeather Finished\n" CL_RESET);
#install application
make install
#next for IP address you want to use for server need to convert it to decimal then reverse the numbers
#http://www.allredroster.com/iptodec.htm (take this site put in IP address octets backwards to get numbers)
#this one is for 192.168.0.101=1694542016
-----------------------------------------------------------------------------------------
cd sql
for f in *.sql
do
echo -n "Importing $f into the database..."
mysql -u dspdb -pffxi dspdb < $f && echo "Success"
done
cd ..
-----------------------------------------------------------------------------------------
mysql -udspdb -Ddspdb -pffxi
-----------------------------------------------------------------------------------------
UPDATE zone_settings SET zoneip = '1694542016';
quit
-----------------------------------------------------------------------------------------
cd conf
(change mysql user to dspdb and mysql password to ffxi for all files in here)
adduser darkstar
#start it all up, do NOT use a root user:
cp -rp dsp /home/darkstar; chown -R darkstar:darkstar /home/darkstar/dsp
su - darkstar
cd dsp (it looks for conf directory in your current directory)
alias pico='nano -w'
pico runme.sh
#Create a bash script, we add sleeps because rc.local won't execute commands
#that quickly on reboots and likely only one will start then
(add the following to file:)
#!/bin/bash

sleep 5; screen -d -m -S dsconnect ./dsconnect
sleep 5; screen -d -m -S dsgame ./dsgame
sleep 5; screen -d -m -S dssearch ./dssearch
#change perms
chmod 755 runme.sh
#start it from now on just with ./runme.sh
./runme.sh
#check on the programs as you wish:
screen -r dsconnect
screen -r dsgame
screen -r dssearch
(CTRL-a-d) to detach from screen session again
#finish up and start game server on reboots
(go back to root: exit)
pico /etc/rc.d/rc.local
(add the following to file:)
#!/bin/bash

echo "Starting Final Fantasy 11"
(su -m darkstar -c "cd /home/darkstar/dsp; ./runme.sh")
#great now lets exit openvz container and re-enter to make sure everything is great:
exit
vzctl restart 104
vzctl enter 104
ps aux (check all 3 screen sessions are running and your perfect!)

Post Reply