installed apache
create a file index.html in '/var/www/html/'Code:[root@server1~]# yum install httpd* -y [root@server1~]# service httpd start Starting httpd: [ OK ] [root@server1~]# chkconfig httpd on
modified httpd.confCode:[root@server1~]# vim /var/www/html/index.html <center><h1>This is server1 Domain</h1></center> :wq
restart the serviceCode:[root@server1~]# vim /etc/httpd/conf/httpd.conf uncommented the line 'NameVirtualHost' NameVirtualHost 172.24.0.254:80 made a entry <VirtualHost 172.24.0.254:80> DocumentRoot /var/www/html ServerName server1.example.com ErrorLog logs/example.com-error_log CustomLog logs/example.com-access_log common </VirtualHost> :wq
chkd in firefox and in entire domain its working fineCode:[root@server1~]# service httpd restart Stopping httpd: [ OK ] Starting httpd: [ OK ]
now triying to configure cgi-bin script
changed the permessionCode:[root@server1~]# vim /var/www/cgi-bin/test.pl #!/usr/bin/perl print "This is a test \n" :wq
chkd by running the script its working fineCode:[root@server1~]# chmod +x /var/www/cgi-bin/test.pl
now updated the 'httpd.conf' file.Code:[root@server1~]# /var/www/cgi-bin/test.pl This is a test [root@server1~]# perl /var/www/cgi-bin/test.pl This is a test
restart the serviceCode:[root@server1~]# vim /etc/httpd/conf/httpd.conf ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" modified the "virtual host" directive <VirtualHost 172.24.0.254:80> DocumentRoot /var/www/html ServerName server1.example.com ErrorLog logs/example.com-error_log CustomLog logs/example.com-access_log common <Directory /var/www/cgi-bin> AddHandler test .pl .cgi AllowOverride None Options ExecCGI Order allow,deny Allow from all </Directory> </VirtualHost> :wq
but now when im trying to execute the script in the web browser (firefox). its showing errorCode:[root@server1~]# service httpd restart Stopping httpd: [ OK ] Starting httpd: [ OK ]
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
________________________________________
Apache/2.2.15 (Red Hat) Server at server1.example.com Port 80
Getting Error in logs also.
tried my install "mod_perl" package but the same issue persists.Code:[root@server1~]# tail -f /var/log/httpd/error_log [Fri Mar 02 17:02:29 2012] [error] [client ::1] malformed header from script. Bad header=this is a test : test.pl
Please help..!!Code:[root@server1~]# yum install mod_perl* -y

Reply With Quote
