Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

How to Edit .cgi files


  • Please log in to reply

#1
Robert Tracy

Robert Tracy

    Member

  • Member
  • PipPipPip
  • 150 posts
I see that Movable Type is back and making it easy. Years ago I did all the coding, etc and had a blog with MT until I switched hosting and lost all my sites.

But it's not so easy. I've got to edit the
mt-config.cgi-original
and/or a
mt-config.cgi
file. And I forget how to do it.

And I don't know what to put in it anyway. Here's what I've got:

Host Name 	mysql1.hostica.com (208.179.130.30) 
Port number 	3306 
Database name 	henry_reardon  
phpMyAdmin 	Built in phpMyAdmin control panel
you will need a properly configured dba user to log in (just add user with dba role if you don't have one)
What's a "dba role"?

My site would be at:

http://ideasillustra...rfigraphics.com

And if this is helpful:

HTML Directory Name /hsphere/local/home/henry/semperfigraphics.com

I get so far, and then this error:

Connection error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) at /hsphere/local/home/henry/ideasillustrated.semperfigraphics.com/cgi-bin/mt/extlib/Data/ObjectDriver/Driver/BaseCache.pm line 234 at /hsphere/local/home/henry/ideasillustrated.semperfigraphics.com/cgi-bin/mt/extlib/Data/ObjectDriver/Driver/BaseCache.pm line 234
.

I've got a little blog at WordPress but it's nothing Like MT was. Love to have MT back if it's as good as it was two years ago.

Thanks for your attention. :) Will be happy to supply any information I can find beyond the above.

Bob
  • 0

Advertisements


#2
azarl

azarl

    GeekU Admin

  • Administrator
  • 24,935 posts
Not used this myself but it will be something like:

[codebox]
ObjectDriver DBI::mysql
Database henry_reardon
DBUser UserName
DBPassword UserPassword
DBHost mysql1.hostica.com
[/codebox]

Substitute your own user name and password for UserName and UserPassword (these should have been supplied to you)
  • 0

#3
Robert Tracy

Robert Tracy

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 150 posts
Thank you.

That's exactly what I have in the mt-config.cgi And my information is correct.

Looking at it now though I see one extra piece of code at the top of that. It reads:

CGIPath  http://www.semperfigraphics.com/cgi/mt/

Is it possible that the problem lies there? That I should remove that piece of code? That it doesn't belong there?
  • 0

#4
azarl

azarl

    GeekU Admin

  • Administrator
  • 24,935 posts
Have you got PERL installed on your webserver, and a cgi directory?
  • 0

#5
Robert Tracy

Robert Tracy

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 150 posts

Have you got PERL installed on your webserver, and a cgi directory?


Yes, both.
  • 0

#6
azarl

azarl

    GeekU Admin

  • Administrator
  • 24,935 posts
Does the MySQL server you're trying to connect with accept remote connections? By default it's usually only local connections. I.E. the script is on the same domain as the server
  • 0

#7
Robert Tracy

Robert Tracy

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 150 posts

Does the MySQL server you're trying to connect with accept remote connections? By default it's usually only local connections. I.E. the script is on the same domain as the server


That I don't know. I have access via my control panel and see my MySQL, and see this as the only thing that looks appropriate to answer the question you pose. Please understand that I am really in the dark on any matters beyond a little HTML. So if you can, please guide me along the way.

Thanks much,

Robert
  • 0

#8
azarl

azarl

    GeekU Admin

  • Administrator
  • 24,935 posts
I know a little about MySQL but nothing about Movable Type, so don't expect expert answers :)

I think you need to ask your MySQL provider if your database can accept external connections. By default (for security) it only accepts connections from localhost, scripts running on the same server as the MySQL
  • 0

#9
Robert Tracy

Robert Tracy

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 150 posts

I know a little about MySQL but nothing about Movable Type, so don't expect expert answers :)

I think you need to ask your MySQL provider if your database can accept external connections. By default (for security) it only accepts connections from localhost, scripts running on the same server as the MySQL


I'll do that, and get back to you.

Thanks
  • 0

#10
Robert Tracy

Robert Tracy

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 150 posts
I contacted my hosting co. This is their answer:

The server does not allow external connections. We would need to know the IP address where the connection attempt is being made in order to evaluate the situation.


So, it looks like I just won't be able to use Movable Type. Correct?
  • 0

#11
azarl

azarl

    GeekU Admin

  • Administrator
  • 24,935 posts
Not necessarily. Could you install MySQL on the machine where you have the perl script? Provide the MySQL hoster with your IP, they may be able to to do it. I know of MySQL hosts who will allow external access, but they tend to charge
  • 0

#12
Robert Tracy

Robert Tracy

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 150 posts
This is what they said:

We have granted external MySQL access to your IP address. It will now be possible to use a program on your computer to connect to and interact with your MySQL database.



And at no charge.

I suppose this means I can now publish. I'll give it a try and perhaps report back.

No, I tried a test post and it will not publish. These are the errors:

Perl/CGI Script Issues

 Script Not uploaded in ASCII format.

Be sure to check ASCII in your FTP program before uploading your CGI scripts, otherwise they will upload in the incorrect Binary format.

 You forgot to make the script executable.

After uploading your Perl/CGI script, change the permissions on the UPLOADED script to 755 or rwxr-xr-x. This is usually done with your FTP program's "chmod" or "change permission" function (when right-clicking on the script).

 
Path to Perl is Incorrect.

In your Perl/CGI script, make sure to set the path to: #!/usr/bin/perl . Any other path will cause the Internal Server Error.

 
Other Issues

.htaccess File Has Wrong Syntax.

If you have a .htaccess file uploaded, double check that the syntax of the instructions is correct. Incorrect syntax or incorrectly written instructions will cause an Internal Server Error.

Please understand that I really am a boot at all this. However I'm positive that I uploaded the appropriate files in ASCII mode. But I do not find the Perl/CGI script anywhere nor the .htaccess file. If I could find these I do know how to set permissions.

Edited by Robert Tracy, 23 April 2008 - 12:05 PM.

  • 0

#13
azarl

azarl

    GeekU Admin

  • Administrator
  • 24,935 posts
Haven't done much Perl - can't get my head around it, but here goes:

If I remember correctly, "The file not uploaded in ASCII" can also be caused by issues with the text editor that you used. Something to do with Carriage Returns and Line feeds. Try re-editing in a freeware editor that specifically states it's designed for Perl and uploading again. I had problems using notepad on a windows system.

You should be able to use your FTP program to change the permissions on the uploaded script - it's usually right-click and select chmod or some thing similar

It says that the first line of your script should be #!/usr/bin/perl. Sometimes it's #!/usr/local/bin/perl or #!C:/perl/perl.exe on Windows. Check the script and change the first line to #!/usr/bin/perl if it isn't already

Try creating a test script for example...
#!/usr/bin/perl
print "Content-type:text/html\n\n";
print "It Works!";
...in your editor and save it as test.cgi or test.pl (check which extension your server uses). Upload to your server and navigate to http://www.yoursite.com/cg-bin/test.pl (or whatever your address and cgi-bin directories are)
If it displays "It Works!" then I think Perl is configured and working OK

The .htaccess file(s) can be in any or all directories - check the parent directory. It uses inheritance to pass the settings down to child directories unless there is another .htaccess. If you can't locate it, pass that error on to your hosting company's support

As I say, I'm not an expert in this so I don't know quite how good my advice is.
  • 0

#14
Robert Tracy

Robert Tracy

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 150 posts
I'm working with my hosting company and they tell me this:

The error_log is generating this error when attempting to publish the templates:

----

*** glibc detected *** realloc(): invalid pointer: 0xb7f568e0 ***

----

This is a programming bug. You'll want to contact the developers at MT to write a patch to correct this issue.


I suppose they may be right, although I doubt it. My version of MT is the latest, 4.1. And who knows how to contact MT anyway?

This is crazy.
  • 0

#15
azarl

azarl

    GeekU Admin

  • Administrator
  • 24,935 posts
I doubt it too. See here. Same problems , 4 years ago
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP