Cgi i think


#1

hi, chunky here,
ok, i don’t know what the problem could be…
i have a fully hosted sub domain, http://www.atlanta.fsbocity.net and i have installed a classified ads program. according to the software creator, i did everything i should have as far as editing the global.config file. he is not familiar with dreamhost. anyway, could someone give me a hand? the admin (me, what a joke) should be able to go to http://www.atlanta.fsbocity.net/cgi-bin/totalclassifieds/submitad.cgi and start uploading ads (need to upload 13 to test before it’s ready) and pull it up. i changed all permissions as i was instructed. although i did ftp using leach ftp in the auto mode instead of specifically uploading some in “ascii” hopefully that is not an issue.
can anyone help?
here is my global.cgi file that is in the totalclassifieds folder:

##############################################################################

global.config Version 5.2 Released October 19 2005

http://www.kentuckylogistics.com - Email: admin@kentuckylogistics.com

##############################################################################

COPYRIGHT NOTICE

Copyright 2003 - 2006 Kentucky Logistics All Rights Reserved.

Files included in this distribution may be modified only by registered

users so long as this copyright notice and the comments above remain

intact. By using this code you agree to indemnify Kentucky Logistics from

any liability that might arise from it’s use.

##############################################################################

General Site Details

##############################################################################

$main_path="/home/chunky"; # change to the main path on your server WITHOUT forward slash
$username=“chunky”;
$rooturl=“http://www.atlanta.fsbocity.net/”; # base url of site WITH forward slash
$rootbin=“http://www.atlanta.fsbocity.net/cgi-bin/totalclassifieds/”; # url of cgi-bin where all script files are placed WITH forward slash
$link_url=“http://www.atlanta.fsbocity.net/”; # url to create linking code to
$sitename=“atlanta.fsbocity.net”; # real domain name without www. at start

$mainname=“atlanta.fsbocity.net”; # name of site
$copyright=“FSBOCity.net,”; # name of site or copyright holder name
$county=“Fulton County”; # Enter your city here
$city=“Atlanta”; # Enter your city here.
$state=“Georgia”; # This is the State that you live in.
$country=“United States”; # country you are in

$app=35; # ads to display per page
$ad_duration=30; # ad duration in days
$ad_description_size=2500; # characters allowed in ad description
$c=15; # Change the number of categories here… ########

Administrative Controls

################################################################################

THIS WILL CHANGE YOUR USERNAME AND PASSWORD

################################################################################
@admins=(“admin”,“topsecret”); # admin login username and password
################################################################################

LINK TO US CONTROLS

################################################################################
######THIS WILL CHANGE THE HIGHLIGHTS AND TEXT COLORS IN THE LINK TO US PAGE####
################################################################################
$hfcolor4=“Black”; ##
$hfcolor5=“Yellow”; ##
################################################################################

Recommend Us Controls

################################################################################

Change Subject. Change Message

################################################################################
$SCRIPT_NAME=“http://www.atlanta.fsbocity.net/cgi-bin/totalclassifieds/robot.cgi”;
##DO NOT CHANGE ##
###############################################################################
$subject="You have to see this $rooturl "; ## Add your subject ##
$message=“Atlanta FSBOs and More Sponsored by LoansAtlanta.com,
”; ##Your Message ##

Copyrights Controls

################################################################################

Change Highlight Color & Text Color

################################################################################
$hfcolor8=“black”; ## Text Color ##
$hfcolor9=“yellow”; ## Highlight Color ##
################################################################################

######### HOME PAGE CONTROLS ##########
################################################################################
$hfcolor30="#FFFFFF";

CHANGE THE COLOR TO THE LEFT OF YOUR HOMEPAGE

################################################################################

Font and table colors

#######################

$font="<font face=verdana,arial size="; # font face, verdana is recommended default
$hfcolor="#EEEEEE"; # color of header tables
$border=“FF0000”;
$main_bar_color="#CCCCCC"; # color of main menu bar
$textcolors=""; # font colors

################################## Nothing To Edit Below This LIne #############################
################################################################################################

Data definitions

##################
$data_directory=“public_html/realdata”; # do not add a forward slash
$data_file="$data_directory/data.txt";

Logging

#########
$logging=1; # 1 create logs, 0 - do not create logs
$log_file="$data_directory/log.txt";

$cgi_post_max=500_000;
$main_images=“classifiedimages”;

Images

########
$handle_images = 1; # 1 use images, 0 - do not use images
$images_directory = “$data_directory/ads_images”; # directory for storing images

$image_max_size = 120000; # max size of image in bytes
$image_tumbnail_height = “100”; # in pixels
$image_tumbnail_width = “100”; # in pixels

html templates

#################
$html_templates_directory="$data_directory/html_templates";
$header_template=“page_header.html”;
$banner_template=“banner.html”;
$left_side1_template=“left_side1.html”;
$image_page_template=“image_page.html”;
$left_side2_template=“left_side2.html”;
push(@html_templates,‘header_template’);
push(@html_templates,‘banner_template’);
push(@html_templates,‘left_side1_template’);
$image_page_template=“image_page.html”;
push(@html_templates,‘left_side2_template’);
#push(@html_templates,‘image_page_template’);
$footer_template=“page_footer.html”;
push(@html_templates,‘footer_template’);

email messages templates

###########################
$messages_directory="$data_directory/messages";

$email_to_friend_message=“email_to_friend.txt”;
$expire_soon_message=“expire_soon.txt”;
$expired_ad_message=“expired_ad.txt”;
$password_reminding_message=“password_remind.txt”;
$deleted_ad_message=“deleted_ad.txt”;
$deleted_user_message=“deleted_user.txt”;
$submited_ad_message=“submited_ad.txt”;

push(@email_messages,‘expire_soon_message’);
push(@email_messages,‘expired_ad_message’);
push(@email_messages,‘email_to_friend_message’);
push(@email_messages,‘password_reminding_message’);
push(@email_messages,‘deleted_ad_message’);
push(@email_messages,‘deleted_user_message’);
push(@email_messages,‘submited_ad_message’);

category templates

#####################
$categories_templates_directory="$data_directory";
$categories_template=“Categories.def”;
push(@categories_templates,‘categories_template’);

category variables

####################
$categories_file="$data_directory/Categories.def";

$embedded_levels=5; # How many embedded levels you need
$category_digits=3; # How many categories you need:

1 digit - 9 categories, 9 subcats …

2 dig-s - 99 cat-s, 99 subcats…

3 dig-s - 999 cats, 999 subcats…

$category_last_item=‘Other’;

$category_counting=1; # 1 - show count of ads in category, 0 - do not show count
$show_zero_count=1; # 1 - show zero, 0 - show blank
$counting_style=" (#)"; # Symbol # will be replaced with number of ads in category

Stats

#######
$ads_statistic=1; # show statistic for ads
$ads_statistic_file="$data_directory/adstat.dat";
$hot_ads=“10”; # amount of hot ads, possible formats N ads or N% of all ads
$new_ad_period=“10”; # set period how much days show new ad icon

Expiring of ads

#################
$expiring_ads=1; # 1 - maintain expiring ads, 0 - do not maintain expiring ads
$expire_notification=1; # 1 - notify user before his ad will expire, 0 - do not notify
$expire_notification_days=5; # notify user when his ad will expire in ‘N’ days
$expire_notification_by_email=1; # notify user by email when his ad will expire in ‘N’ days and when it was deleted

Logging in

############
$remember_users=1; # do remember users logins for some time
$remember_users_period="+1Y"; # time for storing user logins in cookies

possible formats: +Ns/m/h/d/M/y also +Nsec/min/hour/day/month/year

Billing settings

##################
$charge_for_submiting=0; # 1 - charge for ads, 0 - do not charge for ads
$partner_percent_number=0; # of 10 - half payments go to $paypal_account, half go to $my_paypal_account

Purchase tickets

##################
$tickets_file="$data_directory/shadow/tickets.dat";
$tickets_expire_time=“60 min”; # possible variants ‘5 days’/‘3 hours’/‘10 min’

do not set expire time less than 5 min

Free Ads

##########
$free_message=“Place a $ad_duration day ad at $mainname for FREE!

Once your ad is active you will be able to change it or delete it at any time.

About a week before your ad is due to expire we will send you an email asking if you wish to renew.

\n”;
$extend_message=“Your ad will be extended and remain online for a further $ad_duration days. You will be able to change it or delete it at any time.

We’ll send you a further email reminder $expire_notification_days days before your ad is due to expire asking if you wish to renew.

\n”;

#Mail Functions
###############

#$mail="/usr/sbin/sendmail -t"; # other common setting is /usr/bin/mail
$mail="/usr/sbin/sendmail -t";
#$mail=“perl $main_path/cgi-bin/mail.pl”;
$maildefault=“admin@$sitename”; # default mail goes here
$mailtech=“tech@$sitename”; # support mail goes here
$mailsuggestions=“suggestions@$sitename”; # suggestions mail goes here
$mail_signature=("-“x12).”\nThank you for using our $mainname classifieds. Please fill free to use our service again. Don’t forget to tell your friends about us. Visit Us At $rooturl\n\n"; # Will be added to the end of sending emails if present

#Buttons
########

$home_button="<img src=".$rooturl."$main_images/home.gif border=0 alt=“Click here to back to Home”>";
$backtohome_button="<img src=".$rooturl."$main_images/continue.gif border=0 alt=“Click here to back to Home Page”>";
$backtosearch_button="<img src=".$rooturl."$main_images/backtosearch.gif border=0 alt=“Click here to back to search”>";
$backtomyads_button="<img src=".$rooturl."$main_images/backtomyads.gif border=0 alt=“Click here to back to your ads”>";
$sendmsg_button="<img src=".$rooturl."$main_images/sendmsg.gif border=0 alt=“Click here to send message by email”>";
$emailto_button="<img src=".$rooturl."$main_images/emailtofriend.gif border=0 alt=“Click here to send ad to friend”>";
$editad_button="<img src=".$rooturl."$main_images/editad.gif border=0 alt=“Click here to edit this ad”>";
$deletead_button="<img src=".$rooturl."$main_images/delete.gif border=0 alt=“Click here to permanently delete this ad with all related information”>";
$deleteuser_button="<img src=".$rooturl."$main_images/delete.gif border=0 alt=“Click here to permanently delete this user with all related information”>";
$button=“button.gif”; ## 180x170 PIXEL BUTTON IMAGE FOR USE IN LINKTOUS.CGI
$button1=“button1.gif”; ## 180x170 PIXEL BUTTON IMAGE FOR USE IN LINKTOUS.CGI
$button2=“button2.gif”; ## 180x170 PIXEL BUTTON IMAGE FOR USE IN LINKTOUS.CGI
$button3=“button3.gif”; ## 180x170 PIXEL BUTTON IMAGE FOR USE IN LINKTOUS.CGI
$button4=“button4.gif”; ## 180x170 PIXEL BUTTON IMAGE FOR USE IN LINKTOUS.CGI
$button5=“button5.gif”; ## 180x170 PIXEL BUTTON IMAGE FOR USE IN LINKTOUS.CGI
$banner=“banner.gif”; ## 468X60 PIXEL BANNER IMAGE FOR USE IN LINKTOUS.CGI
$banner1=“banner1.gif”; ## 468X60 PIXEL BANNER IMAGE FOR USE IN LINKTOUS.CGI
$banner2=“banner2.gif”; ## 468X60 PIXEL BANNER IMAGE FOR USE IN LINKTOUS.CGI
$banner3=“banner3.gif”; ## 468X60 PIXEL BANNER IMAGE FOR USE IN LINKTOUS.CGI
$banner4=“banner4.gif”; ## 468X60 PIXEL BANNER IMAGE FOR USE IN LINKTOUS.CGI
$banner5=“banner5.gif”; ## 468X60 PIXEL BANNER IMAGE FOR USE IN LINKTOUS.CGI

Spam filter

#############

If you have someone spamming the system enter their email address in spammers.dat

They will not be able to post ads or send messages to existing ads

$ban_spammers=1; # Ban spammers
$spammers_file="$data_directory/shadow/spammers.dat";

Bad words

###########

$censor = qq(ON);
$censorwords = qq({word1} word1 {word2} word2 {addmorewordsbetweenbarces} {likethis}); # inside braces censors any reference, outside braces censors exact match

Do NOT alter the following

############################

$link="<a href=searchads.cgi?spar=";
$bar="

<img src=".$rooturl.$main_images."/line.gif width=463 height=4 border=0>\n";
$bar1="<img src=".$rooturl.$main_images."/line.gif width=238 height=4 border=0>\n";
$table="<table cellspacing=0 border=0 cellpadding=";

THANK
YOU!

Chunky


#2

I don’t know too much about cgi, but I have read somewheres that cgi scripts need to be uploaded using binary not text.
The difference is if uploaded as text, some data may be missing if the file is binary.
Silk


#3

try:

$main_path="/home/chunky/atlanta.fsbocity.net"; # change to the main path on your server WITHOUT forward slash
$username=“chunky”;
$rooturl=“http://atlanta.fsbocity.net/”; # base url of site WITH forward slash
$rootbin=“http://atlanta.fsbocity.net/cgi-bin/totalclassifieds/”; # url of cgi-bin where all script files are placed WITH forward slash
$link_url=“http://atlanta.fsbocity.net/”; # url to create linking code to
$sitename=“atlanta.fsbocity.net”; # real domain name without www. at start

the first line’s comment is a little vague, main path to what? I assumed it wasn’t your user space and repalced it with the path to you web root as you referenced it in the lines below there…

without knowing where you’re installing this, where the ads will run and where specifically the script wants the paths for it’s a little confusing, hopefully that^ does it, if not, holler back

[color=#0000CC]jason[/color]


#4

This is offtopic, I just wanted to know where you got the time machine…

[quote]global.config Version 5.2 Released October 19 2005 #

http://www.kentuckylogistics.com - Email: admin@kentuckylogistics.com

##############################################################################

COPYRIGHT NOTICE

Copyright 2003 - 2006 Kentucky Logistics All Rights Reserved.

#[/quote]

It’s not even October yet, and they updated the copyright for next year already? This gave me a chuckle.

:cool: Perl / MySQL / HTML+CSS


#5

[quote]I don’t know too much about cgi, but I have read somewheres that cgi scripts need to be uploaded using binary not text.
The difference is if uploaded as text, some data may be missing if the file is binary.[/quote]
CGI is not a file-type, it is a mechanism for executing programs to send their output as content instead of simply sending the file itself as content.

That said, whether or not to upload as ASCII or binary depends on the file type. Here’s a rule of thumb. If file contents make sense when you open it in a text editor, upload as ASCII. If it looks like garbage, upload as binary.

The difference is handling what are called line breaks, or “new lines” sequences, in text files. UNIX uses LF, Windows uses CRLF, and Mac used CR. So ASCII mode converts CRLF to LF if uploading from Windows to Linux, for example, and vice versa when downloading. Obviously this is not good for binary files, which consist of machine code or complex data structures like audio/video and databases.

:cool: Perl / MySQL / HTML+CSS


#6

First of all, thank everyone for your time. I did add atlanta.fsbocity.net to the main path. i uploaded it in binary as well and changed permissions to 755. Didn’t work. i am going to relay your questions to the author and post his response.

THANKS,
chunky

Chunky


#7

did you make all the changes as suggested by user919? Including removing the www from the subdomain path?


#8

oops. no, i didn’t. will try right now. thanks, chunky

Chunky


#9

nothing.

Chunky


#10

can anyone tell me why i don’t need a cgi-bin or a public_html folder?
thank you,
chunky

Chunky


#11

on Dreamhost’s systems the equivalent of public_html will be the directory in your userspace that named yourdomain.com and the equivalent of the cgi-bin is basically anywhere you want it. cgi-bin used to be a centralized place that web hosts would allow you to keep and execute scripts, Dreamhost’s system allows that anywhere as long as the scripts are configured and permissioned properly.

[color=#0000CC]jason[/color]


#12

This is your path…

$main_path="/home/chunky/atlanta.fsbocity.net

(- Your path is always ="/home/chunky/your domain.whatever)

FTP in and upload the files ASCII (YOur FTP program should have an auto detect setting so that it always uploads text files like .cgi, .pl, .php files in ASCII and picture files like.jpeg and GIF files in binary. (I use coreFTP - coreftp.com) - it’s very fast!

Note: .cgi files almost always need the permissions changed to 755, not the default (644).

  • Page