zoukankan      html  css  js  c++  java
  • 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
    
    ");
        printf("hello world
    
    ");    
        return 0;
    }

    这里如果写入不成功先改变一下main.c的权限

    sudo chmod 777 main.c 

    7、编译cgi程序

     sudo  gcc -o main.cgi  main.c

    8、在浏览器上使用输入192.168.6.66/cgi-bin/main.cgi

  • 相关阅读:
    tomcat-1
    oscache-2
    oscache-3
    oscache-1
    oscache-4
    缓存概要
    Criterion & DetachedCriteria
    Hibernate <查询缓存>
    Hibernate <二级缓存>
    Hibernate <一级缓存>
  • 原文地址:https://www.cnblogs.com/wurenzhong/p/8331063.html
Copyright © 2011-2022 走看看