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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
11-12-2007, 09:36 PM
|
#1
|
|
LQ Newbie
Registered: Nov 2007
Posts: 7
Rep:
|
Apache2 Host Issue
Hi all. I have a weird issue here.. I'm trying to make my apache respond only to a certain domain name, rather than any name that will resolve to my ip... I have about 4 domain names that point to my ip, but I only want this server to respond to only one domain. Whenever I try to use
Code:
NameVirtualHost *
<VirtualHost *>
ServerName foo.bar
It doesn't care and responds to any domain it can.
Code:
NameVirtualHost foo.bar
<VirtualHost foo.bar>
ServerName foo.bar
Makes the server blow up and give 404 errors to anything. In the error log I only get
Quote:
|
File does not exist: /htdocs
|
Anybody have any ideas?
|
|
|
|
11-13-2007, 04:46 AM
|
#2
|
|
Senior Member
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,276
Rep:
|
File does not exist: /htdocs
this indicates that the virtual server does not have a DocumentRoot so it looks for files in /htdocs
|
|
|
|
11-13-2007, 05:11 AM
|
#3
|
|
LQ Newbie
Registered: Nov 2007
Posts: 7
Original Poster
Rep:
|
Ah sorry.. I should've given more of the config.. Here's the whole file. I basically just took the default file...
Code:
NameVirtualHost *
<VirtualHost *>
ServerName foo.bar
ServerAdmin support@foo.bar
DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
Everything is pretty much default. I don't think I changed anything really...
|
|
|
|
11-13-2007, 05:24 AM
|
#4
|
|
Senior Member
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,276
Rep:
|
DocumentRoot "/var/www"
the quotes maybe...then restart server
<Directory "/var/www">
Last edited by j-ray; 11-13-2007 at 05:27 AM.
|
|
|
|
11-13-2007, 05:39 AM
|
#5
|
|
LQ Newbie
Registered: Nov 2007
Posts: 7
Original Poster
Rep:
|
Same effect.. Strange that this is happening. Is there a way to get more info from the error logs? It still is looking for /htdocs and when I
Code:
/etc/apache2#> grep -r "htdocs"* *
Nothing comes up. Very bizarre.
|
|
|
|
11-13-2007, 09:02 AM
|
#6
|
|
LQ Newbie
Registered: Nov 2007
Posts: 7
Original Poster
Rep:
|
Anybody else have an idea I should try? For the record I'm runnig this on Debian Etch.
|
|
|
|
11-13-2007, 09:16 AM
|
#7
|
|
Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,359
|
Quote:
Originally Posted by mbazdell
Same effect.. Strange that this is happening. Is there a way to get more info from the error logs? It still is looking for /htdocs and when I
Code:
/etc/apache2#> grep -r "htdocs"* *
Nothing comes up. Very bizarre.
|
Perhaps you use a different conf file containing different ServerRoot. Run to see what you get.
Last edited by bathory; 11-13-2007 at 09:29 AM.
|
|
|
|
11-13-2007, 04:50 PM
|
#8
|
|
LQ Newbie
Registered: Nov 2007
Posts: 7
Original Poster
Rep:
|
Code:
root 21822 1 0 Nov12 ? 00:00:00 /root/ispconfig/httpd/bin/ispconfig_httpd -DSSL
1001 21834 21822 0 Nov12 ? 00:00:00 /root/ispconfig/httpd/bin/ispconfig_httpd -DSSL
root 21970 21969 0 Nov12 ? 00:00:00 /root/ispconfig/cronolog --symlink=/var/log/httpd/ispconfig_access_log /var/log/httpd/ispconfig_access_log_%Y_%m_%d
1001 22139 21822 0 Nov12 ? 00:00:00 /root/ispconfig/httpd/bin/ispconfig_httpd -DSSL
root 25575 893 0 17:48 pts/1 00:00:00 grep http
Mind you the Apache I'm running is in a chroot. I have 3 http servers running. But only one in the chroot.
|
|
|
|
11-13-2007, 06:02 PM
|
#9
|
|
LQ Newbie
Registered: Nov 2007
Posts: 7
Original Poster
Rep:
|
Just for more clarification, here is my setup.
One system:
Apache
ISPConfig (which has apache)
Mysql
etc...
Chroot system:
Apache
PostgreSQL
The reason why I've chroot'd an apache install is because I didn't want PSQL and MySQL to know about eachother... I wasn't sure if I could access the chroot'd PSQL server with the unchroot'd Apache...
|
|
|
|
11-14-2007, 02:18 AM
|
#10
|
|
Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,359
|
I guess that the 2 servers are listening on different ports, or different IPs. Anyway if you're running apache chrooted, then the config files are under /chroot-dir/etc/apache2, so you should check there to find what the DocumentRoot is.
Regards
|
|
|
|
11-14-2007, 04:53 AM
|
#11
|
|
LQ Newbie
Registered: Nov 2007
Posts: 7
Original Poster
Rep:
|
Yeah that's what I'm editing. They're all running on different ports.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 08:06 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
|
|