Wednesday, September 24, 2008

configure VNC to disaply x:0 on Fedora Core 9

i had to enable VNC x:0 on my box at home...

this is how i did it...

Don't forget to create a backup for every file that you edit/change...


i have edited "xorg.conf"

Section "Screen"
Identifier "Screen0"
Device "Videocard0"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 24
EndSubSection
Option "SecurityTypes" "VncAuth"
Option "UserPasswdVerifier" "VncAuth"
Option "PasswordFile" "/home/Yaniv/.vnc/passwd"

EndSection
I have added the 3 last Options:

Option "SecurityTypes" "VncAuth"
Option "UserPasswdVerifier" "VncAuth"
Option "PasswordFile" "/home/Yaniv/.vnc/passwd"


i had to change the PasswordFile path to my password file...


also i had to create a new section

Section "Module"
Load "vnc"
EndSection



i did a reboot and every thing worked...

the result is i can VNC to my box and every thing i do can be seen on the monitor
this is called display 0

good luck
Yaniv Ferszt

Tuesday, September 23, 2008

enable public_html and use .htaccess and .htpasswd for security

so after installing at home the FC9 box i configured the "httpd.conf" to enable access to
"public_html" directory's and support for ".htaccess" and ".htpasswd" files.

this is how i did it... there are many other ways to configure it... this is my solution :-)

NOTE: create a backup for every file BEFORE YOU EDIT OR CHANGE IT.

enable "public_html"

edit httpd.conf
you have to enable "UserDir public_html "so search it and uncomment it.
also you MUST remove the "UserDir disable" line above (search it).

verify that "LoadModule userdir_module modules/mod_userdir.so" is enabled...
uncomment it if you have to...

in order that apache can access your home dir you have to grant it permissions to do so
this is ls -ld on my home dir.

"drwx-----x 48 Yaniv Yaniv 4096 2008-09-22 21:04 Yaniv"

you have to grant others execute permissions... so use
"chmod 701 your_home_dir" to grand others read on the folder.

create the "public_html" folder inside your home dir.
it must be with 755 permissions.
"drwxr-xr-x 2 Yaniv Yaniv 4096 2008-09-22 16:14 public_html/"

restart apache and thats it.
"/etc/init.d/httpd restart"


.htaccess and .htpasswd
ok lets configure user name and password authentication for "public_html" or every other folder inside it.


edit httpd.conf and search for:
# First, we configure the "default" to be a very restrictive set of
# features.

right below it should be some ""
change it to look like this:


Options Indexes FollowSymLinks
AllowOverride All
NOT REQUIRED (i think so) i have enabled it...
Indexes = it will enable the users that is accessing your_url.com/~user_name/ to see the content...
FollowSymLinks = enables you to create links and they are working...

REQUIRED

AllowOverride All = can be changed to be more specific settings... i have used All

save the changes... and restart apache.

now lets cd to your "public_html" folder

create file named ".htaccess" the dot is a MUST
edit the file (i use vi) and place this inside:
AuthUserFile /your_home_directory/public_html/.htpasswd
AuthName "Title for Protected Site"
AuthType Basic
Require valid-user


AuthUserFile = change the path to your home dir path with /.htpasswd that we will create soon :-)
AuthName = place some tilte there... Welcome to my site... bla bla
AuthType Basic = leave it
Require valid-user = leave it

save the changes and close the file.

now use the htpasswd command to create the ".htpasswd" file.

htpasswd -c .htpasswd your_name

this will create the ".htpasswd" file with your name and your password
the password is encrypted inside the .htpasswd file... :-)

to create more users... lets say you would like to give a friend access to this folder with his own credentials
just cd to the folder where the ".htpasswd" is we just created and use:
htpasswd .htpasswd his_name

and thats it.

now change the permissions for both files
".htaccess"
".htpasswd"
to "644"

it should look like this:
-rw-r--r-- 1 Yaniv Yaniv 103 2008-09-22 16:11 .htaccess
-rw-r--r-- 1 Yaniv Yaniv 58 2008-09-22 20:47 .htpasswd


it should work now...

good luck
Yaniv Ferszt






Tuesday, September 9, 2008

Installing the vx 6000 webcam on Fedora core 9

After google-ing and reading i got my MS webcam vx-6000 working on Fedoracore9

I found the solution that worked for me here
quick installation guide:


  • yum install git kernel-devel gcc

From a command-line prompt, cd to a directory where you want to download it, then run the command:
  • git clone http://repo.or.cz/r/microdia.git
This will create a folder named "microdia" which contains all the source code.
  • cd microdia
also i found out that you have to edit macrodia.h before compiling... read more here
  • vi microdia.h
i had to change 2 values...
modify the Vendor Id with the code of Microsoft 045E and
the Product Id of the model 624F with 00F4.
it has to look like this DO NOT COPY PASTE:

#define USB_0C45_VID 0x045e /** Vendor ID of MICRODIA

#define USB_624F_PID 0x00f4 SN9C201 + OV9650


Attention: Do _NOT_ under any circumstances use "$ sudo make".
There are no root privileges necessary at this point and
using them causes a never ending chain of different problems lateron.

  • make

Troubleshooting MAKE errors look here
or
http://groups.google.com/group/microdia/web/testing-microdia-driver-draft
you should find some answers almost at the bottom...


I used "cheese" to test my web cam... you can find it with yum...
  • yum search cheese

if every thing worked for you... you would like the microdia.ko to get loaded at boot right?

here we go:

  • strip -g microdia.ko
  • sudo cp microdia.ko /lib/modules/`uname -r`/kernel/drivers/media/video/usbvideo/
  • sudo depmod -a
also i had this error and i solved it with this:
http://groups.google.com/group/microdia/web/testing-microdia-driver-draft

Troubleshooting insmod errors

# insmod microdia.ko
insmod: error inserting 'microdia.ko': -1 Unknown symbol in module

See the output of #dmesg

the last few lines would be complaints about missing symbols, depending upon whats missing

you may not have loaded the modules that module depends on,
So it failed with those error messages. You would need to modprobe for that module's dependencies

Try

$ sudo modprobe videodev

$ sudo modprobe compat-ioctl32

then

$ sudo insmod microdia.ko

good luck :-)
Yaniv Ferszt