Các lệnh hữu ích FreeBSD

Một phần của tài liệu đồ án tốt nghiệp quản lý mạng nagios (Trang 33 - 35)

- Cập nhật cơ sở dữ liệu định vị:

# / usr / libexec / locate.updatedb

Bây giờ bạn có thể tìm thấy các tập tin bằng cách chạy lệnh xác định vị trí, ví dụ được liệt kê dưới đây.

# xác định vị trí check_oracle

/ usr / local / libexec / Nagios / check_oracle / usr/ports/net-mgmt/nagios- plugins/work/nagios-plugins-1.4/contrib/check_oracle_instance.pl / usr/ports/net-mgmt/nagios- plugins/work/nagios-plugins- 1.4/contrib/check_oracle_tbs / usr/ports/net-mgmt/nagios-plugins/work/nagios- plugins-1.4/plugins-scripts/check_oracle / usr/ports/net-mgmt/nagios- plugins/work/nagios-plugins-1.4/plugins-scripts/check_oracle.sh 5. Cài đặt Apache - Cài đặt Apache 2:

Để cài đặt đầy đủ 3 ứng dụng trên theo thứ tự, sử dụng lệnh sau:

aptitude install apache2 apache2-suexec libapache2-mod-fcgid php5-cgi

Nhưng nếu Apache2 đã được cài đặt cùng với PHP5 như 1 module của Apache thì cần phải tắt bỏ module PHP5 đó đi:

a2dismod php5

và kích hoạt những module sau:

a2enmod rewrite a2enmod suexec a2enmod include a2enmod fcgid

Sau đó mở file /etc/php5/cgi/php.ini:

vi /etc/php5/cgi/php.ini

bỏ chú thích tại dòng cgi.fix_pathinfo = 1:

[...]

; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's

; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok

; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting

; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting ; of zero causes PHP to behave as before. Default is 1. You should fix your scripts

; to use SCRIPT_FILENAME rather than PATH_TRANSLATED. ; http://php.net/cgi.fix-pathinfo

cgi.fix_pathinfo=1 [...]

Tiếp tục mở file /etc/apache2/mods-available/fcgid.conf … :

vi /etc/apache2/mods-available/fcgid.conf

và thêm dòng mã PHP_Fix_Pathinfo_Enable 1 (không giống như các phiên bản Ubuntu trước kia, với bản 10.04 dòng mã này không được nằm trong section của <VirtualHost> nếu không sẽ gây ra lỗi PHP_Fix_Pathinfo_Enable cannot occur

Một phần của tài liệu đồ án tốt nghiệp quản lý mạng nagios (Trang 33 - 35)