LAB8.x

Hello,
I use CentOS 7.
1.
Where the directory new-cgi and the file foo.cgi must be created ?
I've created two times: /var/www/new-cgi/foo.cgi and /etc/httpd/new-cgi/foo.cgi
2.
As for /etc/httpd/conf.d/newscript.conf file, have you checked scripts directory ? Is it Ok ?
find / -name scripts
/etc/dhcp/scripts
/etc/vmware-tools/scripts
/usr/share/doc/nmap-ncat-6.40/examples/scripts
/usr/share/nmap/scripts
/usr/libexec/perf-core/scripts
/usr/src/kernels/3.10.0-1127.18.2.el7.x86_64.debug/arch/um/scripts
/usr/src/kernels/3.10.0-1127.18.2.el7.x86_64.debug/scripts
/usr/src/kernels/3.10.0-1127.18.2.el7.x86_64.debug/tools/perf/scripts
/usr/src/kernels/3.10.0-1127.18.2.el7.x86_64.debug/tools/scripts
3.
Step 2.What does "include" mean ? Should I correct anything ?
4.
After restarting httpd, I've got my error:
http://localhost/scripts/foo.cgi?bar
-bash: http://localhost/scripts/foo.cgi?bar: No such file or directory
w3m -dump http://10.83.23.220/scripts/foo.cgi?bar
Forbidden
You don't have permission to access /scripts/foo.cgi on this server.
w3m -dump http://127.0.0.1/index.html
This is my default file
[root@centos7-1 new-cgi]# w3m -dump http://127.0.0.1/scripts/foo.cgi?bar
Forbidden
You don't have permission to access /scripts/foo.cgi on this server.
Pls help me to understand my issue in such terrible labs.
Thank you
Regards,
Alexey
Comments
-
Hi @AlexeyBY ,
I'll let Lee provide you an answer, I just want to ask if you are in the Cloud Engineer Bootcamp, because if so, you may join the Office Hours for LFS211, and I'll be happy to assist in anything I can.
BTW, I don't think the labs are terrible, in fact, for item 1:
Where the directory new-cgi and the file foo.cgi must be created ?
I've created two times: /var/www/new-cgi/foo.cgi and /etc/httpd/new-cgi/foo.cgiIt's pretty clear to me that it's in the root directory, I mean /new-cgi/ , as the initial text indicates:
"Exercise 8.1: Create a new cgi script-enabled directory /new-cgi/ served at the URI
/scripts/.
Create the script /new-cgi/foo.cgi with the following contents (you may have to create the directory /new-cgi/):"So, it's under "/" ==> The directory should be created as /new-cgi/ and you need to create the file into that directory /new-cgi/foo.cgi .
i.- sudo mkdir /new-cgi
or do it as root.ii.- sudo touch /new-cgi/foo.cgi
I hope that helps.
Regards,
Luis.1 -
Hello,
"Terrible" means to performs step by step labs without asking to help somebody. It's impossible here.
As for the Cloud Engineer Bootcamp, i've bought several courses separately but it's the same like Cloud Engineer Bootcamp.To keep speaking about the lab 8.1:
I've created /root/new-cgi/foo.cgi -- Done!
After restarting, my results have not been changed.w3m -dump http://localhost/scripts/foo.cgi?bar or w3m -dump http://10.83.23.220/scripts/foo.cgi?bar
Forbidden
You don't have permission to access /scripts/foo.cgi on this server.tail -f /var/log/httpd/access_log
10.83.23.220 - - [20/Oct/2020:18:47:18 +0300] "GET /scripts/foo.cgi?bar HTTP/1.0" 403 217 "-" "w3m/0.5.3+git20190105"
::1 - - [20/Oct/2020:18:47:21 +0300] "GET /scripts/foo.cgi?bar HTTP/1.0" 403 217 "-" "w3m/0.5.3+git20190105"tail -f /var/log/httpd/error_log
[Tue Oct 20 18:47:18.852971 2020] [authz_core:error] [pid 1454] [client 10.83.23.220:39468] AH01630: client denied by server configuration: /new-cgi
[Tue Oct 20 18:47:21.298743 2020] [authz_core:error] [pid 1455] [client ::1:33452] AH01630: client denied by server configuration: /new-cgiThank you
Regards,
Alexey0 -
Hello,
I've performed the lab. My above comment is for /root/new-cgi/foo.cgi. Probably I got wrong.
It's Ok for the /new-cgi/foo,cgi.I'd like to ask you about this lab. We are performing the labs here for many topics. It means the best practice how to do it. Does LinuxFoudation recommend to use "/" to locate scripts for http server like Apache ? Let me know pls. it's good to read LFS201 Chapter 2.
Thank you
0 -
Hi @AlexeyBY ,
I think you are confused:
To keep speaking about the lab 8.1:
I've created /root/new-cgi/foo.cgi -- Done!
After restarting, my results have not been changed./new-cgi/ and /new-cgi/foo.cgi are not the same than /root/new-cgi/ and /root/new-cgi/foo.cgi . So, the newscripts.conf configuration script won't work with your setup.
So, the /root directory is the home directory of the root account. It is also referred to as the root user's home directory, and not as the root directory. The root directory is "/".
I hope that helps,
Luis.1 -
My last comment was deleted. WHY ?
I'll repeat here gain:
lab 8.2 is not working.cat /etc/httpd/conf.d/namevhost.conf
DocumentRoot /var/www/html/
ServerName default
RewriteEngine on ------------------- ADDED
RewriteOptions inherit --------------ADDED
DocumentRoot /var/www/html/namevhost/
ServerName namevhost.example.com
Options Indexes FollowSymLinks
AllowOverride None
Require all grantedcat /etc/httpd/conf.d/rewrite.conf
RewriteEngine on
RewriteRule \^/foo/(.*) /scripts/foo.cgi?$1 [L,PT]The result is:
w3m -dump http://127.0.0.1/scripts/foo/bar
Not Found
The requested URL /scripts/foo/bar was not found on this server.[Tue Oct 20 19:44:30.751955 2020] [cgi:error] [pid 1731] [client 127.0.0.1:51732] script not found or unable to stat: /new-cgi/foo
thank you
0 -
We don't delete posts, but the system may automatically flag it as spam, especially if there are URLs in a post. Moderators check the spam folder periodically for posts that are not actually spam and unflag them.
1 -
thank you. It was deleted after editing my last post.
To keep speaking about the lab 8.2. I may get wrong to correct file namevhost.conf
According to the guide 8.2:
If you have done the virtualhost lab from the previous chapter you need to add these two lines to namevhost.conf in the default namevhost sectionThere are two sections which are called default and namevhost.example.com (ServerName). There is no default_namevhost.
I've corrected _default as I posted in the last comment but i don't know it's Ok or notthank you
0 -
As for labs 8.3 and 8.4, i've done. I have an one question for you.
Lab 8.4 step 3, why must the file magic/index.html be executable ? the lab 8.4 works but i've not done this file executable.
Must this file be executable ?
thank you0 -
Hi,
Using the "/" directory would not be appropriate for a production server. The "/" is used in the labs to simplify the various exercises. As you have may noticed, the various distro's place files in different locations so there is not a single "correct" location for the various components.Are you referencing the sample files in the SOLUTIONS directories?
As for the excictable bit on the magic/index.html , I will verify.
Lee
1 -
Hi,
I've already understood that all labs are to check the exercises. in general, the course cannot be used for real cases on production server. I will have to buy new courses which are out of LinuxFoundation to keep learning the linux world and know the best practices how to.By the way, i cannot perform the lab 8.2 . Any new here ?
As for the lab 8.3., we check an access to a server for 127.0.0.1 and 10.22.34.0/18 (or own network). It's better to correct the step 4 to check access to the server from different IP src. Checking from 127.0.0.1 only is not idea for this lab. The idea is to check(permit/deny) access from different IPsrc.
As for the lab 8.4, i will be waiting for a reply about magic/index.html. I'm not sure but i think it's a security issue to set the excitable bit for *.html files.
Regards,
Alexey0 -
Exercise 8.2. and 8.4 are working as documented, with the exception of the rewrite.conf file, there is an extra \ at the beginning of the regular expression.
The executable bit on the html file is required for the xbitHack to function.0 -
Alexey , I will post my config files in a few minutes, they may help identify where the disconnect is.
0 -
Alexey, compare your configuration files to these.
Lee
0 -
The reference for the "XbitHack" is here: https://httpd.apache.org/docs/2.4/mod/mod_include.html#xbithack
0
Categories
- All Categories
- 232 LFX Mentorship
- 232 LFX Mentorship: Linux Kernel
- 812 Linux Foundation IT Professional Programs
- 365 Cloud Engineer IT Professional Program
- 183 Advanced Cloud Engineer IT Professional Program
- 82 DevOps Engineer IT Professional Program
- 151 Cloud Native Developer IT Professional Program
- 140 Express Training Courses & Microlearning
- 140 Express Courses - Discussion Forum
- Microlearning - Discussion Forum
- 6.4K Training Courses
- 48 LFC110 Class Forum - Discontinued
- 71 LFC131 Class Forum
- 46 LFD102 Class Forum
- 229 LFD103 Class Forum
- 20 LFD110 Class Forum
- 44 LFD121 Class Forum
- LFD125 Class Forum
- 18 LFD133 Class Forum
- 8 LFD134 Class Forum
- 18 LFD137 Class Forum
- 71 LFD201 Class Forum
- 5 LFD210 Class Forum
- 5 LFD210-CN Class Forum
- 2 LFD213 Class Forum - Discontinued
- 128 LFD232 Class Forum - Discontinued
- 2 LFD233 Class Forum
- 4 LFD237 Class Forum
- 24 LFD254 Class Forum
- 711 LFD259 Class Forum
- 111 LFD272 Class Forum - Discontinued
- 4 LFD272-JP クラス フォーラム
- 13 LFD273 Class Forum
- 200 LFS101 Class Forum
- 1 LFS111 Class Forum
- 3 LFS112 Class Forum
- 3 LFS116 Class Forum
- 7 LFS118 Class Forum
- LFS120 Class Forum
- 9 LFS142 Class Forum
- 8 LFS144 Class Forum
- 4 LFS145 Class Forum
- 3 LFS146 Class Forum
- 15 LFS148 Class Forum
- 15 LFS151 Class Forum
- 5 LFS157 Class Forum
- 49 LFS158 Class Forum
- LFS158-JP クラス フォーラム
- 10 LFS162 Class Forum
- 2 LFS166 Class Forum
- 4 LFS167 Class Forum
- 3 LFS170 Class Forum
- 2 LFS171 Class Forum
- 3 LFS178 Class Forum
- 3 LFS180 Class Forum
- 2 LFS182 Class Forum
- 5 LFS183 Class Forum
- 33 LFS200 Class Forum
- 737 LFS201 Class Forum - Discontinued
- 3 LFS201-JP クラス フォーラム - Discontinued
- 19 LFS203 Class Forum
- 135 LFS207 Class Forum
- 2 LFS207-DE-Klassenforum
- 2 LFS207-JP クラス フォーラム
- 302 LFS211 Class Forum
- 56 LFS216 Class Forum
- 52 LFS241 Class Forum
- 50 LFS242 Class Forum
- 38 LFS243 Class Forum
- 16 LFS244 Class Forum
- 5 LFS245 Class Forum
- LFS246 Class Forum
- LFS248 Class Forum
- 54 LFS250 Class Forum
- 2 LFS250-JP クラス フォーラム
- 1 LFS251 Class Forum
- 156 LFS253 Class Forum
- 1 LFS254 Class Forum
- 1 LFS255 Class Forum
- 10 LFS256 Class Forum
- 1 LFS257 Class Forum
- 1.3K LFS258 Class Forum
- 11 LFS258-JP クラス フォーラム
- 134 LFS260 Class Forum
- 160 LFS261 Class Forum
- 43 LFS262 Class Forum
- 82 LFS263 Class Forum - Discontinued
- 15 LFS264 Class Forum - Discontinued
- 11 LFS266 Class Forum - Discontinued
- 24 LFS267 Class Forum
- 25 LFS268 Class Forum
- 32 LFS269 Class Forum
- 6 LFS270 Class Forum
- 202 LFS272 Class Forum - Discontinued
- 2 LFS272-JP クラス フォーラム
- 4 LFS147 Class Forum
- 1 LFS274 Class Forum
- 4 LFS281 Class Forum
- 15 LFW111 Class Forum
- 262 LFW211 Class Forum
- 184 LFW212 Class Forum
- 15 SKF100 Class Forum
- 1 SKF200 Class Forum
- 2 SKF201 Class Forum
- 797 Hardware
- 199 Drivers
- 68 I/O Devices
- 37 Monitors
- 104 Multimedia
- 174 Networking
- 91 Printers & Scanners
- 85 Storage
- 759 Linux Distributions
- 82 Debian
- 67 Fedora
- 17 Linux Mint
- 13 Mageia
- 23 openSUSE
- 148 Red Hat Enterprise
- 31 Slackware
- 13 SUSE Enterprise
- 354 Ubuntu
- 470 Linux System Administration
- 39 Cloud Computing
- 71 Command Line/Scripting
- Github systems admin projects
- 95 Linux Security
- 78 Network Management
- 102 System Management
- 47 Web Management
- 69 Mobile Computing
- 18 Android
- 38 Development
- 1.2K New to Linux
- 1K Getting Started with Linux
- 376 Off Topic
- 115 Introductions
- 175 Small Talk
- 25 Study Material
- 807 Programming and Development
- 304 Kernel Development
- 485 Software Development
- 1.8K Software
- 263 Applications
- 183 Command Line
- 3 Compiling/Installing
- 988 Games
- 317 Installation
- 103 All In Program
- 103 All In Forum
Upcoming Training
-
August 20, 2018
Kubernetes Administration (LFS458)
-
August 20, 2018
Linux System Administration (LFS301)
-
August 27, 2018
Open Source Virtualization (LFS462)
-
August 27, 2018
Linux Kernel Debugging and Security (LFD440)