2010年10月13日 星期三

[筆記]Linux phpMyAdmin 無法成功連上



弄到快瘋掉啦= =









Apache安裝好後,php+MySql也下載好,php也放到/var/www/html/底下,可是卻一直有個錯誤無法正確執行phpMyAdmin。

原來是我的php.ini沒有extend msql.so and msqli.so.



首先到/etc/php.ini找到:

…………………

; Dynamic Extensions ;

………………..

extension=msql.so   <--把他原本的分號拿掉

extension=msqli.so  <--這行要加進去



把apache重開問題就解決了!!







參考文獻:http://mybruse.com/wordpress/

[筆記]在Linux Fedora上架設Apache以及一些相關設定



成功!!



若未安裝Apache,可以先執行以下指令:

yum list httpd



若要啟動Apache:

/sbin/service httpd start

若要停止Apache:

/sbin/service httpd stop



在Windows底下要更改php的一些相關設定,是在php.ini底下作設定。

在Linux底下則是在:/etc/httpd/conf.d/目錄下找相關的檔案去作設定。



一開始使用必須更換首頁。

STEP 1:修改設定檔

/etc/httpd/conf/httpd.conf 這裡面先將

DirectoryIndex index.html index.html.var  修改成

DirectoryIndex index.htm index.html index.html.var



STEP 2:防火牆的設定

/etc/sysconfig/iptables在這裡面必須家一行指令:

-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT

-A INPUT -p tcp --dport 80 -j ACCEPT  <--加入這一行

-A INPUT -j REJECT --reject-with icmp-host-prohibited



之後要執行的檔案必須放在: /var/www/html下,例如:index.html or db_conn.php etc.

那一開始的時候,這個根目錄底下是沒有東西的,所以我們在瀏覽器的網址列上打:localhost,會有個網頁跳出來,其實那是錯誤的。

當apache底下沒有檔案時,他會判斷成錯誤訊息而跳出那個網頁。

接著,在/etc/httpd/conf.d/welcome.conf,其中有四行前面加 "#" 號就可以了。

#<LocationMatch "^/+$">

#     Options -Indexex

    ErrorDocument 403 /error/noindex.html

#</LocationMatch>

然後重新啟動apache:

/sbin/ service httpd restart

就完成了。







以上修改檔案內容與新增檔案到資料夾,都必須先把檔案或是資料夾的權限打開。

1. 打開終端機

2. su

3. 輸入密碼

4. 找到檔案或資料夾的位置

5. chmod 777 檔案名稱/資料夾名稱

這樣才能修改與儲存檔案,新增/刪除資料夾內的檔案。



2010年10月6日 星期三

[轉貼]Linux Skype webcam upside-down

[轉貼自] http://tpurch-blog.blogspot.com/2010/02/webcam-upside-down.html



Suffering from upside down Webcam?



Well your not the only one. It appears that its a common problem!



Some manufacturers mount the webcam upside down...In Windows the
software detects the problem and flips the image automatically. Linux
handles the problem differently. Most (but not all) Linux software that
makes use of the webcam via a a collection of userspace libraries
called libv4l.









libv4l adds a thin abstraction layer on top of video4linux2 devices. The
purpose of this layer is to make it easy for application writers to
support a wide variety of devices without

having to write separate code for different devices in the same class.



If your webcam is running upside down, download the latest libv4l. Then
run your webcam app with following proceeding it:
LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so



For example, if you want to run Kopete instant messenger you would run:



LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so kopete



if your webcam is still upside down then you should run the following commands:



lsusb > lsusb.log

dmidecode > dmi.log



then email Hans de Goede (hdegoede@redhat.com) explaining you have a
webcam with upside down image and attaching the two log files you have
just created (lsusb.log & dmi.log).



Hans will update libv4l and send instructions back on how to install it.



For ASUS X5DC users, I have already asked Hans to update so this should work(thanks Hans!)



You can download the new version here: http://people.fedoraproject.org/~jwrdegoede/libv4l-0.6.5-test.tar.gz







1. Install

===========



Howto install and test libv4l depends on your system. There are

different instructions for if you have a 32 bit system or a 64 bit system.

which is using multilib. A 64 bit system without multilib is the same as

a 32 bit system.



To find out what you have do:



ls -d /usr/lib64



If this command gives a "No such file or directory" error, use the Non
multilib instructions, if the second command is successful, you have
multilib, to find out which version (dubbed Fedora and Ubuntu multilib,
because those are the most well known examples, do):



ls -d /usr/lib32

If this command gives a "No such file or directory" error, use the
Fedora multilib instructions. If this command succeeds use the Ubuntu
multilib instructions. Note the ubuntu multilib instructions also apply
to gentoo.



Non multilib instructions:

-------------------------------

tar xvfz libv4l-0.6.5-test.tar.gz

cd libv4l-0.6.5

make PREFIX=/usr

sudo make install PREFIX=/usr



Fedora Multilib instructions:

-----------------------------------

Basic 64 bit install:

tar xvfz libv4l-0.6.5-test.tar.gz

cd libv4l-0.6.5

make PREFIX=/usr LIBDIR=/usr/lib64

sudo make install PREFIX=/usr LIBDIR=/usr/lib64



If you also want to use 32 bit apps (such as skype), you

will need to have the 32 bit libc headers installed, on Fedora

this can be done like this:

Fedora 10-: "sudo yum install glibc-devel.i386"

Fedora 11: "sudo yum install glibc-devel.i586"

Fedora 12+: "sudo yum install glibc-devel.i686"

Then do:

make clean

make PREFIX=/usr CFLAGS=-m32 LDFLAGS=-m32

sudo make install PREFIX=/usr



Ubuntu Multilib instructions:

-----------------------------------

tar xvfz libv4l-0.6.5-test.tar.gz

cd libv4l-0.6.5

make PREFIX=/usr

sudo make install PREFIX=/usr



If you also want to use 32 bit apps (such as skype), you will need to
have the 32 bit libc headers installed, on Ubuntu this can be done like
this:



sudo apt-get install libc6-dev-i386



On gentoo this can be done like this:

sudo emerge -v app-emulation/emul-linux-x86-compat



Then do:

make clean

make PREFIX=/usr CFLAGS=-m32 LDFLAGS=-m32 LIBDIR=/usr/lib32

sudo make install PREFIX=/usr LIBDIR=/usr/lib32





2. Testing

========



You have a chance that your webcam app use libv4l or have an appropriate
script starting it. In that case you don't have to do anything. Just
run the application. This is the most common situation with Ubuntu and
Fedora packages. If your problem remains unsolved, then your app might
not use libv4l.



In that case start the application from a terminal like this:



Non multilib:

----------------

LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so



Note on Ubuntu sometimes skype is using a wrapper script, so if skype

does not work try:

LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so skype.real



Fedora multilib:

--------------------

For 64 bit applications (almost all apps):



LD_PRELOAD=/usr/lib64/libv4l/v4l1compat.so



For 32 bit applications (you only need it for proprietary softwares, which don't have a 64 bit version, like skype):



LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so skype



Ubuntu multilib:

--------------------



For 64 bit applications (almost all apps):



LD_PRELOAD=/usr/lib64/libv4l/v4l1compat.so skype



For 32 bit applications (you only need it for proprietary softwares, which

don't have a 64 bit version, like skype):



LD_PRELOAD=/usr/lib32/libv4l/v4l1compat.so skype



Note on Ubuntu sometimes skype is using a wrapper script, so if skype does not work try:

LD_PRELOAD=/usr/lib32/libv4l/v4l1compat.so skype.real


=====================================================================================================================================

The only problem is that everytime you want to use Skype webcam, you have to key in the command "LD_PRELOAD=/usr/lib32/libv4l/v4l1compat.so skype" to open Skype to

make the webcam normal.