Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#setting Apache2 up for C cgi programs #install needed programs sudo apt-get install build-essential vim apache2 ##########create C code 'vim test.c'########### #include
int main(){ printf("Content-type:text/plain\n\n"); printf("Hello, you are still learning C!!\n"); return 0; } ################################################ #compile code and put it in cgi folder for apache gcc test.c test sudo cp test /usr/lib/cgi-bin/ #enable cgi for apache and restart server sudo a2enmod cgi sudo service apache2 restart ###################################another cgi example with user variables################## /***************************************************************** * C Programming in Linux (c) David Haskins 2008 * chapter1_3.c * *****************************************************************/ #include
int main(int argc, char *argv[]){ int i=0; printf("Content-type:text/plain\n\n"); printf("Hello, you are still learning C!!\n"); printf("Number of arguments to the main function:%d\n", argc); for(i=0;i
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)