LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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
 
Search this Thread
Old 12-27-2005, 08:44 AM   #1
luca2
LQ Newbie
 
Registered: Dec 2005
Posts: 12

Rep: Reputation: 0
APACHE - Virtual Hosts


I must install Apache 2 on the distribution (Linux) Mandriva 2006.
The program is installed, now, I must to configure it.

I have edit the httpd.conf and I have decomment the relative line to virtual hosts (includes conf/extra/httpd-vhosts.conf) and then I have modified the following rows httpd-vhosts.conf in that way:


NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot /www/docs/
ServerName www.example.com
</VirtualHost>


I have created in the path usr/local/apache2/www/docs/ the file example.html, to make a tests.
At this point I have started the server with the command line apachectl start, but I receive the message:

httpd: Could not reliably determine the server' s Fully Qualified Domain Name, using 127.0.0.1 for ServerName httpd not running, trying to start not listening sockets available, shutting down Unable to open logs


but if launch apachectl status, seems that the server is ok, says to me also from how much time is active...

From the other PC connected in the LAN (through the router D-Link 504T) I have tried to connect me to the server www.example.com/www/docs/example.html, but I receive error 404, relative to the pages not found.

But in this page there is a indication of the Apache server and my distribution linux, so I think that the server works, or not?

Someone know if I must also configure anything else?

Can you give me the typical configuration for the virtual host?

Last edited by luca2; 12-27-2005 at 08:46 AM.
 
Old 12-27-2005, 09:23 AM   #2
routers
Member
 
Registered: Aug 2005
Location: Malaysia - KULMY / CNXTH
Distribution: Slackware, Fedora, FreeBSD, Sun O/S 5.10, CentOS
Posts: 773
Blog Entries: 6

Rep: Reputation: 75
Quote:
Can you give me the typical configuration for the virtual host?
NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>

<VirtualHost *>
ServerName rou.homelinux.net
ServerAdmin noc@rou.homelinux.net
DocumentRoot /export/site/noc/www
TransferLog /export/site/noc/logs/access-log
ScriptAlias /cgi-bin/ /export/site/noc/www/cgi-bin/
</VirtualHost>
 
Old 12-27-2005, 09:39 AM   #3
luca2
LQ Newbie
 
Registered: Dec 2005
Posts: 12

Original Poster
Rep: Reputation: 0
<VirtualHost *>
ServerName rou.homelinux.net
ServerAdmin noc@rou.homelinux.net
DocumentRoot /export/site/noc/www
TransferLog /export/site/noc/logs/access-log
ScriptAlias /cgi-bin/ /export/site/noc/www/cgi-bin/
</VirtualHost>[/QUOTE]


Thanks, but I've just used this configuration and doesn't work...

In my browser, I must digit http://rou.homelinux.net

Is this correct?
 
Old 12-27-2005, 08:32 PM   #4
routers
Member
 
Registered: Aug 2005
Location: Malaysia - KULMY / CNXTH
Distribution: Slackware, Fedora, FreeBSD, Sun O/S 5.10, CentOS
Posts: 773
Blog Entries: 6

Rep: Reputation: 75
Quote:
In my browser, I must digit http://rou.homelinux.net
sure becoz that is what content on the "ServerName"


btw if u use apache2 try close
#NameVirtualHost *:80

restart apache
 
  


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
vsftpd, web uploads, vsftpd virtual users, apache virtual hosts, home directories jerryasher Linux - Software 7 02-18-2007 07:29 AM
Apache Virtual Hosts dienerk Linux - General 15 10-16-2004 01:46 AM
apache virtual hosts smaida Linux - Software 3 06-20-2004 05:28 PM
Apache Virtual Hosts quozt Linux - General 3 10-15-2003 10:51 AM
Apache virtual hosts Mil0 Linux - Software 5 06-02-2003 12:58 AM


All times are GMT -5. The time now is 05:19 PM.

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