@
@
@Twitt2019-09-21 22:35:04
Apache HTTP Server
@Twitt, 2019-09-21 22:35:04

Apache on two hosts, how to set up?

you need one site to respond to localhost, and the other, for example, to test.dev.
In the hosts file, I already made a separate host, the question remains how to configure /etc/apache2/httpd.conf.
If anyone can advise, I'll be grateful

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Talyan, 2019-09-21
_

in vhosts.conf on Windows and /etc/apache2/sites-enabled/yoursite.conf on penguins
there is a ServerName directive
Set the second host with the ServerAlias ​​directive

<VirtualHost *:80>
        ServerName hotspot.lan
        ServerAlias host2.com
        ServerAdmin [email protected]
        ErrorLog /var/www/hotspot/error.log
        DocumentRoot /var/www/hotspot


        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        
</VirtualHost>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question