OpenBSD + Vhosting
Vhosting on any *NIX OS is almost the same
some files got a new name and in a new localtation from normal

this is just an continue on from the openBSD + myDNS back/front end

we really dont want to leave the admin tools for our SQL server and mydns in the default htdocs folder
for any old tom / dick and bill to have access rights to and maybe crack / guess our passwords

so lets start


we need to setup our DNS recoard in mydns now
so we open up in your web browser
we log in , with our admin / admin < unless you have changed it : good move : if not please change it ASAP >

if you change the password you can skip this area and continue on with the

Password / Add User

ok lets first change the default password of the admin user
and setup our own user,

once you are log in then click on system tab
then click on Add user which is under the CP Users
type in an username / password
pick from the Module list : dns
Startmodule : dns

then click on speichern

once you setup your user
then clikc on the admin
then in the password box type in a new password
and click on the speichern button
then click on logout
then login with your username

Add New Zone

click on the button called
Add New Zone

type in
Origin : admin.lan.
then click on save

then click on the admin.lan. link
Records tab
Add New Record

** change my IP of : with your IP there to make it work **

Name                       : sql
type                          : A
Data                         :
Preference/Priority    :
TTL                          : 86400
then click on save

repeat the same steps for the mydns Record
just replace the sql with mydns
everything else is the same

REMEMBER : to add the IP of your MyDNS box to your windows TCP/IP- DNS list
to make it work OR! you going to get and error every time you try

now we took care mydns
lets get down and dirty

lets setup an user
so we can edit / unpack any files into the htdocs of our Vhost sites
if we need to

# adduser
Couldn't find /etc/adduser.conf: creating a new adduser configuration file
Reading /etc/shells
Enter your default shell: csh ksh nologin sh [ksh]:
Your default shell is: ksh -> /bin/ksh
Default login class: authpf daemon default staff [default]:
Enter your default HOME partition: [/home]:
Copy dotfiles from: /etc/skel no [/etc/skel]:
Send message from file: /etc/adduser.message no [no]:
Do not send message
Prompt for passwords by default (y/n) [y]:
Default encryption method for passwords: auto blowfish des md5 old
Use option ``-silent'' if you don't want to see all warnings and questions.

Reading /etc/shells
Check /etc/master.passwd
Check /etc/group

Ok, let's go.
Don't worry about mistakes. There will be a chance later to correct any input.
Enter username []:   zcworld
Enter full name []: Shane
Enter shell csh ksh nologin sh [ksh]:
Uid [1000]:
Login group zcworld [zcworld]: www
Login group is ``www''. Invite zcworld into other groups: guest no
Login class authpf daemon default staff [default]: default
Enter password []: *******
Enter password again []: *********

Name:        zcworld
Password:    ****
Fullname:    Shane
Uid:         1000
Gid:         67 (www)
Groups:      www
Login Class: default
HOME:        /home/zcworld
Shell:       /bin/ksh
OK? (y/n) [y]: y
Added user ``zcworld''
Copy files from /etc/skel to /home/zcworld
Add another user? (y/n) [y]: n

then run as root user

chown -R zcworld:www /var/www/

this will let our username have access rights to the www folder

then log in with our account "zcworld"
*** REMEMBER to replace zcworld with your account name *** 

once done, we now go onto making foldershere is an list of what each folder job is
folders : admin.lan -> where our admin tools goes
          : htdocs -> where we put out files to so we can see them on the webserver

mkdir -p /var/www/vhosts/sql.admin.lan/htodcs
mkdir -p /var/www/vhosts/mydns.admin.lan/htdocs

Vhost Conf files

mkdir -p /var/www/conf/vhosts
cd /var/www/conf/vhosts

copy and paste this into the putty window then push esc twice and :wq
to write and quit

repeat with the mydns as

vi sql.admin.lan.conf

<VirtualHost *>
    ServerName sql.admin.lan
    DocumentRoot /var/www/vhosts/sql.admin.lan/htdocs
      CustomLog /var/www/logs/sql.admin.lan_access.log combined
      ErrorLog /var/www/logs/sql.admin.lan_error.log

vi mydns.admin.lan.conf

<VirtualHost *>
        ServerName mydns.admin.lan
        DocumentRoot /var/www/vhosts/mydns.admin.lan/htdocs
        CustomLog /var/www/logs/mydns.admin.lan_access.log combined
        ErrorLog /var/www/logs/mydns.admin.lan_error.log

vi /var/www/conf/httpd.conf

add this to the bottom of the file


NameVirtualHost *
include /var/www/conf/vhosts/*.conf

esc twice and :wq

apachectl stop
httpd -u


any errors ?
if no errors : WOoT

once last step
this is to step the access rights on the vhosts and sub folders

chown -R www:www /var/www/vhosts
chmod -R 775 /var/www/vhosts

vi /var/www/vohsts/mydns.admin.lan/htdocs/index.htm

put in there anything you like
welcome to the mydns Vhost

time to see if they work
opne you your browser
and type in
then try

if you get something like this

you know that both of the Vhost are working fine

as bad as forbidden looks and sounds
its all good
ok time for the fun part

mv /var/www/vhosts/mydns.admin.lan/htdocs/* /tmp
mv /var/www/htdocs/phpMyAdmin/* /var/www/vhosts/sql.admin.lan/htdocs/
mv /var/www/htdocs/mydns/* /var/www/vhosts/mydns.admin.lan/htdocs/

time to fix the mydns to make it work again

jed /var/www/vhosts/mydns.admin.lan/htdocs/lib/

line 33
change it to

$conf["rootpath"]         = "/var/www/vhosts/mydns.admin.lan/htdocs/";

save and exit

then open up in your web browser

and you should be able to see and use them :)

now that the defualt folder is empty
i would put an empty index file in there saying like
nothing to see move again

vi /var/www/htdocs/index.htm

Nothing To See <BR>
Move Alone <BR>
Move Alone

esc twice :wq

closing note
just do an check of the /var/www/
fort any files leave over there
like the mydnsconfig folder and .tar.gz file
and in the htdocs
the old PhpMyDns and mydns folder
just move them to the /tmp folder
and they will be taken care of when you reboot the system next time
dont put to much junk in there
it will take longer to boot if there is an heap of junk in there

Click the Home Tab to go back to the Homepage

THis Page is powered by Dolphin Tabs Menu- by JavaScript Kit


if you want to see any howto or want to email me an thanks
or ask to use work on any website or anything else
email me here>> Email Me <<

remove the -SPAM-FREE-Zone part out of the address