LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-27-2017, 11:52 PM   #1
swamprat
Member
 
Registered: Sep 2005
Location: New Jersey, USA
Distribution: VMware V12 and V15 in Windows 10, MX Linux 23.1, Kubuntu 23.10, IBM z/VM 5.4
Posts: 558

Rep: Reputation: 34
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

Last edited by swamprat; 07-27-2017 at 11:54 PM.
 
Old 07-28-2017, 12:16 AM   #2
TheEzekielProject
Member
 
Registered: Dec 2016
Distribution: arch
Posts: 668

Rep: Reputation: 190Reputation: 190
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
 
Old 07-28-2017, 02:17 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,932

Rep: Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321
where are these commands coming from?
 
Old 07-28-2017, 05:02 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,750

Rep: Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928
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.
 
Old 07-28-2017, 08:19 AM   #5
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,669

Rep: Reputation: 498Reputation: 498Reputation: 498Reputation: 498Reputation: 498
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.
 
Old 07-28-2017, 10:00 AM   #6
acescript
LQ Newbie
 
Registered: Jul 2017
Location: Lagos
Distribution: Red Hat
Posts: 12

Rep: Reputation: Disabled
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!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Understanding Syntax for 2 Linux commands. swamprat Linux - Newbie 2 07-15-2017 02:03 PM
[SOLVED] Understanding Linux partitions and partitioning commands.. anup1304 Linux - Newbie 11 02-28-2013 06:45 PM
LXer: Understanding Nmap Commands: In depth Tutorial Part II LXer Syndicated Linux News 0 09-19-2011 11:30 PM
LXer: Understanding Nmap Commands: In depth Tutorial with examples LXer Syndicated Linux News 0 09-17-2011 08:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration