apache virtual host file
# File: /etc/apache2/sites-available/domain1.com.conf
<VirtualHost *:80>
# Server Name (domain name) and any aliases
ServerName domain1.com
ServerAlias www.domain1.com
#OPTIONAL Admin name
ServerAdmin [email protected]
# Index file and Document Root (where the public files are located)
DirectoryIndex index.html
DocumentRoot /home/demo/public_html/domain1.com/public
# Custom log file locations, OPTIONAL:
LogLevel warn
ErrorLog /var/log/apache2/error-mydomainname.com.log
CustomLog /var/log/apache2/access-mydomainname.com.log combined
</VirtualHost>
# Enabling:
# sh ~ $
sudo a2ensite domain1.com # Refer to above ServerName!
# The utility may automatically suggest, but run:
sudo /etc/init.d/apache2 reload
# To restart apache!
4.14
7
# File: /etc/apache2/sites-available/domain1.com.conf
<VirtualHost *:80>
# Server Name (domain name) and any aliases
ServerName domain1.com
ServerAlias www.domain1.com
#OPTIONAL Admin name
ServerAdmin [email protected]
# Index file and Document Root (where the public files are located)
DirectoryIndex index.html
DocumentRoot /home/demo/public_html/domain1.com/public
# Custom log file locations
LogLevel warn
ErrorLog /var/log/apache2/error-mydomainname.com.log
CustomLog /var/log/apache2/access-mydomainname.com.log combined
</VirtualHost>
# Enabling:
# sh ~ $
sudo a2ensite domain1.com # Refer to above ServerName!
# The utility may automatically suggest, but run:
sudo /etc/init.d/apache2 reload
# To restart apache!
Thank you!
7
0
4.38
8
//add these lines to /etc/apache2/apache2.conf
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Thank you!
8
0
Are there any code examples left?
New code examples in category Shell/Bash
-
Shell/Bash 2022-03-27 22:30:33 wise highlight ubuntu
-
Shell/Bash 2022-03-27 22:25:19 how to send a pull request in git
-
Shell/Bash 2022-03-27 21:55:06 how to open terminal in sublime text ubuntu
-
Shell/Bash 2022-03-27 21:25:19 how to switch branch
-
Shell/Bash 2022-03-27 21:20:25 python
-
Shell/Bash 2022-03-27 21:20:04 set user as admin gitlab
-
Shell/Bash 2022-03-27 21:10:09 apache2 mod_jk proxy to tomcat connector
-
Shell/Bash 2022-03-27 20:35:12 chown
-
Shell/Bash 2022-03-27 20:15:08 awk last match