Configure the VM in Ubuntu: 1. Run the root user command to enter the/etc/apache2/sites-available/directory. 2. Create a VM configuration file named after the domain name, such as Androidj.com
Configure the VM in Ubuntu:
1. Use the root user command line to enter the/etc/apache2/sites-available/directory.
2. Create a VM configuration file and create a file named after the domain name, such as Androidj.com. You need to create the file androidj,
Namevirtualhost*: 9011
ServerAdmin master@test.com # email address
ServerName www.androidj.com # Domain Name
DocumentRoot/var/www/androidj # virtual host directory
Options Indexes FollowSymLinks MultiViews
AllowOverride None#If you configureUrlRewrite the lineAllowOverride All
Order allow, deny
Allow from all
ErrorLog/var/log/apache2/www_test_com_error.log
LogLevel warn
CustomLog/var/log/apache2/www_test_com_access.log combined
ServerSignature On
3. Run the/etc/apache2/directory command.
Vi posts. conf
Add two lines of text and configure the corresponding listening port.
Namevirtualhost*: 9001
Listen 9001.
4. Run a2ensite androidj in/etc/apache2.
This command establishes a soft connection to wwwtest under the/etc/apache2/sites-enabled directory.
Run/etc/init. d/apache2reload to re-load the configuration file.
If no error is reported, the configuration is successful.
The following describes how to configure an apache Virtual Host in windows:
Remove the # Before Include
# Virtual hostsInclude conf/extra/httpd-vhosts.conf
Save the modified httpd. conf file.