Installing VirtualHosts in Apache2 Using Ubuntu
Assuming Apache2 is already installed.
Go to the sites-available directory:
cd /etc/apache2/sites-available
Copy the default, and name it to a new one:
sudo cp default <strong>beyondeternal.com</strong>
Edit that new file you created with it’s Vhost stuff:
gksudo gedit beyondeternal.com
Sample Vhost setting:
<VirtualHost *:80>
ServerAdmin webmaster@example.com
ServerName euri.beyondeternal.com
ServerAlias euri.beyondeternal.com
# Indexes + Directory Root.
DirectoryIndex directory_dev.php
DocumentRoot /home/euri/projects/beyondeternal.com/web/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/euri/projects/beyondeternal.com/web/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
# sf directory
Alias /sf/ /home/euri/projects/beyondeternal.com/lib/vendor/symfony/data/web/sf/
# Logfiles
ErrorLog /home/euri/projects/beyondeternal.com/log/error.log
CustomLog /home/euri/projects/beyondeternal.com/log/access.log combined
</VirtualHost>
Link the sites-available to the sites-enabled:
sudo a2ensite beyondeternal.com
Note: Do not forget to make your directory /home/euri/projects/beyondeternal.com/ writable. :)
apache2.conf location:
gksudo gedit /etc/apache2/apache2.conf
Advertisement
