InstallingSymfonyInASubDirectoryWithCentOSandPlesk (diff)

You must first sign up to be able to contribute.

Changes from Version 1 of InstallingSymfonyInASubDirectoryWithCentOSandPlesk

wowca (IP:
11/27/10 00:12:27 (7 years ago)



  • InstallingSymfonyInASubDirectoryWithCentOSandPlesk

    v0 v1  
     1Hello everyone! 
     3The evergrowing community of the Symfony framework was a great help to me when starting with Symfony, so I decided to give something back, with this step-by-step introductory tutorial about installing Symfony 1.4 on a subdomain with CentOS 5.5 and Plesk 10 on a dedicated server. I assume you have the server configured to run Symfony. Whatever you do, you do it on your own, so I'm not the one to blame if anything goes wrong! 
     5I'll start my blog entry with the topic I opened on the Symfony forum (which, sadly, didn't receive any replies). 
     6You can find the original post on the forum. 
     8So, here it is: 
     11Hello everybody! 
     13I finally decided to start working with a framework and after some thinking I decided to go with Symfony, but I'm having a hard time setting it up. 
     15I have root access to a dedicated server running a fresh install of CentOS 5.5 with Parallels Plesk 10 admin panel. 
     17I set up a sub domain on let's say: 
     19Now my config: 
     21    * /home/ is empty except for two automatically generated folders 
     22    * the path to home directory is /var/www/vhosts/ with subdomain under /dev so the full path to the subdomain is: /var/www/vhosts/ 
     23    * the vhost.conf file is under the / 
     25Code inside the vhost.conf file: 
     28DocumentRoot /var/www/vhosts/ 
     29DirectoryIndex index.php 
     30Alias /sf /home/dev/lib/vendor/symfony/data/web/sf 
     33<Directory /var/www/vhosts/mydomain/dev/web> 
     34php_admin_value open_basedir none 
     35AllowOverride All 
     39<Directory /home/dev/lib/vendor/symfony/data/web/sf> 
     40AllowOverride All 
     41Allow from All 
     45So let's say that I create a folder [b]dev/lib/vendor[/b] under [b]/home/[/b] and I extract Symfony inside, I have the path to the generator: [b]/home/dev/lib/vendor/symfony/data/bin[/b] 
     47Then I go to [b]/var/www/vhosts/[/b] and run: 
     49php /home/dev/lib/vendor/symfony/data/bin/symfony generate:project testproj 
     51php symfony generate:app frontend 
     53chmod 777 cache/ log/ 
     55I get the whole structure inside the [b]/var/www/vhosts/[/b]. 
     57Then I run the [b]/usr/local/psa/admin/bin/httpdmng --reconfigure-domain [/b] command and restart the httpd server. 
     59After I do this this, if I point my browser to I get the default Apache page and if I point it to all I get is a blank page. 
     61Any ideas what is going on, since I'm getting the Wall McBashing's syndrome.  :D 
     63Thanks for all the answers! 
     65P.S.: After solving this problem, I'll create a guide and try to contribute to the community. :) 
     68And here is the guide! :D 
     70Since you're running a dedicated server I assume you have root access, so everything I'll be doing here is while being logged in as "root". 
     72   1. Create a subdomain in plesk 
     73   2. Locate the directory of your subdomain (in my case, which I'll be using is: /var/www/vhosts/ 
     74   3. cd to your subdomain (eg. cd /var/www/vhosts/ 
     75   4. Create 2 subdirs using mkdir -p lib/vendor 
     76   5. cd to the subdir (cd lib/vendor) 
     77   6. use wget to get the latest Symfony version from the Symfony homepage (eg. wget ) 
     78   7. use tar -zxvf symfony-1.4.8.tgz and then mv symfony-1.4.8 symfony 
     79   8. remove the symfony-1.4.8.tgz file using rm symfony-1.4.8.tgz 
     80   9. cd ../.. 
     81  10. Use the php lib/vendor/symfony/data/bin/symfony generate:project demo 
     82      command to generate a new Symfony project (demo is not an actual command, it's just the name of the project so use the name of your project) 
     83  11. Use the php symfony generate:app frontend command to generate the frontend app 
     84  12. chmod 777 cache/ log/ 
     86And here comes vhosts.conf part that I didn't understand and why the whole thing didn't work. :) 
     88Plesk actually generates TWO conf/ directories, one in /var/www/vhosts/ and one in /var/www/vhosts/ . When creating and publishing a web page you use the / directory, but Plesk uses the / directory for all the vhosts configuration, so you have to put the vhosts.conf under that directory. 
     90This is the vhosts.conf source that I'm using and it works: 
     93DocumentRoot "/var/www/vhosts/" 
     94DirectoryIndex index.php 
     98<Directory "/var/www/vhosts/"> 
     99AllowOverride All 
     100Allow from All 
     104Alias /sf "/var/www/vhosts/" 
     107<Directory "/var/www/vhosts/"> 
     108AllowOverride All 
     109Allow from All 
     113Now you have to follow these steps: 
     115   1. cd to / 
     116   2. vi vhost.conf 
     117   3. Paste the code I provided and change the path so it matches your domain and subdomain 
     118   4. Save and quit ( :wq ) 
     119   5. Run /usr/local/psa/admin/sbin/httpdmng --reconfigure-domain 
     120   6. VOILA! You're ready to embark on a framework dev journey! :) 
     122Credits go also to ignitedcoding (email: ignitedcoding [at] and the whole #symfony channel on the IRC Freenode server.