Created
June 30, 2019 14:56
-
-
Save yaleksandr89/0f3c46697d0fc098290367e61bd8910a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setup | |
/etc/apache2/sites-available - before creat file conf site. | |
/etc/apache2/sites-enabled - become сopy created file here (exists special command `sudo a2ensite {NAME_CONFIG_FILE}`). | |
## First | |
``` | |
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/{NAME_SITE}.conf | |
example: | |
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/site1.local.conf | |
``` | |
the approximate contents of the file: | |
``` | |
<VirtualHost *:80> | |
ServerName site1.local !{NAME_SITE, at creation DEL} | |
ServerAdmin webmaster@localhost | |
DocumentRoot /var/www/html/site1.local/ !{PATH_SITE_FOLDER, at creation DEL} | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
CustomLog ${APACHE_LOG_DIR}/access.log combined | |
</VirtualHost> | |
``` | |
## Second | |
``` | |
sudo a2ensite site1.local | |
``` | |
This command move created file in folder /etc/apache2/sites-enabled. The file name is written without '.conf' | |
## Last | |
Reload apach | |
``` | |
sudo systemctr restart apache2 | |
``` | |
Check in browers. Written site1.local/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment