ubuntu14.04配置Apache使用CGI
2016-03-30 21:37
183 查看
配置apache使用CGI,参考了网上的资料,自己弄了半天才弄出来,结果后来自己再配置时才发现很简单。
首先使用apt-get install apache2安装apache服务器,配置文件默认集中在/etc/apache2下。
默认的主页是/var/www/html/中的index.html。
然后在/var/www/下创建cgi-bin目录,以后写的CGI程序都放在这个目录下。
修改/etc/apache2/conf-enabled下的serve-cgi-bin.conf如图所示:
将ScriptAlias修改为上面的,Directory也修改为CGI的目录,然后保存。最后重新启动Apache服务器。
特别注意:创建的CGI程序保存后需要设置权限:chmod 755 /var/www/cgi-bin/文件名!
通过浏览器访问时输入http://localhost/cgi-bin/...,就是指向/var/www/cgi-bin/下的文件。
首先使用apt-get install apache2安装apache服务器,配置文件默认集中在/etc/apache2下。
默认的主页是/var/www/html/中的index.html。
然后在/var/www/下创建cgi-bin目录,以后写的CGI程序都放在这个目录下。
修改/etc/apache2/conf-enabled下的serve-cgi-bin.conf如图所示:
将ScriptAlias修改为上面的,Directory也修改为CGI的目录,然后保存。最后重新启动Apache服务器。
特别注意:创建的CGI程序保存后需要设置权限:chmod 755 /var/www/cgi-bin/文件名!
通过浏览器访问时输入http://localhost/cgi-bin/...,就是指向/var/www/cgi-bin/下的文件。
相关文章推荐
- Django + Apache + wsgi配置和环境搭建(ubuntu)
- CentOS-7-64bit 配置Apache + MySQL + PHP
- ubuntu下apache2 安装 配置 卸载 CGI设置 SSL设置
- 导入文章“Apache Spark学习:将Spark部署到Hadoop 2.2.0上”中给出的 assembly/target/scala-2.9.3/目录下的spark-assembly-0.8.
- apache phoenix UDF example
- apache commons fileupload 1.3.1(六)FileItem部分
- ava method "org.apache.struts2.components.Form.getValidators(String)" threw an exception when invoke
- CentOS 6.3下源码安装LAMP(Linux+Apache+Mysql+Php)环境
- org.apache.jasper.el.ELContextImpl cannot be cast to org.apache.jasper.el.ELContextImpl
- Linux 服务器下 Apache 无法解析 PHP 程序
- JDBC连接Apache Drill
- 使用apache的poi遇到的异常收集
- Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be r
- 在Windows平台上切换php版本(apache+mysql+php)
- apache commons fileupload 1.3.1(五)Disk部分
- WAMP环境下,Apache的端口号未被占用,但无法启动的问题
- WAMP环境下,Apache的端口号未被占用,但无法启动的问题
- $_SERVER只能在apache服务器下使用
- Eclipse使用Maven创建Web时错误:Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webap
- Apache、PHP 隐藏版本信息