LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   APACHE - Virtual Hosts (https://www.linuxquestions.org/questions/linux-networking-3/apache-virtual-hosts-396839/)

luca2 12-27-2005 07:44 AM

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?

routers 12-27-2005 08:23 AM

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>

luca2 12-27-2005 08:39 AM

<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... :rolleyes:

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

Is this correct?

routers 12-27-2005 07:32 PM

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


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