Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Welcome to LinuxQuestions.org, a friendly and active Linux Community.

You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!

Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.

If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.

Having a problem logging in? Please visit this page to clear all LQ-related cookies.

Introduction to Linux - A Hands on Guide

This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.

Problem: Website made up of file type:
"ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped" sits on one server and runs fine, all file extensions are .rcc
I attempt to copy the website and move to another Apache/Linux server, and I can only see the compiled code.
For instance index.rcc looks great on current server, but I copy the entire site folder, upload it to new server, and index.rcc looks like a bunch of squares, circles, lines, and little text.

The closest I feel like I've gotten to a step in the right direction is:
"About:
RC is a dialect of C that adds safe, region-based memory management to C. Region-based memory management allocates objects in a program-specified region. Objects cannot be freed individually; instead regions are deleted with all their contained objects. RC is safe, since for each region, r, it maintains a reference count of the number of external pointers to objects in r (i.e. of pointers not stored within r). Deleting a region with a non-zero reference count causes a runtime error (abort). RC's compiler, rcc, is based on gcc."
as found at freshmeat.net/projects/rcc/
But I could be lightyears away on this one.

Access to the source isn't possible(relationship between my client and developer went bad, unfortunately.)

I greatly appreciate any help and moderators, if you feel like this post would be better answered in another forum, please move it.

I'm back, and I hope I have gotten a little closer to solving this.
From what I can tell, an ELF file (Extendable and Linkable Format) begins as a C/C++
This is taken verbatim from developers.sun.com/solaris/articles/elf.html

"Executable and Linkable Format is a portable object file format supported by most UNIX® vendors. It is the dominant file format for UNIX executables, object files and libraries. ELF was originally developed and published by UNIX System Laboratories, and defines the format of an ELF object file.

ELF helps developers by providing a set of binary interface definitions that are cross-platform, and by making it easier for tool vendors to port to multiple platforms. Having a standard object file format also makes porting of object-manipulating programs easier. Compilers, debuggers, and linkers are some examples of tools that use the ELF format.
ELF

The ELF specification describes three kinds of object files.

1. Relocatable files - Hold code and data suitable for linking with other object files
2. Executable files - Hold code and data that can be executed on the target operating system
3. Shared object files - Hold relocatable data that can be statically and dynamically shared with other shared objects

Relocatable files are also called as object files (.o files). They are generated by the compiler during compilation of a source file (such as a C or C++ file). These object files are then processed by the linker to produce either an ELF executable or shared objects (also called shared libraries). Executable ELF objects can then be executed by the user. A shared library is a collection of routines that different object files or executables can share. Shared libraries are made up of several object files with position independent code (PIC). "

Now if I get this correctly, ELF is just the result of a compiled C/C++ file? If this is true, then would it also be true that the /usr/bin would have to contain some sort of file allowing for the execution of these compiled files?
Okay, I can look through the current server /user/bin and see these files
c++
c++decl
c++filt
Do these relate in any way to the execution of these ELF files.
There are many more of these in the /usr/bin/ such as a /gcc which I understand to be a compiler.

I opened the 'c++' file and found this snippet
'exec startfile /usr/lib/gcc-lib/'

I'm really not sure if any of this will help you all help me, but I certainly hope so. If you can't tell, I'm trying very hard to find a way out of this, but I have to get some kind of reassurance on my 'theories' before taking any actual steps.

I did what you said, and when I try to access it I get an Internal Server Error with this line
The server encountered an internal error or misconfiguration and was unable to complete your request.

and this line
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Now, I have had that problem when using a Perl script(FormMail from MSA I think), but if I remember correctly, I changed the permissions and it fixed the problem. The new site uses Cpanel and I changed the permissions to 755 before trying to access it via /cgi-bin/index.rcc. So does this mean the server just needs to be configured to execute a file such as this?

Then the problem is the Apache I'm using just isn't configured to handle it. Seems simple enough (half-kidding)

I would assume I need to configure Apache to handle this program outside of the cgi directory, so using ScriptAlias wouldn't be enough. I would need to activate the handler using AddHandler or SetHandler (which one i'm not sure of yet) and specify ExecCGI in the Options directive.

If you can run it (even with errors) then apache can run it also. I know for sure it can run programs written in C.
You can take a look at the apache error_log to see if you find anything about the internal server error.
If you use the ScriptAlias directive you don't need the UserDir. Or else:

Keeping in mind, I'm very new at this stuff :
From webmin on current server I go to the 'command shell' and type in

Code:

./index.rcc

This returns

Code:

> ./index.rcc
sh: line 1: ./index.rcc: No such file or directory

The new server is not under my control, except cpanel. They are trying to help me, but they seem just as lost as I do, so I'm trying to help them help me.

When I try to access file from web browser in a directory outside of cgi-bin, I get no error, just a bunch of un-readable code.
When I try to access file located in cgi-bin, I get the 500 internal server error and the error log gives this:

I assume the first one is looking in .htaccess for my error handling page which doesn't exist.
I assumed I couldn't use the ScriptAlias directive because the files will be located outside of the cgi-bin. I'm thinking I need to tell something that .rcc needs to be ran as a cgi script, then whenever a .rcc file is encountered, the server automatically handles it that way. Or this could just be nonsense. I usually love trial and error.

I really appreciate your help, I have a feeling you want me to run ./index.rcc from the new server and get the output, but I can't see where I have access to a command line.
Let me know what I need to do to give you any information you feel will help.

The error "Premature end of script headers: /home/bbd/public_html/cgi-bin/index.rcc" means that your file does not produce valid html headers. Are you sure that you can run it directly from apache? What is the way you use this application till now? You can try also the other .rcc files to see what happens. Perhaps you need some other file(s) to exist on the server, so to be able to run *.rcc (see also the error: "sh: line 1: ./index.rcc: No such file or directory").
Since you have access to the current server take a look at httpd.conf (and perhaps the other *.conf files) to see if you have to enable other thing, such as SSI or "AddType application/? .rcc"

Right now, the file is accessed by going to a website url, index.rcc is performing like index.html. Going to www.domain.com = www.domain.com/index.rcc . I did try another .rcc file, I put it in the cgi-bin, changed the permissions, and same result. My host did AddHandler directive but that didn't change anything either. I'm off to look at the *.conf files now.

The ExecCGI is what I see as important, it means that CGI scripts can be executed in this directory. Which, to me is saying, 'This file is a CGI script, and just because it doesn't sit in the folder defined in the ScriptALias directive, we should still let it execute'

Okay, I'm going back and you know I'll keep you all updated, don't give up on me bathory, I'll get it.

Chris

Edit, found this line:"DirectoryIndex index.rcc index.html index.html.var"
I'm assuming that is why index.rcc can respond the same as an index.html.

Ha, and I found this
AddHandler cgi-script .pl .rcc , which needs execCGI to perform.(The .rcc is what got me all happy and stuff)

I'd be willing to bet, with this addhandler, and the Options directive correctly done on the public_html/ directory, and the DirectoryIndex directive, this script will be running.