Archive

Posts Tagged ‘CentOS’

Centos掛載windows網路芳鄰的錯誤

January 18th, 2010

最近用mount都不是很順利,常常遇到奇怪的問題 (我一直懷疑是win 7的問題)

時好時壞的真的很奇怪,當我執行下面這行指令的時候

 mount -t cifs -o username=xxx,password=xxx,iocharset=utf8,codepage=unicode,unicod //192.168.0.3/living-music /media/Squall-Music/

有時候就會出現下面這行錯誤訊息!

mount error 12 = Cannot allocate memory 

Read more…

Squall Linux, 工作紀錄 , , ,

Apache 啟動SSH

March 5th, 2009

安裝平台:CentOS 5.x + Server version: Apache/2.2.3

(本來是想寫透過PHP使用GMail寄信,不過發現需要啟動SSH的功能)

基本上要先安裝APACHE+OPENSSL

yum install apache
yum install openssl

首先需要產生SSL憑證:

$ openssl genrsa -out yourname.key 1024
Generating RSA private key, 1024 bit long modulus
......++++++
........++++++
e is 65537 (0x10001)

設定憑證的一些資訊:

$ openssl req -new -key yourname.key -out yourname.csr
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [GB]:TW
State or Province Name (full name) [Berkshire]:Taipei County
Locality Name (eg, city) [Newbury]:Taipei City
Organization Name (eg, company) [My Company Ltd]:Squall
Organizational Unit Name (eg, section) []:Squall
Common Name (eg, your name or your server's hostname) []:www.l-penguin.idv.tw
Email Address []:steven@ms.ntcb.edu.tw
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:

憑證簽署:

$ openssl x509 -req -days 365 -in yourname.csr -signkey

編輯ssl.conf

$ vim /etc/httpd/conf.d/ssl.conf

找到下面兩行,將路徑改成您存放crt及key的地方即可

SSLCertificateFile yourname.crt #112行
SSLCertificateKeyFile yourname.key #119行

重新啟動Apache即可,只要將原本網址http://xxx.xx.xxx 改成 https://xxx.xxx.xxx

Blogged with the Flock Browser

Squall Linux, OS/Server , , ,