LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-22-2005, 05:05 PM   #1
Maarten_Holland
Member
 
Registered: Sep 2003
Location: Holland
Distribution: SuSE 9.2
Posts: 39

Rep: Reputation: 15
Background information on install methods


Hi all,

I'm working with Linux on my webserver for personal fun use for quite some time now.

I've managed to install and configure LAMP, ProFTPd and other programs, by following and adjusting several great tutorials.

The problem here is that I don't really understand what takes place during configure, make and make install and what the consequences are.

Does anyone know some simple tutorials or pages which give me some background information on this subject?

A specific question that I have is this:

I've installed Apache with PHP as a static module (the CMS that I use prefers PHP to be statically build). Now I want to enable mod_dav for Apache. When I configure it using ./configure --with-apxs=/usr/local/apache/bin/apxs or ./configure --with-apache=/usr/local/apache does that add mod_dav to my existing installation or does it reinstall Apache which means that I lose my existing modules like PHP?

I hope you understand what I mean and that you're willing to give me some hints.

Thank you for your time.

Cheers,

Maarten
 
Old 02-22-2005, 07:17 PM   #2
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 47
Hi.

I'll try to explain the differences as best as I can. First some background information: there are many different versions of unix (various shells, kernels, and distros just for linux -- there are of course *BSD plus commercial unixes such as HP-UX, etc.). Thus, writing portable programs isn't easy. So, (hold on) some clever programmers made a program (autoconf) that, when fed information about the program you're writing (say, apache, if you were an apache developer) generates a highly portable shell script (./configure) that finds out certain information about the environment and generates a makefile. A makefile is a file that tells make (as run by the command `make') how to generate programs from the source code. Most often, it's used to keep track of time-dependencies (if sourcefile x.c is newer than program x, create program x again). `make install' tells make to create the install `thing' (phony target); typically, this means copying the finished program into some predefined location (/usr/bin, /usr/local/bin, etc.) and maybe meddle with some configuration files. The idea is that you can just say `make', then run the program from the folder where you extracted it before deciding to _really_ install it -- and a mean old `rm -rf ./*' should clean in up without giving you headaches.

recall what I said about there being many different versions of unix. Most of them handle configuration files in slightly different ways (`it _almost_ all the same shit, but the difference matters'). Thus, most of them have some kind of package management system (something functionally similar--and hopefully superior--to *.ini/*.msi plus registry database or whatever it's called). The point of these are to save the user from some of the burden of compiling and configuring, plus automagically avoiding dependency hell. Most also provide a huge number of programs (I think it's close to 2 ** 13 for debian), often including apache. I haven't compiled it myself, so I can't answer that part of your question. But I can say that it's been quite easy getting it up and running by `apt-get install apache' -- your distro might have something similar.

Not really being much of a web-hacker, I can't compare make to CMS, but anyways I'll voice my positive opinion of make -- whenever you have a dependency graph between files, make can make your like easier (and hey, it's turing complete ).

For a tiny example, put this in hello.c:
Code:
# include <stdio.h>
int main (void) { puts ("hello, world"); }
then run make (which automagically knows that `hello' depends on `hello.c'):
Code:
$ make hello # hello does not exist, create it.
cc   hello.c  -o hello
$ make hello # hello.c is not newer than hello
make: `hello' is up to date
$ touch hello.c # sets last modification time of hello.c to now.
$ make hello # hello.c is newer than hello, create hello again
cc   hello.c  -o hello
$ rm hello hello.c # cleaning up the mess
$ ^D
Hope this helps,

Jonas

PS. you may want to include your distro in your `personal information', so that people can provide distro-specific help. It's under `user CP'.
 
Old 02-23-2005, 02:17 AM   #3
Maarten_Holland
Member
 
Registered: Sep 2003
Location: Holland
Distribution: SuSE 9.2
Posts: 39

Original Poster
Rep: Reputation: 15
Thank you for this extended reply! It clears a lot for me.

I use SuSE Linux which has YaST for package management. It's a great way to install programs, but I like to do it using make, so that I can learn more of Linux and the way it operates, since that's the fun part, isn't it? I only use YaST when I really need a program and can get it to work myself. (Which unfortunately happens more often than I'd like).

The part that isn't clear for me is the place that files (like the makefile) go and the way that installed programs are handled (updates, removing, extending etc).

Where does a makefile go? What happens in my example where I've already installed Apache and want to add another module? Can I add that to the makefile and do a new make install or should I completely start over?

I hope you want to answer these questions too.

Thank you for your time. Your help is highly appreciated!
 
Old 02-26-2005, 04:34 AM   #4
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 47
>> Thank you for this extended reply! It clears a lot for me.
yw.

>> I use SuSE Linux which has YaST for package management. It's a great way to install programs, but I like to do it using make, so that I can learn more of Linux and the way it operates, since that's the fun part, isn't it? I only use YaST when I really need a program and can get it to work myself. (Which unfortunately happens more often than I'd like).
To each his own. I'm lazy (one of the higher art forms of geeks, especially programmers), but if you find it fun, more power to you

>> The part that isn't clear for me is the place that files (like the makefile) go and the way that installed programs are handled (updates, removing, extending etc).
update, removing, extending, etc: I leave that to the package manager; I belive it does a better job that I will.

>> Where does a makefile go? What happens in my example where I've already installed Apache and want to add another module? Can I add that to the makefile and do a new make install or should I completely start over?
the makefile usually should reside pretty close to where the source code is;
I haven't got experience with compiling Apache myself, so unfortunately I can't help you.

>> I hope you want to answer these questions too.
I want to, but as I said: I don't know, sorry.

>> Thank you for your time. Your help is highly appreciated!
once again, yw
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What are the best methods to install software packages? DennisSullivan Linux - Newbie 3 10-12-2005 06:40 PM
methods of install in terminal??? DMZeplin Mandriva 2 02-19-2005 09:14 PM
How to install background image behind console mezzenger Linux - General 1 04-10-2004 04:54 PM
Other install methods? Icon Mandriva 7 11-01-2003 04:14 AM
FreeBSD...Programs Install methods... Obscure *BSD 12 06-03-2003 02:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration