User Control Panel
Advertisements

HELP US, HELP YOU!

Apache

 
Post new topic   Reply to topic    Bot Depot Forum Index -> General Programming Questions
View unanswered posts
Author Message
Cheater
Senior Member
Senior Member


Joined: 10 Jun 2005
Posts: 236

Reputation: 15.8Reputation: 15.8

PostPosted: Fri Sep 30, 2005 10:56 am    Post subject: Apache Reply with quote

I have a bot that a friend and I are making together. I'm trying to install apche web server (which I've done.). I made a little form that adds a reply to the bot (tested and everything). Now, I need to figure out how to make it so he can access the server. I would like to do this without paying if possible.
Back to top
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Fri Sep 30, 2005 11:02 am    Post subject: Reply with quote

Is the Apache server on your own computer (/or the computer the bot runs on)? If so, the bot can get into the server's files anyway without having to go through the HTTP protocol...

Like if your root is C:/public_html, and your add-replies being in C:/public_html/cgi-bin/addreply.cgi, and your reply list being in public_html/replies.txt, you would just open that through your bot...

Code:
open (REPLIES, "C:/public_html/replies.txt");


Or if you don't like doing that or if the bot isn't on the same computer as your Apache server, use LWP::Simple or LWP::UserAgent to request the file's URI...

Code:
my $replies = LWP::Simple::get "http://localhost/replies.txt";


'localhost' would be okay if the server was elsewhere on your local network. If it was on an entirely different network altogether you'd probably use its external IP address to access it...

edit

I'll give you a real example...

I run my own Apache server too, which aichaos.com and my bot runs off of. So my Aiden bot has a plugin that updates the "aiden.stats" page AiChaos every 5 minutes...

Server Root = D:/Web/AiChaos/
Code:
# AiChaos handler: updating stats file.

&queue ('statz', 15, "\&uploadstats();");

sub uploadstats {
     # Get the stats.
     my @stats = &stats();

     my $stamp = &timestamp();

     # Write.
     my $src = '<b class="header">:: Aiden Current Statistics</b><p>

<div align="center">
<table width="504" border="0" cellspacing="0" cellpadding="5" class="fnt">
     <tr>
          <td width="168" align="center" valign="middle">
               <b>Aiden Version</b><br>
               $stats[0]
          </td>
          <td width="168" align="center" valign="middle">
               <b>Number of Bot Connections</b><br>
               $stats[1]
          </td>
          <td width="168" align="center" valign="middle">
               <b>Number of Replies</b><br>
               $stats[3]
          </td>
     </tr>
     <tr>
          <td width="168" align="center" valign="middle">
               <b>Number of Users</b><br>
               $stats[5]
          </td>
          <td width="168" align="center" valign="middle" style="border: 1px solid #CCCCCC">
               <b><a href="$self?display=aiden.contact">Chat With Me!</a></b>
          </td>
          <td width="168" align="center" valign="middle">
               <b>Last User I Talked To</b><br>
               $stats[4]
          </td>
     </tr>
     <tr>
          <td width="168" align="center" valign="middle">
               <b>Blocked Users</b><br>
               $stats[6] ($stats[7])
          </td>
          <td width="168" align="center" valign="middle">
               <b>AIM Warners</b><br>
               $stats[8] ($stats[9])
          </td>
          <td width="168" align="center" valign="middle">
               <b>Permanently Banned</b><br>
               $stats[10] ($stats[11])
          </td>
     </tr>
     <tr>
          <td width="504" colspan="3" align="center" valign="middle">
               <i>Stats last updated on $stamp</i>
          </td>
     </tr>
</table>
</div>';

     $src =~ s/\$stats\[(.*?)\]/$stats[$1]/g;
     $src =~ s/\$stamp/$stamp/g;

     # Send it.
     open (PAGE, ">D:/Web/AiChaos/vfive/pages/aiden.stats.txt");
     print PAGE $src;
     close (PAGE);

     # Another one in 5 mins.
     my $next = 60*5;
     &queue ('stats',$next,"\&uploadstats();");
}
1;


This kinda does things in reverse of what you're looking for, but it's a good example nonetheless. In this, the bot writes a file to the server's public directory. You'd just open a file in read mode to read a file from the server's directory as usual.

_________________
Current Site (2008) http://www.cuvou.com/
Back to top
Cheater
Senior Member
Senior Member


Joined: 10 Jun 2005
Posts: 236

Reputation: 15.8Reputation: 15.8

PostPosted: Fri Sep 30, 2005 7:59 pm    Post subject: Reply with quote

I think you misunderstood. I know how to do the addreply part. My computer has apache and the bot on it. I need to find a way for a friend in a different network to access my apache server. Is there a way to do this without a domain name? Something said my ip address was private? (any idea what that means)?
Back to top
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Fri Sep 30, 2005 10:49 pm    Post subject: Reply with quote

Cheater wrote:
I think you misunderstood. I know how to do the addreply part. My computer has apache and the bot on it. I need to find a way for a friend in a different network to access my apache server. Is there a way to do this without a domain name? Something said my ip address was private? (any idea what that means)?


Ohh, I get what you mean now...

You'll need access to open a port to your external IP address. Your external IP is whatever a site such as whatismyip.com would tell you. If you're behind a router or something you'll have to direct that port to your specific computer.

You can get free DNS services, for example www.cjb.net when you set up your domain forwarding, leave most of the fields blank but next to "IP Address" you'd put your IP.... then your .cjb.net site would be like an alias to your computer.

But beyond that, there's then the issue of dynamic IP addresses. If you're on a system like dial-up, for example, your IP address probably changes VERY often. In a case like that, servers aren't effective because it's very difficult to find your server each time the IP changes. So it's best to have like a cable modem or otherwise having an IP that very rarely changes.

_________________
Current Site (2008) http://www.cuvou.com/
Back to top
Cheater
Senior Member
Senior Member


Joined: 10 Jun 2005
Posts: 236

Reputation: 15.8Reputation: 15.8

PostPosted: Sat Oct 01, 2005 12:16 am    Post subject: Reply with quote

I use DSL. But I also have 2Wire for wirless internet. If I go to a site that shows you your ip(not sure if it changes), and put that in the address bar, I get an error. If I use the IP given by 2Wire (which doesn't change), it loads apache.

Edit: I figured it out. I had to set it up so it would allow Apache through the firewall. It then gave me a special IP for it which allows other people to get to me server.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> General Programming Questions All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group