Installing Apache

Superfly3176

Supreme [H]ardness
Joined
Feb 17, 2005
Messages
4,770
I need help I download the tar file and extract it to a folder called Apachehttpd. This creates a directory called httpd-2.2.3. Im not sure where to go from here, I understand how to open terminal and whatnot, but im not sure what commands will preform the install. Thanks for the help im learning about linux in class and really not getting it.
 
Sounds like you downloaded the source file for Apache2.

More than likely you'll need to run these commands from inside that httpd directory:

./configure
make
make install

What Linux are you running? Fedora? Debian? A lot of Linux distros now have package managers that can download and install the software for you.
 
Yes - If you're running Debian/Knoppix/Ubuntu/Kubuntu, you can use APT-GET.

Fedora = YUM Install Apache2
 
Carloswill said:
Yes - If you're running Debian/Knoppix/Ubuntu/Kubuntu, you can use APT-GET.

On those distros, make sure you use: apt-get install apache2

I tryed just: apt-get install apache, and I found out that there was some problem with some of the archives, plus that would have installed Apache 1.3.
 
Sorry its Fedora core 4. Can I still use apt-get or need I do the ./configure

So I need to cd in command line to httpd-2.2.3 and type

./configure
make
make install

Is that exactly as you have shown it?
 
[H]exx said:
Make sure you read up good on the Apache Manual as there are a lot of things you can do with this version...

No doubt! I thought I had a good general understanding of Apache 1.3, then most of the way thrown out the window when I took a look at the Apache2 config files! :p
 
Okay the install worked, I went to Services and activated httpd for run 5 and 3. I was able to do http://localhost/ and got the page up. I also made a page in /var/www/html/Home. Few questions though.

A) How do I actually open apache to do things like change the directory of webpages.
B) Does it have a GUI to do this in or is it totally text-based
C)Where are simple configuration changes made.

Thanks for the help.
 
Superfly3176 said:
Okay the install worked, I went to Services and activated httpd for run 5 and 3. I was able to do http://localhost/ and got the page up. I also made a page in /var/www/html/Home. Few questions though.

A) How do I actually open apache to do things like change the directory of webpages.
B) Does it have a GUI to do this in or is it totally text-based
C)Where are simple configuration changes made.

Thanks for the help.

If you reall want to learn, your best bet is to edit the config files by hand. The Apache2 config files on my system are in /etc/apache2. Many are in the config.d directory (look for apache2.conf). You can change your root web directory through these files, as well as allowing users on your system to set up web pages under their home directory.

Make sure you backup any of the config files before you make any chnages to them. Use:

cp apache2.conf apache2.conf.bak
 
Superfly3176 said:
Okay the install worked, I went to Services and activated httpd for run 5 and 3. I was able to do http://localhost/ and got the page up. I also made a page in /var/www/html/Home. Few questions though.

A) How do I actually open apache to do things like change the directory of webpages.
B) Does it have a GUI to do this in or is it totally text-based
C)Where are simple configuration changes made.

Thanks for the help.

a) manually edit the configs
b) text based. There are GUI's out there (webmin for example)
c) depends on your distro, mine is in /etc/apache/httpd.conf
 
How do I make my website available to the network? I'm having connection troubles and nothing seems to be working. On other Linux machines it says connection refused.
 
let's start with some basics...

In a terminal, run the "netstat -ta" command.

Does it output a line that looks similar to this?
Code:
tcp6       0      0 *:www                   *:*                     LISTEN     17338/apache2

What we're doing here is we're verifying that my apache2 is actually binding to an internet interface on my machine. It is. Furthermore, the line that says *:www means that its binding to ALL interfaces (which is fine by me, I only have 1 ethernet and 1 localhost interface on this box).
You should see that as well (for starters), If yours says "localhost:www" then you are only binding to your loopback address.

To correct this, investigate your virtual host config and remove the entry that binds it to your localhost. by removing it, it should default to binding on all addresses. Virtual host examples

If you are correctly bound and still get connection refused... are you firewalled? Are you attempting to connect via IP or DNS name? If you are connecting via DNS name, are you sure it is resolving properly? Try via IP.
 
I removed the firewall and that worked for me. It seems though even though I have added a simple html file, the webserver hasn't changed. I edited the file on the test page /etc/httpd/conf.d/welcome.conf to comment out. Is this using the <!-- html to comment out? That's what I used.
 
Make sure your httpd.conf file (or whatever) or your virtual hosts stanza indicates the directory that you wish to "serve"

Mine is /var/www/ and it serves index.html/index.php as default.

Slap a generic html file in your /var/www directory (or wherever your httpd.conf says your "DocumentRoot" is).

I'd suggest for your generic HTML file, a simple hello world page. Save this code as helloworld.html in your DocumentRoot folder.

Code:
<html>
 <head>
  <title>
   Hello World Demonstration Document
  </title>
 </head>
 <body>
  <h1>
   Hello, World!
  </h1>
</body>
</html>
plug into your browser :
http://servername/helloworld.html
 
I have a config question in Apache and I hope I can ask it here instead of creating a new thread.

I am (new to apache) reading about the httpd.conf file. The section where I can set httpd to run as a different user or group. Is that the user that a web user is going to be when they hit the site? If it is, is there a way, in httpd.conf, that I can set some environment variables for that user so they can use a php to call perl that calls an app? The app needs the variables set that is generally set in either bashrc or .bash_profile but the system admin rather have it set in the httpd.conf. Possible?
 
Back
Top