Categories
symfony

Installation Symfony on GoDaddy Virtual Dedicated Server

This information could be interesting for GoDaddy accounts owners. The friend of mine has done this investigation and I’m happy to put it here.

So, first we need to install Symfony itself.
We have to do it with root access.
To get the root access do тАЬsu -тАЭ command without quotes and enter root password.

The sequence of sommands:

1. # pear upgrade PEAR.
I needed it because I had old pear library installed on my VDS.

2. # pear channel-discover pear.symfony-project.com
This command adds Symfony channel to pear

3. # pear install symfony/symfony
It will take some time for downloading Symfony code, unpacking it and install

ThatтАЩs all with Symfony installation. You can check the Symfony version by typing command from shell:
# symfony -V

The second stage is setting up our VDS for using Symfony correctly.

In general all setting will be applied to the Apache configuration file.

As you already know in the Virtual Dedicated Server (VDS) we have the following files structure in our user home:

-bash-3.00$ ls -la
.bash_history
.mc
.mysql_history
.ssh
.viminfo
anon_ftp
bin
cgi-bin
chart_error.log
conf
error_docs
httpdocs
httpsdocs
pd
private
statistics
subdomains
web_users

WeтАЩll be only interested in conf, httpdocs directories.

Go to the httpdocs folder and initialize there Symfony project (from your domain user, not from the root)

> symfony new projectname
> symfony app application_name

This will create necessary files and folders.

We have DocumentRoot in the httpdocs directory by default. But if we initialize new Symfony application there weтАЩll need new document root in the httpdocs/web folder, isnтАЩt it?

So we need to change it in the Apache configuration.

I hope you didnтАЩt logoff from the root account, if so please log in again

After that go to the conf directory in your home. Make ls -la command and youтАЩll see there two files:

httpd.include
webalizer.conf

We need httpd.include file – this is Apache configuration for your current domain name youтАЩre logged in.

Open it with your VI editor and youтАЩll see the Virtual host settings.

You have to add the following line in the Virtual Host area:

1. Alias /sf /usr/share/pear/data/symfony/web/sf
where тАЬ/usr/share/pear/data/symfony/web/sfтАЭ is path to your symfony resources in the pear.
I think this setting is similar to all GoDaddy VDS users.

2. Find DocumentRoot setting and add тАШwebтАЩ directory to its end.
Like this: DocumentRoot /var/www/vhosts/domain.com/httpdocs/web

3. And the final, the most interesting part
Find php_admin_value open_basedir (two times)

php_admin_value open_basedir тАЬ/var/www/vhosts/domain.com/httpdocs:/tmpтАЭ

and add there another one path, like this:
php_admin_value open_basedir тАЬ/var/www/vhosts/domain.com/httpdocs:/tmp:/usr/share/pear/тАЭ

After all changes above are made you have to restart Apache web server to seting take effect.

# apachectl restart

ThatтАЩs all.

You have found any issues regarding installation Symfony on GoDaddy VDS feel free to post a comment here and IтАЩll help you to solve it.

One reply on “Installation Symfony on GoDaddy Virtual Dedicated Server”

Hey narkov,

We recently set up Symfony on a GoDaddy VS for web application development too. One thing you might want to consider is that your Symfony project directory should not be in your public html directory.

Editing the httpd.conf is kind of a pain, so I used the simple method of setting up the project directory in home/projects/. Then I symlinked web/sf to the PEAR Symfony dir, and symlinked the public html directory/ to /home/projects//web.

I’d be interested to hear how others have configured similar WHM/CPanel VDS boxes.

Leave a Reply

Your email address will not be published. Required fields are marked *