» Server の記事

~ install awstats on ubuntu ~

connie 2012.12.26 | ubuntu | | No Comments
sudo apt-get install awstats

Copy the config file for new site (should name as wstats.yourdomain.ext.conf)

cp /etc/awstats/awstats.conf /etc/awstats/awstats.yourdomain.ext.conf

Open the config file, and modify these lines

#Path to access.log for your domain
LogFile="/var/log/apache2/access.log"
#I recommend '1' for more detailed information
LogFormat=1
SiteDomain="yourdomain.ext"
HostAliases="localhost 127.0.0.1 yourdomain.ext"

For running the first time use

/usr/lib/cgi-bin/awstats.pl -config=yourdomain.ext

For update

/usr/lib/cgi-bin/awstats.pl -config=yourdomain.ext -update

apache setting
 

<VirtualHost *:80>
ServerName ***.***.***.***
DocumentRoot /var/www/
<Directory "/var/www/">
Options FollowSymLinks
AllowOverride ALL
Order allow,deny
Allow from all
</Directory>
Alias /awstatsclasses/ "/usr/share/awstats/lib/"
Alias /awstats-icon/ "/usr/share/awstats/icon/"
Alias /awstatscss "/usr/share/doc/awstats/examples/css"
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
ScriptAlias /awstats/ /usr/lib/cgi-bin/
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
</VirtualHost>

/etc/init.d/apache2 reload

0 */3 * * * root /usr/lib/cgi-bin/awstats.pl -config=yourdomain.ext -update &gt;/dev/null

~ ESXi 60天試用註冊方法 ~

connie 2012.12.25 | ESXi | | No Comments

當你使用ESXi接近60天,就要去activate 個 license

方法如下:
先到vmware site, login in 去support & download 選擇 VMware vSphere Hypervisor (ESXi)

Screen Shot 2012-12-28 at 8.57.55 PM    

以後按一下Download

Screen Shot 2012-12-28 at 8.58.26 PM

不用下載,重點係頁面會有LICENSE KEYS 出來

Screen Shot 2012-12-28 at 8.58.37 PM

得到重點後,返去Vsphere Clients->Configuration->Licensed Features->edit->Assign a new license key to this host->Add License Key.

Screen Shot 2012-12-28 at 9.08.18 PM

打完license key 就完成了,恭喜你,你可以用一世了:o)

Screen Shot 2012-12-28 at 9.12.04 PM

~ AppServ 開啟 mcrypt 方法 ~

connie 2012.12.22 | apache | | No Comments

在 AppServ 開啟 mcrypt 方法如下 :

去Appserv folder/php5/ copy libmcrypt.dll 抄去C:\windows\

然後到C:\windows\php.ini uncomment 

extension=php_mcrypt.dll

restart apache

~ ubuntu SCP commard ~

connie 2012.12.21 | ubuntu | | No Comments
Get File from remote server 
scp [username]@[hostaddress]:/remotefile /newlocalfile

upload File to remote server 

scp [localfilename] [username]@[hostaddress]:/newfilename

 

1]Activate the SSL Module

sudo a2enmod ssl
sudo service apache2 restart

2]create a new directory where we will store the server key and certificate

sudo mkdir /etc/apache2/ssl

3]Create a Self Signed SSL Certificate
this certificate will expire after one year.

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt

4]The most important line is “Common Name”. Enter your official domain name here or, if you don’t have one yet, your site’s IP address.
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) [AU]:US
State or Province Name (full name) [Some-State]:New York
Locality Name (eg, city) []:NYC
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Awesome Inc
Organizational Unit Name (eg, section) []:Dept of Merriment
Common Name (e.g. server FQDN or YOUR name) []:example.com
Email Address []:[email protected]

5]Set Up the Certificate

sudo nano /etc/apache2/sites-available/default-ssl
ServerName example.com:443
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.crt
SSLCertificateKeyFile /etc/apache2/ssl/apache.key

6]Activate the New Virtual Host

sudo a2ensite default-ssl
sudo service apache2 reload

Mac OS X Server Apache 無法存取本機 MySQL Server 解決方式

由 phpinfo 中得知,是將 Mac 中的 PHP 是將 mysql.sock 放在 /var/mysql 下,

而 Mac 中的 MySQL 是放在 /tmp/mysql.sock。

所以要由本機的 Web Server 利用 PHP 連接本機的 MySQL 就會一直出現無法連線的錯誤。

利用底下的指令可以解決這個問題

sudo mkdir /var/mysql
sudo chown mysql /var/mysql
sudo ln -s /tmp/mysql.sock /var/mysql/

~ 解決php load exif extension 問題 ~

connie 2012.12.18 | apache | | No Comments

當php.ini enable 左 exif extension 但還是用不到的話,
那你要看看extension=php_exif.dll,是否放得前過extension=php_mbstring.dll
因為php_exif.dll需要用到php_mbstring, 所以要放得前過extension=
php_exif.dll
restart apache 

Screen Shot 2013-01-01 at 1.04.57 PM

~ VI 常用 command ~

connie 2012.12.17 | Linux | | No Comments

有時有d server 無nano , 唯有用VI

Shift + g 頁尾
:wq save
i Insert mode
ESC 出返insert mode
:q! quit without save

 

~ 非localhost connect mysql 方法 ~

connie 2012.12.14 | mysql | | No Comments

如果要外來ip connect 去mysql
要去更改my.cnf

ubuntu 位置為

/etc/mysql/my.cnf
將bind-address 指向要connect 去mysql 的ip

bind-address   = 127.0.0.111

PS: bind-address 不能多於一個,如果多於一個的情況就需要comment 左skip-external-locking 同bind-address,再用firewall block

blog_07

 

~ Remote Systems Explorer @ Eclipse ~

connie 2012.11.29 | Eclipse | | No Comments

相信由web designer 轉做web programmer 既人一定試過以下情況,
可以係Dreamweaver到set好remote server資料,一save自己upload,非常方便。
轉到Eclipse後, 同樣可以做到以上方法。

需要install plugin. Help>Install New Software

Screen Shot 2012-12-29 at 10.16.34 AM

Work with 通常係你eclipse 個version, search remote > install Remote System Explorer End-User Runtime

Screen Shot 2012-12-29 at 10.27.08 AM

Install 完後到Window>Show View>Remote Systems按一下,就會有Remote System既window  出尼

Screen Shot 2012-12-29 at 10.34.15 AM

按一下紅圈icon, 以新增一個新server connection.

Screen Shot 2012-12-29 at 10.36.22 AM

Either choose one of them. 之後你應該懂了=w=~

Screen Shot 2012-12-29 at 10.36.36 AM

如果想Remote 一個Folder 做porject 可以係connect 左server後,右click Folder>Create a Remote Project

Screen Shot 2012-12-29 at 10.40.55 AM

Export 後會係php Explorer 到生左個Folder 出尼右Click>Open Project就可以直接更改/新增test server / live server 上的東東

好處:即改

壞處:一錯你就gg,同埋無左Shift Click trace function 既功能,所以有好有唔好喇

Screen Shot 2012-12-29 at 10.45.14 AM

另外Remote Systems 有SSH Terminals, 以後可以一個eclipse window個晒d野,唔野又開WINSCP,又putty 開百幾個windows -.-"

Screen Shot 2012-12-29 at 10.50.50 AM

| HOME | Next Page »

Smiley face

April 2026
S M T W T F S
 1234
567891011
12131415161718
19202122232425
2627282930