日期:2014-05-17 浏览次数:20975 次
http://dev.xiaonei.com/apache-mirror/httpd/下载httpd-2.2.22.tar.gz
?cd到该文件路径
tar xvf httpd-2.2.22.tar.gz
cd httpd-2.2.22.tar.gz
sudo ./configure --enable-so --enable-so
sudo make
sudo make install
完成之后执行:
sudo gedit /usr/local/apache2/conf/httpd.conf
找到 行: #ServerName www.example.com:80
添加ServerName:127.0.0.1:80
sudo /usr/local/apache2/bin/apachectl stop
sudo /usr/local/apache2/bin/apachectl start
Apache启动后,在浏览器里输入 http://localhost/ 应该可以看到 It Words 安装成功信息.那么 Apache服务器就安装好了
sudo /usr/local/apache2/bin/apachectl stop
现在把apache添加到系统启动服务里让它自动启动.
sudo cp /usr/local/apache2/bin/apachectl /etc/init.d/apache2.server
cd /etc/init.d
sudo update-rc.d apache2.server defaults
删除服务
sudo update-rc.d apache2.server remove
桌面上建立3个文件:
#sudo /etc/init.d/apache2.server stop
#sudo /etc/init.d/apache2.server start
sudo /etc/init.d/apache2.server restart