Print this page | Go back to previous topic | Forum name | The Computer Forum | Topic subject | A few more Mandrake Linux questions | Topic URL | http://www.pcqanda.com/dc/dcboard.php?az=show_topic&forum=2&topic_id=115533 |
115533, A few more Mandrake Linux questions Posted by mojo2185, Tue Jul-30-02 12:44 AM
Mainly, i'm trying to use linux for web programming and webservers. For the most part, i got what i want accomplished, but here's a few more questions: (hopefully, with these being answered, i won't have many more questions)
1. Currently, the only way to start the Apache server is to login as root and type the command in the terminal "/usr/local/apache2/bin/acpachectl start". Then the server can be accessed by root, and other users if i relog in as a different user. How can i start the server automatically when i boot the computer? I've tried using a program called SysV-Init Editor (didn't see any options about booting programs at startup), and i tried going into Mandrake Control Center->System->Services. At the Services, i could select certain programs to start at boot, but neither Apache, or apachectl were there.
2. All of my CGI programs have a default location for the perl interpreter, so the first line of code is #!/usr/local/bin/perl. Problem is, i don't have the perl interpreter at that location. Can i move perl to that location/reinstall to that location/link to that location? I've tried creating a application link, but it didn't seem to work (perhaps i did it wrong). Or am i stuck having to change the #!/usr/local/bin/perl for every CGI program?
3. Can i chmod an entire directory for my CGI programs? Or do i have to chmod every file seperately? If i do chmod the directory, what's the best permission to set so "any user" is allowed to use the cgi programs?
Thanks! Mojo
|
115534, RE: A few more Mandrake Linux questions Posted by Grogan, Tue Jul-30-02 01:37 AM
>At the Services, i could >select certain programs to start at boot, but neither >Apache, or apachectl were there. >
httpd
>2. All of my CGI programs have a default location for the >perl interpreter, so the first line of code is >#!/usr/local/bin/perl. >Problem is, i don't have the perl interpreter at that >location. Can i move perl to that location/reinstall to that >location/link to that location? I've tried creating a >application link, but it didn't seem to work (perhaps i did >it wrong). Or am i stuck having to change the >#!/usr/local/bin/perl for every CGI program? >
Perl is usually /usr/bin/perl (unless you compile it yourself and let it default to /usr/local). You can try creating a symbolic link in /usr/local/bin to work around this. I have seen that done on Redhat systems.
cd /usr/local/bin
ln -s /usr/bin/perl perl
This is very different than creating an "application link" (in your words)... that's just like a silly desktop shortcut. Remove it (beforehand if you named it "perl")
Note that's just the perl interpreter... there's more to perl than just that one binary so if this doesn't have the desired result then use a text editor with find and replace to change the path in your CGI scripts.
>3. Can i chmod an entire directory for my CGI programs? Or >do i have to chmod every file seperately? If i do chmod the >directory, what's the best permission to set so "any user" >is allowed to use the cgi programs?
Users don't use CGI programs. Only one user should be executing those, and that's the user the web server runs under (usually 'nobody').
But yes, you can chmod recursively, but it's not usually desirable unless all files in the directory are to have the same permissions (e.g. executable)
chmod -R 755 /whatever/directory
That would give you rwxr-xr-x on the directory and all subdirectories and files under it.
Don't ever do anything like chmod -R 644 on a directory with subdirectories though... because you'll deny access to those subdirectories. Be careful with chmod -R
|
115535, RE: A few more Mandrake Linux questions Posted by mojo2185, Tue Jul-30-02 01:41 AM
Thanks for the tips
As far as having httpd start as a service at boot, it can't be selected because it's not there. Do you know a way to add it to the services list so it can be selected to startup at boot? Thanks! Mojo
|
115536, RE: A few more Mandrake Linux questions Posted by Grogan, Tue Jul-30-02 01:51 AM
I have never seen a Mandrake setup that didn't have an entry for the web server in the startup services applet. So either it is there and you're missing it, or apache is not installed correctly. How was it installed? Did you install the Mandrake RPMs? Or did you just download a binary from some other site. If the latter, it's not what you should have done.
If worse comes to worst, you can add your command to start the server to rc.local and it will be processed.
That's /etc/rc.d/rc.local
|
115537, RE: A few more Mandrake Linux questions Posted by mojo2185, Tue Jul-30-02 02:19 AM
In downloaded the binary from Apache.org, it was the latest version of Apache 2."something" I extracted it, ran a "./configure --prefix=/usr/local/apache2" command, then ran "make" command, then ran "make install" command. It did install, but is there a better way to do it? (from a RPM?)
Just a note: I did uninstall the version of apache that came with mandrake, that was probably a RPM install.
One last question... on my windows, i have a mailserver setup locally, so i can test my cgi programs, to make sure they sendmail to my email client. Is there some sort of a email server (that handles pop3 and smtp) for linux, so i can test emails locally? an internet connection is not available for my computer running linux.
Thanks again Grogan! Mojo
|
115538, RE: A few more Mandrake Linux questions Posted by Grogan, Tue Jul-30-02 04:14 AM
>In downloaded the binary from Apache.org, it was the latest >version of Apache 2."something" >I extracted it, ran a "./configure >--prefix=/usr/local/apache2" command, then ran "make" >command, then ran "make install" command. >It did install, but is there a better way to do it? (from a >RPM?) >
Well that explains why you don't have a startup entry for it. What you did is really the *best* way to install something. Compile it yourself. However, to make it work seamlessly on your system with your old configuration you'd have to configure the source correctly by specifying parameters with ./configure so everything ends up in the same place, with the same options. It's not easy, trust me.
So let's not cry over spilt milk now... adding your 'apachectl start' command to the rc.local script will be sufficient.
Note: when adding commands to rc.local make sure you specify the full path.
/usr/local/apache2/bin/apachectl start
>Just a note: I did uninstall the version of apache that came >with mandrake, that was probably a RPM install. >
Unless you were going to do what I said above (configure the source so everything goes in the correct location) in addition to deleting the apache includes, uninstalling the rpms was the best thing to do.
>One last question... on my windows, i have a mailserver >setup locally, so i can test my cgi programs, to make sure >they sendmail to my email client. Is there some sort of a >email server (that handles pop3 and smtp) for linux, so i >can test emails locally? an internet connection is not >available for my computer running linux. >
Yes, there will be pop3 and smtp daemons that came with your distribution. The pop3 daemon will likely start via Xinetd, but sendmail (smtp daemon) should have a checkbox in that startup services applet. Check there, both may be there. If they aren't installed, the rpms will be on your CDs somewhere.
|
115539, RE: A few more Mandrake Linux questions Posted by Grogan, Tue Jul-30-02 04:53 AM
Sendmail
http://www.rpmfind.net/linux/RPM/mandrake/8.2/i586/Mandrake/RPMS/sendmail-8.12.1-4mdk.i586.html http://www.rpmfind.net/linux/RPM/mandrake/8.2/i586/Mandrake/RPMS/sendmail-cf-8.12.1-4mdk.i586.html http://www.rpmfind.net/linux/RPM/mandrake/8.2/i586/Mandrake/RPMS/sendmail-doc-8.12.1-4mdk.i586.html
POP (gives you pop3d in addition to imap daemon)
http://www.rpmfind.net/linux/RPM/mandrake/8.2/contrib/i586/courier-imap-pop-1.4.2-1mdk.i586.html
|
115540, RE: A few more Mandrake Linux questions Posted by macro, Tue Jul-30-02 08:27 AM
accident... please ignore
|
115541, RE: A few more Mandrake Linux questions Posted by mojo2185, Tue Jul-30-02 08:32 AM
Thanks Grogan! It looks like i have some sort of mail system on my linux, its all grouped together in something called Postfix... I think i got the SMTP part working, but i can't get my mail, i always get "Couldn't Connect to Micron." I can Telnet to my SMTP server, using the command Telnet Open 127.0.0.1 25, but i can never find the port for my delivery server. Unfortunately, i haven't found a guide to this in my documentation, so i'm DEFINATELY going to try the links you gave me, hopefully they'll atleast have a readme file, and better yet, be easy to configure.
I noticed there's different versions, such as the "i586, i686(or something like that)". What's the difference between these?
Thanks a ton! Mojo
|
115542, RE: A few more Mandrake Linux questions Posted by Grogan, Tue Jul-30-02 09:06 AM
That's the processor architecture it's compiled for. Everything in Mandrake is compiled for i586 by default (so it'll run on older pentium computers as well as newer and x86 compatibles). I would not get the i686 packages (for Pentium Pro or higher) because they are probably from Mandrake Cooker (unstable, development version of Mandrake). If you're looking around at rpmfind.net or anywhere else, stay away from any RPMs that say they are from Mandrake Cooker. Get only rpms that are for Mandrake 8.2 or you will have dependency problems.
It does not make very much difference... a package built for i686 may not be any faster or better on your computer than i586. It really depends on the code as to whether or not there will be any gains by optimizing for 686.
>I noticed there's different versions, such as the "i586, >i686(or something like that)". What's the difference between >these? > >Thanks a ton! >Mojo
| |