LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Understanding these Linux Commands (https://www.linuxquestions.org/questions/linux-newbie-8/understanding-these-linux-commands-4175610775/)

swamprat 07-27-2017 11:52 PM

Understanding these Linux Commands
 
Hello all,

Can some one help me understand what is happening with the commands below:

Thanks

[root@www ~]# vi /etc/httpd/conf.d/cgi-enabled.conf
# create new

# processes .cgi and .pl as CGI scripts

<Directory "/var/www/html/cgi-enabled">
Options +ExecCGI
AddHandler cgi-script .cgi .pl
</Directory>

[root@www ~]# systemctl restart httpd

chcon -R -t httpd_sys_script_exec_t /var/www/html/cgi-enabled

In the first group where he refers to '/var/www/html/cgi-enabled' I can't find this directory. I've been using cut and paste to try to execute these commands.

Thanks

TheEzekielProject 07-28-2017 12:16 AM

Next time please use code tags. It makes code much more readable.

"vi" is a text editor. "systemctl restart" restarts a service.

What are you trying to do? What distro are you using? What have you tried? Google is your friend

pan64 07-28-2017 02:17 AM

where are these commands coming from?

michaelk 07-28-2017 05:02 AM

Most likely from here:

https://www.server-world.info/en/not..._7&p=httpd&f=2

Code:

# create new

# processes .cgi and .pl as CGI scripts

<Directory "/var/www/html/cgi-enabled">
Options +ExecCGI
AddHandler cgi-script .cgi .pl
</Directory>

This is the contents of the file named cgi-enabled.conf that is created in the /etc/httpd/conf.d/ directory.

As stated on the page cgi scripts are normally configured and ran from the /var/www/cgi-bin directory by default. /var/www/html/cgi-enabled is not a default directory and needs to be created.

malekmustaq 07-28-2017 08:19 AM

Quote:

Can some one help me understand what is happening with the commands below:
The command you are issuing through script is running vi editor to edit file /etc/httpd/conf.d/cgi-enabled.conf

You should learn how to edit file using "vi editor". This text editor is very handy and is required (often) to edit cron jobs at /etc/cron.

Here is a quick vi tutorial pointing to you at least the first basic commands which usually what is generally needed to a beginner. Or you can download a pdf tutorial here and learn it off line.

Hope that helps. Good luck.

m.m.

acescript 07-28-2017 10:00 AM

Quote:

[root@www ~]# systemctl restart httpd
Quote:

chcon -R -t httpd_sys_script_exec_t /var/www/html/cgi-enabled
Were there error(s) when you execute those commands, if yes, what are the error(s)? 'httpd' is used to start Apache web server. The script to edit is the httpd.conf file in the /etc/httpd/conf/httpd.conf. The cgi functionality can be found in this file and unless you need additional configuration you shouldn't edit the

Quote:

/etc/httpd/conf.d/cgi-enabled.conf
file

Make a backup of these files before editing to prevent messing them up.

Hope this helps!


All times are GMT -5. The time now is 12:10 PM.