LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Background information on install methods (https://www.linuxquestions.org/questions/linux-newbie-8/background-information-on-install-methods-293579/)

Maarten_Holland 02-22-2005 05:05 PM

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

jonaskoelker 02-22-2005 07:17 PM

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 :D).

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'.

Maarten_Holland 02-23-2005 02:17 AM

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!

jonaskoelker 02-26-2005 04:34 AM

>> 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


All times are GMT -5. The time now is 05:22 AM.