课程: Linux System Engineer: Web Servers and DNS Using Apache, NGINX, and BIND
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Running a basic CGI script in Apache - Red Hat Enterprise Linux教程
课程: Linux System Engineer: Web Servers and DNS Using Apache, NGINX, and BIND
Running a basic CGI script in Apache
- [Instructor] For this exercise you'll want to be logged into rhhost1 with a terminal open. We will run a script under CGI that displays some information about the web server. I've created a CGI script for you and included it in the exercise files for chapter eight. To copy the file go to your home directory where you extracted the ExerciseFiles zip archive in chapter three of this course and then type in sudo cp ExerciseFiles/Ch08/var/www/cgi-bin/ loggedin.sh /var/www/cgi-bin/ and hit enter. Now let's take a look at it. Type in less /var/www/cgi-bin/loggedin.sh. So a very simple script that presents some HTML on the screen and runs the date command. It also runs the who command. Now let's see it work. Press q to quit. Let's make it executable by typing a sudo chmod +x /var/www/cgi-bin/loggedin.sh and hit enter. We need to turn on an SELinux Boolean to allow CGI scripts. Type in clear and then type in sudo setsebool -P httpd_enable_cgi 1 and hit enter. Now let's restart Apache. Type…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。