LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 07-12-2003, 02:08 AM   #1
Big Brad
Member
 
Registered: Jul 2003
Location: Australia, Geelong
Distribution: Red Hat 8 & Fedora Core 3
Posts: 52

Rep: Reputation: 15
Question Setting up Apache


Hi guys I really need some help. I am just new to linux and would really like to set up an Apache web server on a Red Hat 8 machine. I bought a step by step manual thing for $5 off the net but it kind of doesn't offer much in the way of real troubleshooting. So I was kind of hoping some of the more experienced might be able to help me. The manual told me to set up a Virtual Host which I didn't quiet understand. I got the server to work fine just locally as in localhost but could not get it working across my home network. I was planning on setting it up on my home network before buying a domain name or anything. Then taking it and putting it in my dads office behind a nice ADSL connection. So what I am after is just some really basic instructions on how to set up a really basic web server.
Assume I Know Nothing.
 
Old 07-12-2003, 02:22 AM   #2
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Welcome to LQ

I do my best to assume the worst, but you've said you successfully shown it as localhost, so I'm thinking this might not be an apache problem, but rather part of a networking access to it problem. First thing I'd like to point you towards is:
http://www.linuxquestions.org/questions/answers.php (it's titled Bulliver)
There has been a tutorial posted up on setting up a LAMP server. What LAMP is:
Linux Apache MySQL PHP
These are common interleaved applications that run on webservers. If you don't find information on setting up apache there, you might look over the docs on www.apache.org

Which version of apache is this? Also, can you describe to us a bit about your network setup? What kinds of machines you have and how they all connect?

Cool
 
Old 07-12-2003, 03:01 AM   #3
Big Brad
Member
 
Registered: Jul 2003
Location: Australia, Geelong
Distribution: Red Hat 8 & Fedora Core 3
Posts: 52

Original Poster
Rep: Reputation: 15
Ok I can tell you that all the machines on the network are MS machines and my web server is the only linux box. My Dads Windows 2000 box is the gateway to the www and all the other machines fan out from the hub. I am using the version of Apache that comes with Red Hat 8 what ever that is. I have already had a look at the docs at apache.org but they dont really help. I can get Apache working on windows and all the computers on the network can see my web site. your probably woundering why I dont just host the site with an MS box thats because one day I would also like to set up a mail server and I would really like to learn about linux.
 
Old 07-12-2003, 03:10 AM   #4
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Yeah, I don't think anyone here would wonder why you wouldn't use linux to run a server

Ok, first thing I'd look at would be dropping your IPTables then. This could easily be what's blocking you (you seem aware enough of your network setup for me to not persue that route). So let's take a peak at what is setup (if anything) with your IPTables (read firewall):
As root type:
iptables -L
If you get command not found, try:
/sbin/iptables -L (or a whereis iptables and then use that path).

And post up the tables returned. To post up from a console to here:
highlight the text to be pasted, click here, and use your middle button (if you don't have a middle button, use your scroll, if neither, use both buttons at the same time).

Cool
 
Old 07-12-2003, 03:48 AM   #5
Big Brad
Member
 
Registered: Jul 2003
Location: Australia, Geelong
Distribution: Red Hat 8 & Fedora Core 3
Posts: 52

Original Poster
Rep: Reputation: 15
Here are your IPTables this means nothing at all to me. It is all another language.


Chain INPUT (policy ACCEPT)
target prot opt source destination
RH-Lokkit-0-50-INPUT all -- anywhere anywhere

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Chain RH-Lokkit-0-50-INPUT (1 references)
target prot opt source destination
ACCEPT udp -- ns1.brad.com anywhere udp spt:domain dpts:1025:65535
ACCEPT tcp -- anywhere anywhere tcp dpt:http flags:SYN,RST,ACK/SYN
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
REJECT tcp -- anywhere anywhere tcp dpts:0:1023 flags:SYN,RST,ACK/SYN reject-with icmp-port-unreachable
REJECT tcp -- anywhere anywhere tcp dpt:nfs flags:SYN,RST,ACK/SYN reject-with icmp-port-unreachable
REJECT udp -- anywhere anywhere udp dpts:0:1023 reject-with icmp-port-unreachable
REJECT udp -- anywhere anywhere udp dpt:nfs reject-with icmp-port-unreachable
REJECT tcp -- anywhere anywhere tcp dpts:x11:6009 flags:SYN,RST,ACK/SYN reject-with icmp-port-unreachable
REJECT tcp -- anywhere anywhere tcp dpt:xfs flags:SYN,RST,ACK/SYN reject-with icmp-port-unreachable


 
Old 07-12-2003, 04:21 AM   #6
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
For now, let's flush em and see if you get a connection:
iptables -F

This basically will turn off your firewall.
After this, try connecting to the machine (you are connecting by IP for now right? And it's an internal/private IP right?...)

Just so you know, I believe RH comes with a graphical utility to do all of this, you might look in your Control Center for a mention of firewall.



Cool
 
Old 07-12-2003, 09:13 AM   #7
Big Brad
Member
 
Registered: Jul 2003
Location: Australia, Geelong
Distribution: Red Hat 8 & Fedora Core 3
Posts: 52

Original Poster
Rep: Reputation: 15
Ok I have managed to get it to work by just tweaking a couple firewall settings. I went and had a look for that graphical utillty you were talking about and I found it. Thanks

Could you give me a little bit of a fill in on Virtual Hosts because when I come to sort this out for real I would like to know what I am doing.
 
Old 07-12-2003, 09:31 AM   #8
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Virtual Hosts is not nearly as bad as it will sound when reading about it. It's (in a nutshell) the ability to have more than 1 httpd.conf file all in 1 httpd.conf file. Near the end of your httpd.conf should be an example of the Virtual Hosts directive and comments explaining each function.

I don't know much about Apache 2.x so everything I talk about is related to 1.3.x
The Virtual Hosts directive can either be bound to an IP or a domain name. Assuming this site goes live, this domain will actually have to be registered through a DNS registar (such as www.godaddy.com ). If your ISP blocks port 80 you'll want to bind your Apache to a different port, and then follow the instructions (or similar instructions) here:
http://www.zoneedit.com/doc/faq.html#faq21

Finally, make sure you remember that when you make changes to your httpd.conf file that you restart apache each time. This can be several ways, distro-independant should be:
apachectl restart
Or:
/sbin/apachectl restart

Lets see, what else...
If/when you make Alias definitions, be sure to place them inside the VirtualHost directive, and more importantly, in the correct one.
Just about any of the actual Apache directives can work inside the Virtual Host directive. The exceptions that come to mind are:
user/group apache runs as... Basically the "Global Environment" directives should be addressed globally

HTH

Cool
 
Old 07-12-2003, 12:43 PM   #9
softgun
Member
 
Registered: Jun 2003
Posts: 119

Rep: Reputation: 15
Sorry to barge in but...

I too am setting up Apache for the first time. When I start Apache in etc/init.d by typing apache, it says that it cannot get the domain name of the server and will default to 127.0.0.1.

It works on the machine but i cannot log in from any of the clients.

ANy explanation? Or is it a question for Obviousman?
 
Old 07-12-2003, 07:47 PM   #10
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Have you edited your httpd.conf file at all? You'll need to edit it to match your needs/situation. You'll also wanna provide a hostname to your server, that is set different ways on different distros, but it's discussed frequently so a search for "set hostname" will probably reveal your answer on that.

Cool
 
Old 07-12-2003, 08:47 PM   #11
Big Brad
Member
 
Registered: Jul 2003
Location: Australia, Geelong
Distribution: Red Hat 8 & Fedora Core 3
Posts: 52

Original Poster
Rep: Reputation: 15
Thanks alot you have really helped me. I have even got the other computers on the network to see the site through a domain name buy stearing them to my dns server. Now all I have to do is go and buy a domain name. Once again thanks for all your help.
 
Old 07-12-2003, 08:49 PM   #12
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
You're welcome, glad I could help

Cool
 
Old 07-13-2003, 12:15 AM   #13
Big Brad
Member
 
Registered: Jul 2003
Location: Australia, Geelong
Distribution: Red Hat 8 & Fedora Core 3
Posts: 52

Original Poster
Rep: Reputation: 15
One more thing. For example if you had an ADSL connection with a fixed IP address and an IPCOP firewall then you would put the webserver in the DMZ right. But because of the nice firewall how does the requests for my web site get directed to my web server.
 
Old 07-13-2003, 12:53 AM   #14
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Is your IPCOP on your same box? You'll need to enable port forwarding, or if it's on the same box (while I'm not too familiar with IPCOP I'll cover what needs to be done) you'll need to ensure the port is simply open for connections (accept all).

In short, Port Forwarding. You'll need to read your IPCOP documentation (or post up a new thread about it if it's not clear and a search reveals too little) on how to do port forwarding.

Cool

**Edit, I found the page for you:
http://www.ipcop.org/1.3.0/en/admin/...es_portforward
**

Last edited by MasterC; 07-13-2003 at 12:54 AM.
 
Old 07-13-2003, 05:22 AM   #15
softgun
Member
 
Registered: Jun 2003
Posts: 119

Rep: Reputation: 15
Thanks MasterC

I am reading all about the conf file. Next week I will get Apache galloping off to the wide blue yonder....

Er...
If it's not even trotting i might be back
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Setting up apache deftones Linux - Newbie 8 03-19-2005 05:48 PM
Setting up Apache 2... bnscomp Mandriva 1 10-09-2003 02:24 PM
Setting up apache... another one mattbuechler Linux - Software 3 07-02-2003 11:58 AM
Setting up Apache amigatec Linux - Software 1 09-20-2002 06:43 AM
Setting up Apache nial Linux - General 1 04-25-2002 09:14 PM


All times are GMT -5. The time now is 03:18 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration