ubuntu配置服务器apache
在配置apache之前我们需要先配置好ubuntu中的网络,如果不太懂的话可以看看这我的这篇文章:配置ubuntu网络,里面详细的介绍了怎么配置ubuntu的网络。
1、安装apache服务器
sudo apt-get install apache2
2、安装好了apache之后,我们在浏览器上查看是否安装成功,在浏览上使用ubuntu的ip进行搜索,出现下面的页面说安装成功

3、配置apache支持cgi
sudo vim /etc/apache2/apache2.conf

4、重启服务器
sudo apachectl restart
5、去到cgi目录下编写cgi程序
cd /usr/lib/cgi-bin/
6、写cgi程序main.c
#include <stdio.h>
int main(void)
{
printf("Content-Type:text/html\n\n");
printf("hello world\n\n");
return ;
}
这里如果写入不成功先改变一下main.c的权限
sudo chmod main.c
7、编译cgi程序
sudo gcc -o main.cgi main.c
8、在浏览器上使用输入192.168.6.66/cgi-bin/main.cgi

ubuntu配置服务器apache的更多相关文章
- ubuntu配置服务器环境
今天环境不知道怎么就不能用了.自己新配了一个: 添加源: vi /etc/apt/sources.list 将下面这些源添加进去: deb http://debian.ustc.edu.cn/ubun ...
- ubuntu配置apache和cgi
ubuntu配置apache和cgi . 更新源并进行安装,否则后面的下载可能会不成功. sudo apt-get update sudo apt-get upgrade . 安装apache2服务 ...
- Ubuntu SVN服务器的搭建与配置(转)
Ubuntu SVN服务器的搭建与配置 一. 安装 sudo apt-get install subversion sudo apt-get install libapache2-sv ...
- CentOS 6.6安装配置LAMP服务器(Apache+PHP5+MySQL)
准备篇: CentOS 6.6系统安装配置图解教程 http://www.osyunwei.com/archives/8398.html 1.配置防火墙,开启80端口.3306端口 vi /etc/s ...
- CentOS 6.4安装配置LAMP服务器(Apache+PHP5+MySQL)
这篇文章主要介绍了CentOS 6.4安装配置LAMP服务器(Apache+PHP5+MySQL)的方法,需要的朋友可以参考下 文章写的不错,很详细:IDO转载自网络: 准备篇: 1.配置防火墙,开启 ...
- CentOS 7.0安装配置LAMP服务器(Apache+PHP+MariaDB)
CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop firewalld.service #停止fir ...
- ubuntu samba服务器多用户配置【转】
转自:http://www.2cto.com/os/201204/127043.html ubuntu samba服务器多用户配置 在/home/下有多个用户目录A.B...,现通过samba共享 ...
- 在Apache下开启SSI配置支持include shtml html和快速配置服务器
作为前端开发,使用Apache快速搭建服务器极为方便. 1.找到apach安装目录,找到conf目录下 的httpd.conf 使用SSI(Server Side Include)的html文件扩展名 ...
- 阿里云服务器CentOS 5.7(64位)安装配置LAMP服务器(Apache+PHP5+MySQL)
一.快速安装Apache+PHP5+MySql ----------------------------------------------------- 补充:由于163的yum源上只有php5.1 ...
随机推荐
- xcode编译报错unknown error -1=ffffffffffffffff Command /bin/sh failed with exit code 1
升级完xcode9.1之后,编译项目出现如下错误: CI今日构建时报出如下错误: /Users/xxx/Library/Developer/Xcode/DerivedData/Snowball-ebl ...
- Java 哲学家进餐
某次操作系统实验存档.V 这个哲学家除了吃就知道睡.( ╯□╰ ) 哲学家.java: package operating.entity.philosophyeating; import operat ...
- Effective Java 第三版——11. 重写equals方法时同时也要重写hashcode方法
Tips <Effective Java, Third Edition>一书英文版已经出版,这本书的第二版想必很多人都读过,号称Java四大名著之一,不过第二版2009年出版,到现在已经将 ...
- tr 命令详解
tr 作用:标准输入中通过替换或删除操作进行字符转换 语法:tr -c -d -s ["string1_to_translate_from"] ["string2_to ...
- sql server 2012 新知识-序列
今天聊一聊sql 2012 上的新功能-----序列 按我的理解,它就是为了实现全局性的唯一标识,按sql server 以前的版本,想对一张表标识很简单,比如identity,但如果要对某几张有业务 ...
- CKEditor 集成CKFinder集成
lCKEditor原名FckEditor,著名的HTML编辑器,可以在线编辑HTML内容,演示一下.打开.自己人用CKEditor,网友用UBBEditor. l配置参考文档,主要将ckeditor中 ...
- java.util.HashSet
Operations Time Complexity Notes add, remove, contains, size O(1) assuming the hash functions has di ...
- 编译TensorFlow源码
编译TensorFlow源码 参考: https://www.tensorflow.org/install/install_sources https://github.com/tensorflo ...
- Windows,Mac与Linux哪个更适合开发者?
以前写的,怕引来口水战,干脆不发.这段时间面试了十来人,用Mac的开发水平明显高于Windows的,挺多感想的,于是改改发了吧. Windows: 对普通用户而言体验最友好,对开发者 ...
- 基于Java Mail 进行发送(带附件和压缩附件)的邮件
刚进公司的training, 下面是要求: Self-study of Java Mail library: http://www.oracle.com/technetwork/java/javam ...