Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
02-06-2005, 06:26 AM
|
#1
|
Member
Registered: Dec 2004
Location: Latvia
Distribution: slackware
Posts: 77
Rep:
|
vhost in apache
Hello.
First i will explain the structure of my small home lan. So i have router which is also a firewall and a real ip asigned to it for ext eth0 + internal eth1 and 192.168.1.1 ip asigned to it. Now i have domain register to my external ip - domain.com. But now the problem is that i run apache server on one of machines on my internal lan with ip 192.168.1.10. I have configured iptables script on my router so everything works fine, i can browse ''mydomain.com'' from my internal newtwork and people from internet can do. But i want to run virtual hosts for example "harmonyofsoul.mydomain.com" (this subdomain is registered also to my external addresse) on the same apache and on the same interface with ip 192.168.1.10. When i do this in the right section of my httpd.conf, and restarted the server i still get what i have in my /var/www/htdocs
This is what i write in my httpd.con:
NameVirtualHost 192.168.1.10:80
<VirtualHost 192.168.1.10:80>
DocumentRoot /var/www/harmonyofsoul
ServerName harmonyofsoul.mydomain.com
</VirtualHost>
Still no result am getting what i have in my /var/www/htdocs
How can i fix this problem?
|
|
|
02-06-2005, 08:26 PM
|
#2
|
Member
Registered: Jun 2003
Location: Virginia, USA
Distribution: Slackware
Posts: 252
Rep:
|
I don't know, this looks like it should work unless someone is adding WWW to the name, in which case Apache will not know what to do unless you use the ServerAlias in httpd.conf.
Just a thought.
|
|
|
02-07-2005, 02:29 PM
|
#3
|
Senior Member
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794
Rep:
|
Which distribution do you have? You may need to add this to your vhost configuration if you're getting an "access forbidden" error:
<Directory "/">
AllowOverride All
order deny,allow
</Directory>
and you may need to add this (listen.conf if you're running Suse, some distributions have it right in httpd.conf) if httpd is simply not responding:
Listen 192.168.1.10:80
|
|
|
02-07-2005, 06:41 PM
|
#4
|
Member
Registered: Dec 2001
Location: ./
Distribution: Fedora, CentOS, RHEL, Gentoo
Posts: 167
Rep:
|
This is what I have for a dedicated web server (RHL 9 && modified to your info):
Code:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "/var/www/harmonyofsoul"
ServerName harmonyofsoul.mydomain.com
<Directory "/var/www/harmonyofsoul/">
DirectoryIndex index.cgi index.php index.shtml index.html index.htm index.html.var
Options MultiViews +Includes
Allow from all
</Directory>
ErrorLog /var/log/httpd/error.log
CustomLog /var/log/httpd/logs/access.log combined
</VirtualHost>
and:
Listen 80
This binds to all available IP addresses (let DNS handle the rest - if you need that)
HTH
This
Last edited by this213; 02-07-2005 at 06:55 PM.
|
|
|
All times are GMT -5. The time now is 11:15 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|