Ubuntu 11.10搭建和配置Nagios
Ubuntu 11.10搭建和配置Nagios
安装Ubuntu 11.10 Desktop 32bit
安装 apache2、php5、openssl、libssl-dev、gcc编译器与开发库、gd开发库、php、php-apache、php相关的插件
可以用apt-get命令来安装这些软件包,键入命令:
sudo apt-get install apache2
sudo apt-get install build-essential
sudo apt-get install libgd2-xpm-dev
sudo apt-get install openssl
sudo apt-get install libssl-dev
sudo apt-get install php5
sudo apt-get install libapache2-mod-php5 (这个可能在安装php5的时候就已经安装,如果安装就 不需要安装啦)
sudo apt-get install libjpeg8
sudo apt-get install libjpeg8-dev
sudo apt-get install curl
sudo apt-get install libcurl3
sudo apt-get install libpng12-0
sudo apt-get install libpng12-dev
sudo apt-get install freetype2-demos
sudo apt-get install libfreetype6
sudo apt-get install libxml2
sudo apt-get install libxml2-dev
配置apache
如果默认没有安装vim编辑器,先安装vim,因为默认的vi编辑器在ubuntu里相当的恶心
sudo apt-get install vim
sudo vim /etc/apache2/apache2.conf
按shift-g,也就是G,到篇尾,添加如下配置
AddType application/x-httpd-php .php .htm .html
AddDefaultCharset UTF-8
DirectoryIndexindex.php index.html index.html
启动apache服务
sudo /etc/init.d/apache2 start
使用chkconfig工具设为随机自启动,如果没有安装chkconfig则先安装chkconfig
sudo apt-get install chkconfig
sudo update-rc.d apache2 defaults
sudochkconfig apache2 on
测试php是否解析正常
在shell里切换到/var/www目录下
cd /var/www
清空里面的文件
rm -rf *
新建测试页面
vimindex.php
<?php
phpinfo();
?>
退出并保存
打开浏览器测试:
http://localhost
是否正常显示php的信息
|
评论暂时关闭