# Creating a directory # $ Mkdir/var/www/phperstar # Creating a VM configuration file # $ Cd/etc/apache2/sites-enabled/ $ Vi websitename # Copy the content, paste it into the configuration file, save and exit # <VirtualHost *: 80> ServerAdmin webmaster @ localhost ServerName www.111cn.net # change it to the domain name you want to use # DocumentRoot/var/www/phperstar # directory for storing programs # <Directory/> Options FollowSymLinks AllowOverride None </Directory> <Directory/var/www/phperstar> # Directory for storing programs # Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow, deny Allow from all </Directory> ScriptAlias/cgi-bin // usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options + ExecCGI-MultiViews + SymLinksIfOwnerMatch Order allow, deny Allow from all </Directory> ErrorLog $ {APACHE_LOG_DIR}/www.111cn.net _ error. log # error log Directory # # Possible values include: debug, info, notice, warn, error, crit, # Alert, emerg. LogLevel warn CustomLog $ {APACHE_LOG_DIR}/www.111cn.net _ access. log combined # access log Directory # </VirtualHost> # Enable the configuration file # $ Cd/etc/apache2 $ Sudo a2ensite websitename Enabling site phperstar. To activate the new configuration, you need to run: Service apache2 reload # Restart apache # $ Sudo service apache2 reload Apache2: cocould not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName [OK] # Binding hosts # $ Vi/etc/hosts |