温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

如何安装Ubuntu apache-2.1.11

发布时间:2021-10-28 11:29:10 来源:亿速云 阅读:108 作者:小新 栏目:系统运维

小编给大家分享一下如何安装Ubuntu apache-2.1.11,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!

安装Ubuntu apache-2.1.11

1、下载
http://httpd.apache.org/download.cgi
2、Ubuntu apache解压
tar zxvf httpd-2.2.11.tar.gz
3、建立目标文件夹
mkdir /usr/local/apache
也就是说等下安装的Ubuntu apache要安装到这个文件夹里面
4、Ubuntu apache配置
回到原来解压之后产生的文件夹
./configure --prefix=/usr/local/apache --enable-module=shared
要加上后面的参数,否则无法使用php
5、Ubuntu apache编译
make
6、Ubuntu apache安装
sudo make install
7、启动,重启和停止
/usr/local/apache/bin/apachectl -k start
/usr/local/apache/bin/apachectl -k restart
/usr/local/apache/bin/apachectl -k stop
8、配置文件
gedit /usr/local/apache/conf/httpd.conf
修改以下配置(当然这些修改是最基本的修改,如果要更高级的,参照其他Ubuntu apache配置手册)
8.1、
找到:
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
在后面添加:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
8.2、
找到:
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
添加:
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
8.3、
找到:
#ServerName www.example.com:80
修改为:
ServerName 127.0.0.1:80或者ServerName localhost:80
记得要去掉前面的“#”
否则会出现以下错误提示:
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName  
9、Ubuntu apache测试
在浏览器里输入http://127.0.0.1
如果出现It Works!说明成功。

以上是“如何安装Ubuntu apache-2.1.11”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注亿速云行业资讯频道!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI