Home > Apache, Symfony, Ubuntu > Installing VirtualHosts in Apache2 Using Ubuntu

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
Categories: Apache, Symfony, Ubuntu
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.