Archive for the ‘Server’ Category

vmware server 1.09 on Debian 5

Prerequisites: clean Debian 5 installation (preferably from netinstall disc) on at least 1GHZ/512MB RAM, reliable Internet connection

I did the install over SSH, so that I don’t have to stand in front of my server rack. This experiment was conducted for a vmware server based virtual private server venture that I may be going in on with George Sawyer. He needed quickly deployable web environments for the classes he teaches.

Copy/Paste Code block

apt-get install linux-headers-`uname -r` libx11-6 libx11-dev x-window-system-core x-window-system xspecs libxtst6 psmisc build-essential xinetd gcc-4.1 g++-4.1
ln -sf /usr/bin/gcc-4.1 /usr/bin/gcc
wget http://download3.vmware.com/software/vmserver/VMware-server-1.0.9-156507.tar.gz
tar xzvf VMware-server-1.0.9-156507.tar.gz
cd vmware-server-distrib/
./vmware-install.pl
[ !-- follow the instructions. the defaults should be just fine. --! ]
cd ..
wget http://vraidsys.com/software/vmware-update-2.6.26-5.5.7.tgz.gz
tar -xzvf vmware-update-2.6.26-5.5.7.tgz.gz
cd vmware-update-2.6.26-5.5.7
./runme.pl
[ !-- follow the instructions. the defaults should be just fine. --! ]
cd ..
rm -fdr /tmp/*
rm -fdr vmware*
rm -fdr VMware*
shutdown -r now

Edited July 30, 2009

Here is what just happened:
1) all the dependencies were installed first
2) then a system link was created so that the old version of gcc is used that is compatible with the kernel headers
3) the vmware server software is downloaded and installed.
4) you should reach a point in the installation where the process errors out installing the vmmon module.
5) use the patcher to override some dependency stuffs that can’t be fixed.
6) once the process is done, remove the installation files, and then restart the system to free up the memory used by the installation procedure.

vmware on debian 5

This will get vmware going on your Debian 5 box.

add “contrib non-free” after “main” to the various lines in your /etc/apt/sources.list file

before running the vmware installer, do some dependency installs: apt-get install gcc g++ make perl psmisc linux-headers-`uname -r`

download from: https://www.vmware.com/tryvmware/p/download.php?p=workstation-l. login or register then select your download. I suggest installing via the rpm, in which case: apt-get install alien.

converting the rpm to a deb takes about 15 minutes, but it is easier than installing from a tarball (.tar.gz).
alien --to-deb --scripts [vmware-rpm-name].rpm
after about 1-5 minutes should output a deb file
at which point run the command: dpkg -i [vmware-pkg-name].deb
take another 5-10 minutes to install all the files

start via vmware command, be sure to be connected via vnc or in some sort of X-Window environment.

Apache2 with Perl, PHP, Python and Ruby on Debian 5

This install assumes a semi-clean Debian 5 install and some access to a root console. The node must have around 220MB ram +/- 20 MB (or a large swap partition and a fast hard drive). The initial installs of some of these services take a heavy toll on ram. Tweaking will be done to speed up the services. This is meant as a multi-user development server, not a production server. I will be working on getting this working on nginx, so the speed and performance will be much better. For ease of installation, apache2 will have to do.

To do this with <400MB of ram we need to keep the applications that apt-get installs from starting.

1) Create a file /usr/sbin/policy-rc.d containing:

#!/bin/sh
exit 101

2) chmod +x /usr/sbin/policy-rc.d

After that, packages will install correctly, but not start.

Once you’re done and ready to snapshot your pristine chroot/image, just delete that file. That will let the service start as normal on future boots.

http://ubuntuforums.org/showthread.php?t=856815

install everything we need in one big apt-get install command
apt-get install ssh mysql-server apache2 php5 phpmyadmin openssl vsftpd libapache2-mod-python libapache2-mod-ruby rubygems libapache2-mod-perl2 libapache2-mod-wsgi libapache2-reload-perl libapache2-request-perl libapache2-mod-fcgid libfcgi-ruby1.8 libmysql-ruby libapache2-mod-scgi ruby libzlib-ruby rdoc irb rubygems rails eruby

hostgator banner

Once the installation is done, remove “/usr/sbin/policy-rc.d” – rm /usr/sbin/policy-rc.d – so that the various applications will be able to start.

I don’t know a whole lot about exim4, so I just start it without messing with the config files.
/etc/init.d/exim4 start

edit mysql config file – /etc/mysql/my.cnf
I like to comment out the bind-address line so that I can access the mysql database remotely in my other test environments.
start it when done: /etc/init.d/mysql start

edit vsftpd config file to your liking – /etc/vsftpd.conf
and start it: /etc/init.d/vsftpd start

edit apache2 main configuration file so that it takes up less ram
vi /etc/apache2/apache2.conf

—- Start File Excerpt —-
#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 60

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to “Off” to deactivate.
#
KeepAlive Off

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15

##
## Server-Pool Size Regulation (MPM specific)
##

# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_prefork_module>
StartServers          1
MinSpareServers       1
MaxSpareServers       1
MaxClients            3
MaxRequestsPerChild  20
</IfModule>

# worker MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_worker_module>
StartServers          1
MaxClients           20
MinSpareThreads      25
MaxSpareThreads      75
ThreadsPerChild      25
MaxRequestsPerChild  20
</IfModule>
—- End File Excerpt —-

enable various apache2 modules that we need
a2enmod ssl
a2enmod rewrite
a2enmod suexec
a2enmod include

edit apache vhost configuration file [/etc/apache2/sites-available/default] or .htaccess file to enable perl, python, and ruby. php should already be setup and good to go.

—- Start File Excerpt —-
<VirtualHost *:80>
ServerAdmin jzerbe@lizardking.biz
DocumentRoot /home/jason/www/
<Directory /home/jason/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
AddHandler mod_python .py
PythonHandler mod_python.publisher
PythonDebug On
</Directory>
<Directory /home/jason/www/>
Options +ExecCGI
AddHandler cgi-script rb cgi pl
</Directory>
</VirtualHost>

—- End File Excerpt —-

finally start apache2
/etc/init.d/apache2 start

To test that this works, try the following test scripts: test.rb, test.pl, test.py, and test.php.

For more information about the ruby on rails installation see this howtoforge.com article.

On a side note: I was doing this on a vmware node and ran out of space, expanding a vmdisk is pretty easy to do: 1) cd into VMware Workstation/Server directory 2) vmware-vdiskmanager -x [500MB/5GB/etc.] "[path to vmdisk].vmdk" 3) program expands virtual disk.

Return top