Note: CGI (during trial and error) in Vagrant environment

Edit the configuration file.

sudo vim /etc/httpd/conf/httpd.conf

When vim opens, uncomment the following: It may be faster to search in command mode (such as `` `/ cgi / g```).

#
AddHandler cgi-script .cgi  #Maybe here?
#

Reboot.

sudo service httpd restart

Create the following file.

hello.cgi

#!/usr/bin/env python
# -*- coding: utf-8 -*-

print "Content-Type: text/plain"
print
print "hello world!"

Access http: // [address] /hello.cgi. I think it will be displayed ...

Forbidden

You don't have permission to access /hello.cgi on this server.

Since it says Permission, I tried something like `` `chmod 755 hello.cgi```, but it didn't change.

Is there any other setting required?

Recommended Posts

Note: CGI (during trial and error) in Vagrant environment
(Note) Django in Vagrant environment
This and that around Mysql in Apache environment (Note)
How to build a LAMP environment using Vagrant and VirtulBox Note
Use django-debug-toolbar in VirtualBox / Vagrant environment
Build a Python + bottle + MySQL environment with Docker on RaspberryPi3! [Trial and error]
Build a Django environment with Vagrant in 5 minutes
Install gensim in conda environment (and also install mecab)
DISPLAY error in wxPython (and traitsui) on vscode
Could not import C error in GO environment
Error running Jupyter Notebook in Anaconda virtual environment
A story of trial and error trying to create a dynamic user group in Slack