vistual host na linuxie

1) skopiowanie domyslango pliku

sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/laravel_czat.conf

2) W pliku dodać

<VirtualHost *:80>
    ServerAdmin webmaster@myapp.com
    ServerName czat.com
    DocumentRoot /var/www/html/laravel_vue_chat/public/

    <Directory /var/www/html/laravel_vue_chat/public/>
        Options -Indexes +FollowSymLinks +MultiViews
        AllowOverride All
        Require all granted
        <FilesMatch \.php$>
            # Change this "proxy:unix:/path/to/fpm.socket"
            # if using a Unix socket
            #SetHandler "proxy:fcgi://127.0.0.1:9000"
        </FilesMatch>
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/myapp.com-error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn
    CustomLog ${APACHE_LOG_DIR}/myapp.com-access.log combined
</VirtualHost>

3) W pliku :

etc/hosts

dodać czat.com

127.0.0.1	localhost
127.0.1.1	mord-Inspiron-7520


# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

127.0.0.1 czat.com

4)Odpalić komendy

sudo a2ensite laravel_czat
sudo systemctl reload apache2

 

Komentarze wyłączone