Skip to main content

First post using stackedit

Welcome to StackEdit! Hey! I’m your first Markdown document in StackEdit 1 . Don’t delete me, I’m very helpful! I can be recovered anyway in the Utils tab of the Settings dialog. Documents StackEdit stores your documents in your browser, which means all your documents are automatically saved locally and are accessible offline! Note: StackEdit is accessible offline after the application has been loaded for the first time. Your local documents are not shared between different browsers or computers. Clearing your browser’s data may delete all your local documents! Make sure your documents are synchronized with Google Drive or Dropbox (check out the Synchronization section). Create a document The document panel is accessible using the button in the navigation bar. You can create a new document by clicking New document in the document panel. Switch to another document All your local documents are listed in the document panel. You can switch from one to anoth

Cài đặt Apache, PHP và MySQL trong Ubuntu 8.10

Cài đặt bộ 3 thành phần này trong Ubuntu dễ hơn rất nhiều so với trong Windows, tất cả bạn cần làm là có một đường truyền Internet tương đối tốt.

Đầu tiên, cài đặt Apache:
Mở Terminal lên và gõ:
sudo apt-get install apache2
Có thể bạn sẽ phải nhập mật khẩu root, sau đó quá trình cài đặt sẽ diễn ra tự động, bạn chỉ phải ngồi chờ, và chọn Y nếu có câu hỏi.
Để kiểm tra Apache đã cài đặt thành công hay chưa, hãy mở trình duyệt lên và gõ:
http://localhost/
Nếu bạn thấy dòng chữ It works thì mọi việc đã suôn sẻ.

Tiếp theo là quá trình cài đặt PHP.
Vẫn trong cửa sổ Terminal, gõ:
sudo apt-get install php5 libapache2-mod-php5
Quá trình cài đặt diễn ra tương tự như cài đặt Apache, lưu ý ở đây là câu lệnh cài đặt PHP 5.
Quá trình cài đặt sẽ tắt mất Apache, bạn cần khởi động lại nó để chạy thử PHP - tất nhiên có thể để sau cũng được:
sudo /etc/init.d/apache2 restart
Để kiểm tra PHP cài đặt có thành công hay không, hãy tạo file test.php trong thư mục /var/www có nội dung:

Sau đó, mở trình duyệt lên, gõ http://localhost/test.php
Nếu hiện ra cửa sổ thông tin cài đặt, thì tức là bạn đã cài đặt thành công.

Tiếp theo, chúng ta tiến hành cài đặt MySQL - bạn nên chuẩn bị tinh thần kiên nhẫn, vì cài MySQL là lâu nhất trong các thành phần.
Trong cửa sổ Terminal, gõ:
sudo apt-get install mysql-server
Bạn sẽ được hỏi mật khẩu cho tài khoản root của mysql - đừng nhầm với tài khoản root của hệ thống nhé.
Sau khi cài đặt xong, bạn có thể mở file my.cnf nằm trong thư mục /etc/mysql, tìm dòng
bind-address = 127.0.0.1
và đổi thành IP của bạn để các máy khác có thể truy cập được.

Bạn có thể cài thêm PHPmyAdmin để quản lý database cho dễ:
sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin

Cuối cùng, mở file php.ini trong /etc/php5/apache2, tìm dòng:
; extension=mysql.so
xóa dấu ; ở đầu dòng (tức là bỏ đi dấu comment), trở thành:
extension=mysql.so

Bạn đã hoàn tất quá trình cài đặt.

Ghi chú:
Vào tháng 10.2008, trên thế giới có hơn 90.000.000 máy chủ sử dụng Apache, chiếm hơn 50% lượng máy chủ trên toàn thế giới. Microsft IIS có hơn 60.000.000 máy sử dụng, trong khi Google có khoảng 10.000.000 máy.
Nguồn:
http://news.netcraft.com/archives/2008/10/29/october_2008_web_server_survey.html

Comments

Popular posts from this blog

Sử dụng gcov để kiểm tra sourcecode

Sau khi hoàn thành source code, trong test phase, có thể chúng ta cần kiểm tra tập test case của chúng ta có coverage tất cả các trường hợp có thể xảy ra hay không, hành động này gọi là test code coverage. Có nhiều tool miễn phí cũng như có phí để thực hiện việc này, nhưng đơn giản nhất là sử dụng công cụ gcov đi kèm trong trình biên dịch gcc. Để đọc chi tiết hơn về gcov, bạn có thể vào http://gcc.gnu.org/onlinedocs/gcc/Gcov.html#Gcov, hoặc tìm kiếm với Google. Sử dụng gcov khá đơn giản, giả sử ta có 3 file a.c, b.c và c.c. Truy cập vào thư mục chứa 3 files này, gõ: gcc -fprofile-arcs -ftest-coverage a.c b.c c.c Mặc định gcc sẽ tạo ra file a.out trong thư mục hiện thời, cùng với 3 file a.gcno, b.gcno và c.gcno. Sau đó bạn chạy file a.out với các parameter cần thiết, sẽ tạo ra thêm 3 file a.gcda, b.gcda và c.gcda. Sau đó, giả sử cần phân tích file b.c, chúng ta gõ: gcov b.c Có hai tham số thường dùng là -b và -f: -b: thêm thông tin về branch trong code. -f: thêm thông tin về hàm. Thông

Getting started with Cryptpad in Ubuntu: step by step

Cryptpad is an open source collaborative editor which is hosted at: https://github.com/cjdelisle/cryptpad It is easy to clone the github repository and start to try, but if you are a newbie, there maybe some difficulties. Suppose that you have a clean Ubuntu machine, and want to try with Cryptpad, you can follow these steps: 1. Download mongodb for Linux: https://www.mongodb.org/downloads 2. Unzip the file you got to a location you want. You will start mongodb from there, or add this directory to your PATH variable so you can start mongodb from anywhere. 3. Suppose that you chose the easier way, i.e start mongodb from its directory. 4. Open Terminal (Ctrl + Alt + T for shortcut), move to the directory of mongodb 5. Type: mkdir db mongod --dbpath=./db These above commands will first, create a directory 'db' insider the directory mongodb, then start mongodb server. 6. Keep the terminal with mongodb server running 7. Open another terminal (Ctrl + Shift +

First post using stackedit

Welcome to StackEdit! Hey! I’m your first Markdown document in StackEdit 1 . Don’t delete me, I’m very helpful! I can be recovered anyway in the Utils tab of the Settings dialog. Documents StackEdit stores your documents in your browser, which means all your documents are automatically saved locally and are accessible offline! Note: StackEdit is accessible offline after the application has been loaded for the first time. Your local documents are not shared between different browsers or computers. Clearing your browser’s data may delete all your local documents! Make sure your documents are synchronized with Google Drive or Dropbox (check out the Synchronization section). Create a document The document panel is accessible using the button in the navigation bar. You can create a new document by clicking New document in the document panel. Switch to another document All your local documents are listed in the document panel. You can switch from one to anoth