{"id":15015352,"url":"https://github.com/awarmanf/sms_cgi","last_synced_at":"2026-03-17T23:02:27.877Z","repository":{"id":254455624,"uuid":"846581100","full_name":"awarmanf/sms_cgi","owner":"awarmanf","description":"The SMS Web is a web application to sent sms using Perl CGI.","archived":false,"fork":false,"pushed_at":"2024-08-24T14:11:16.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-19T17:10:06.000Z","etag":null,"topics":["cgi-script","nginx","perl","sms"],"latest_commit_sha":null,"homepage":"https://awarmanf.wordpress.com/2017/01/04/sms-web/","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/awarmanf.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-23T14:06:00.000Z","updated_at":"2024-08-24T14:11:20.000Z","dependencies_parsed_at":"2024-09-28T18:40:59.807Z","dependency_job_id":"135349af-785d-4862-ba2e-5ee2604d88ce","html_url":"https://github.com/awarmanf/sms_cgi","commit_stats":null,"previous_names":["awarmanf/sms_cgi"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awarmanf%2Fsms_cgi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awarmanf%2Fsms_cgi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awarmanf%2Fsms_cgi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awarmanf%2Fsms_cgi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/awarmanf","download_url":"https://codeload.github.com/awarmanf/sms_cgi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243313477,"owners_count":20271192,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cgi-script","nginx","perl","sms"],"created_at":"2024-09-24T19:46:57.566Z","updated_at":"2025-12-28T23:24:19.283Z","avatar_url":"https://github.com/awarmanf.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# SMS Web Application\n\nThe SMS Web is a web application to sent sms using Perl CGI. You must setup it on the same [SMS Gateway Server](https://github.com/awarmanf/sms_gateway_perl).\n\n\u003eThis application is designed on Debian Linux (Wheezy).\n\n## Requirement\n\nPackages installation in Debian / Ubuntu.\n\n```bash\napt-get install nginx\napt-get install php-pear\napt-get install php5-cgi\napt-get install php5-fpm\napt-get install php5-gd\napt-get install php5-imap php5-mysql\napt-get install php5\napt-get install fcgiwrap\napt-get install libdbd-mysql-perl\napt-get install libdbi-perl\napt-get install mysql-server mysql-client\n```\n\n## Check if php5-fm and fcgi are working\n\n```\n$ /etc/init.d/php5-fpm status\n[ ok ] php5-fpm is running.\n\n$ /etc/init.d/fcgiwrap status\n[ ok ] Checking status of FastCGI wrapper: fcgiwrap running.\n```\n\n## Edit nginx default configuration\n\nEdit `/etc/nginx/sites-available/default`\n\n```nginx\nserver {\n\n\troot /usr/share/nginx/www;\n        index index.php index.html index.htm;\n\n\t# Make site accessible from http://localhost/\n\tserver_name localhost;\n\n\tlocation / {\n\t\t# First attempt to serve request as file, then\n\t\t# as directory, then fall back to displaying a 404.\n\t\ttry_files $uri $uri/ /index.html;\n\t\t# Uncomment to enable naxsi on this location\n\t\t# include /etc/nginx/naxsi.rules\n\t}\n\n\tlocation /doc/ {\n\t\talias /usr/share/doc/;\n\t\tautoindex on;\n\t\tallow 127.0.0.1;\n\t\tallow ::1;\n\t\tdeny all;\n\t}\n\n\terror_page 404 /404.html;\n\n\t# redirect server error pages to the static page /50x.html\n\t#\n\terror_page 500 502 503 504 /50x.html;\n\tlocation = /50x.html {\n\t\troot /usr/share/nginx/www;\n\t}\n\n    # pass the PHP scripts to FastCGI server listening on /var/run/php5-fpm.sock\n    location ~ \\.php$ {\n        try_files $uri =404;\n        fastcgi_pass unix:/var/run/php5-fpm.sock;\n        fastcgi_index index.php;\n        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n        include fastcgi_params;\n    }\n\n    location ~ \\.pl|cgi$ {\n        gzip off;\n        include /etc/nginx/fastcgi_params;\n        fastcgi_pass unix:/var/run/fcgiwrap.socket;\n        fastcgi_index index.pl;\n        fastcgi_param SCRIPT_FILENAME /usr/share/nginx/www/cgi$fastcgi_script_name;\n    }\n}\n```\n\nStart nginx\n\n```\n/etc/init.d/nginx start\n```\n\n## Create database smscgi\n\nLogin to mysql as user root\n\n```sql\nCREATE DATABASE smscgi;\nCREATE USER 'user1'@'localhost' IDENTIFIED BY 'password1';\nGRANT ALL PRIVILEGES ON `smscgi` . * TO 'user1'@'localhost';\nQUIT;\n```\n\nThen execute sql statements on file `smscgi.db`\n\n```\nmysql -u user1 -p smscgi \u003c smscgi.db\n```\n\n## Test if CGI is working\n\nCreate directory cgi\n\n```\nmkdir /usr/share/nginx/www/cgi\n```\n\nThen put files `test.cgi` and `sms.cgi` in that directory.\n\nMake executable\n\n```\nchmod 755 /usr/share/nginx/www/cgi/test.cgi\nchmod 755 /usr/share/nginx/www/cgi/sms.cgi\n```\n\nTest if cgi is working by using curl\n\n    curl http://localhost/cgi/test.cgi\n\nThe output\n\n```html\n\u003chtml\u003e\u003chead\u003e\u003ctitle\u003ePerl Environment Variables\u003c/title\u003e\u003c/head\u003e\n\u003cbody\u003e\n\u003ch1\u003ePerl Environment Variables\u003c/h1\u003e\nCOLUMNS = 170\u003cbr\u003e\nCONSOLE = /dev/console\u003cbr\u003e\nCONTENT_LENGTH = \u003cbr\u003e\nCONTENT_TYPE = \u003cbr\u003e\nDOCUMENT_ROOT = /usr/share/nginx/www\u003cbr\u003e\nDOCUMENT_URI = /cgi/test.cgi\u003cbr\u003e\nFCGI_ROLE = RESPONDER\u003cbr\u003e\nGATEWAY_INTERFACE = CGI/1.1\u003cbr\u003e\nHOME = /\u003cbr\u003e\nHTTPS = \u003cbr\u003e\nHTTP_ACCEPT = */*\u003cbr\u003e\nHTTP_HOST = localhost\u003cbr\u003e\nHTTP_USER_AGENT = curl/7.26.0\u003cbr\u003e\nINIT_VERSION = sysvinit-2.88\u003cbr\u003e\nLINES = 48\u003cbr\u003e\nPATH = /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\u003cbr\u003e\nPREVLEVEL = N\u003cbr\u003e\nPWD = /\u003cbr\u003e\nQUERY_STRING = \u003cbr\u003e\nREDIRECT_STATUS = 200\u003cbr\u003e\nREMOTE_ADDR = 127.0.0.1\u003cbr\u003e\nREMOTE_PORT = 43133\u003cbr\u003e\nREQUEST_METHOD = GET\u003cbr\u003e\nREQUEST_URI = /cgi/test.cgi\u003cbr\u003e\nRUNLEVEL = 2\u003cbr\u003e\nSCRIPT_FILENAME = /usr/share/nginx/www/cgi/test.cgi\u003cbr\u003e\nSCRIPT_NAME = /cgi/test.cgi\u003cbr\u003e\nSERVER_ADDR = 127.0.0.1\u003cbr\u003e\nSERVER_NAME = localhost\u003cbr\u003e\nSERVER_PORT = 80\u003cbr\u003e\nSERVER_PROTOCOL = HTTP/1.1\u003cbr\u003e\nSERVER_SOFTWARE = nginx/1.2.1\u003cbr\u003e\nSHELL = /bin/sh\u003cbr\u003e\nTERM = linux\u003cbr\u003e\ninit = /sbin/init\u003cbr\u003e\nprevious = N\u003cbr\u003e\nrootmnt = /root\u003cbr\u003e\nrunlevel = 2\u003cbr\u003e\n\u003c/body\u003e\u003c/html\u003e\n```\n\n## Make user nginx (www-data) can write to /var/tmp/sms\n\n```\nchgrp www-data /var/tmp/sms\nchmod 775 /var/tmp/sms\n```\n\n## Test send sms\n\n### Using browser\n\nJust input this line into the browser\n\n```\nhttp://localhost/cgi/sms.cgi?user=user1\u0026pass=password1\u0026to=085236006001\u0026txt=Tes%20kirim%20sms\n```\n\n\u003eWhen using the browser to send sms the space character must be encoded to `%20`.\n\n### Using curl\n\nTest send sms to single number\n\n```\ncurl -o output -s \"http://localhost/cgi/sms.cgi?user=user1\u0026pass=password1\u0026to=085236006000\u0026txt=tes sms\"\n```\n\nIf success the output will be\n\n```html\n\u003c!DOCTYPE html\n\tPUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n\t \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"\u003e\n\u003chtml xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en-US\" xml:lang=\"en-US\"\u003e\n\u003chead\u003e\n\u003ctitle\u003eSMS sent\u003c/title\u003e\n\u003cmeta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" /\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003ch1\u003eSMS sent\u003c/h1\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\nTest send sms to multi numbers\n\n```\ncurl -o output -s \"http://localhost/cgi/sms.cgi?user=user1\u0026pass=password1\u0026to=085236006000,085236006001,085236006002\u0026txt=tes sms\"\n```\n\nThe sms file `/var/tmp/sms/sms.1724415565` will contain\n\n```\n085236006000 tes sms\n085236006001 tes sms\n085236006002 tes sms\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawarmanf%2Fsms_cgi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fawarmanf%2Fsms_cgi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawarmanf%2Fsms_cgi/lists"}