LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 07-30-2006, 03:26 PM   #1
mclinkor
Member
 
Registered: Nov 2005
Posts: 63

Rep: Reputation: 15
Seting up server Apache Gentoo


I am attempting to set up a server in gentoo with apache (I previously had it working on a windows machine, but am migrating it to a linux machine in attempt to save headache). I have followed the setup instructions on the gentoo wiki to set up apache for virtual hosts. I put a website on this host (mclinkor.mit.edu (18.248.3.123)), and can view it from the local machine, but I cannot view it from other machines. I have not assigned DNS servers, but I'm not sure if that matters (since I can access the internet on the server machine), but I when I was given my static ip, they gave me DNS servers, so maybe this is important. Is there anything else I have to do security-wise to open up gentoo to allow other computers to access apache? Thanks.

- Ryan
 
Old 07-30-2006, 04:31 PM   #2
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 47
By default, the server root is in /var/www/localhost/htdocs
vhost definitions will also be in /etc/apache2/vhosts.d and are read in numeric order.

ADDED: I suppose I should ask which version of apache you have installed..

Last edited by peter_robb; 07-30-2006 at 04:53 PM.
 
Old 07-30-2006, 05:22 PM   #3
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 47
The server accesses ok on the ip number, so the default server is working ok.

What have you used to define the url host?
 
Old 07-30-2006, 07:06 PM   #4
mclinkor
Member
 
Registered: Nov 2005
Posts: 63

Original Poster
Rep: Reputation: 15
Apache version 2.0.54

Here's my vhost file

NameVirtualHost *:80

<VirtualHost *:80>
ServerName mclinkor.mit.edu
DocumentRoot "/hosted_sites/mclinkor"
</VirtualHost>

[and the appropriate ones for 127.0.0.1]

What do you mean by what I have used to define the url host?

Thanks.
 
Old 07-30-2006, 07:49 PM   #5
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 47
That's the default host.. *:80

You need a host with the url name you want to access the vhost with, eg www.some.thing.com
eg,

/etc/apache2/vhost.d/00_default_vhost.conf reads as above

/etc/apache2/vhost.d/10_www.mclinkor.mit.edu.conf reads;
<VirtualHost *:80>
ServerName www.mclinkor.mit.edu
DocumentRoot hosted_sites/mclinkor
</VirtualHost>

Last edited by peter_robb; 07-30-2006 at 07:56 PM.
 
Old 07-30-2006, 11:03 PM   #6
mclinkor
Member
 
Registered: Nov 2005
Posts: 63

Original Poster
Rep: Reputation: 15
OK, I made those changes, but it still doesn't work.

This has solved the problem of it not saying "NameVirtualHost *:80 has no VirtualHosts"

Note that my address is http://mclinkor.mit.edu, not www.mclinkor.mit.edu
 
Old 07-31-2006, 06:11 AM   #7
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 47
Ok so you will need to have..

in /etc/apache2/vhost.d/10_mclinkor.mit.edu.conf
<VirtualHost *:80>
ServerName mclinkor.mit.edu
DocumentRoot hosted_sites/mclinkor
</VirtualHost>
 
Old 07-31-2006, 07:35 AM   #8
mclinkor
Member
 
Registered: Nov 2005
Posts: 63

Original Poster
Rep: Reputation: 15
Yeah, that's what I ended up doing.

Unfortunately, still no dice.

Are there any other security permissions that gentoo generally sets up? Like, a does a basic stage3 install include any kind of firewall or anything that I need to configure?
 
Old 08-06-2006, 01:29 PM   #9
mclinkor
Member
 
Registered: Nov 2005
Posts: 63

Original Poster
Rep: Reputation: 15
So I eventually got this working (since I was stupid and forgot to restart net.eth0 after making some changes there and fixing the above errors.

Now I have a new problem.

I have two static ip addresses that I have configured in net file. I have these connected to hostnames. The old ip address works fine (and links to the three virtual hosts perfectly).

I have another static ip, however which links to another virtual host, which I can only see on the local computer (which seems like the problem I was having before, but the fixes don't work for it).

Basically, to go from one static ip to two, I changed things like *:80 to 18.248.3.137:80.

Is there something else I am missing regarding setting up multiple ip addresses (or maybe I forgot to do something that I did to set-up my original ip, but I've looked back over what I did for that and it hasn't helped).

Thanks.
 
Old 08-07-2006, 05:17 AM   #10
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 47
Have a look at http://www.tldp.org/HOWTO/Adv-Routing-HOWTO/
Especially the section about split routing and multiple gateways.
 
Old 08-08-2006, 01:02 AM   #11
mclinkor
Member
 
Registered: Nov 2005
Posts: 63

Original Poster
Rep: Reputation: 15
OK, I fixed the problem.

I used the first method, rather than the second, to set up my ip addresses as described here:

http://gentoo-wiki.com/HOWTO_IP_Aliasing
 
  


Reply

Tags
apache, gentoo, ip, multiple, virtualhost


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
seting up linux server joshuahenry Linux - Networking 1 07-21-2006 02:21 AM
seting up a name server spank Linux - Newbie 1 12-15-2003 03:38 PM
Seting up a ftp server digital bots Slackware 3 09-08-2003 04:55 AM
Gentoo as gateway, qmail, apache, vsftpd & samba server? jownas Linux - Networking 2 04-21-2003 03:54 AM
seting loopback server herambshembekar Linux - Networking 0 02-26-2002 10:56 AM


All times are GMT -5. The time now is 03:58 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration