Hi! Can you help me with configure apache with it, then: I have debian (without GUI) server with service: apache2. I must make 2 websites. First (intex.html) should was avalible on link http:// name1.local/ secound website (for example website2/secound.html) should was avalible on link http:// name2.local/ How I can make it? I trying make it with virtual hosts, but i searched info and i dont know what exactly i must do. In /etc/hosts i have line: 192.168.230.123 name1.local, ok its work for first website, but how i must make to enable same secound website? Thanks for any help
You add another line with the same IP and the name "name2.local" and then you configure your virtualhosts-file to reflect the two different installs / sites.
I have this in my httpd-vhosts.conf: <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot "/var/www" ServerName name1.local ServerAlias name1.local ErrorLog "/var/log/apache2/name1.local-error_log" CustomLog "/var/log/apache2/name1.local" common </VirtualHost> <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot "/var/www/www2" ServerName name2.local ErrorLog "/var/log/apache2/name2.local-error_log" CustomLog "/var/log/apache2/name2.local-access_log" common </VirtualHost> Code (markup): In /etc/hosts: 127.0.0.1 name1.local 127.0.0.1 name2.local but it's not worked. How i must make more to enable it?
I solve it. Thanks for help. I set default site on : a2ensite name.local And in this file i set virtual host settings. thanks!