Debian Sarge (3.1) with Ruby on Rails and Apache 2 with FastCGI - Page 6

Want to support HowtoForge? Become a subscriber!
 
Submitted by tomw (Contact Author) (Forums) on Wed, 2006-05-10 12:25. ::

Install ISPConfig (it includes ClamAV and SpamAssassin

Note if the install source is not valid go to www.ispconfig.org and locate it.

cd /usr/local/src
wget http://umn.dl.sourceforge.net/sourceforge/ispconfig/ISPConfig-2.2.2.tar.gz
tar xvfz ISPConfig*.tar.gz
cd install_ispconfig
./setup

At the prompts:

Installation mode answer expert
Default directory /home/www answer n
Enter /var/www as the home directory for websites.

Fill in the certificate info.

When asked for a pass phrase choose n or otherwise you will be asked for it when you start ISPConfig which means it cannot be started without human interaction.

Afterwards the following information has to be provided:

Please enter your MySQL server: E.G. localhost
Please enter your MySQL user: E.G. root
Please enter your MySQL password: Your MySQL password
Please enter a name for the ISPConfig database: E.g. ispconfigdb
Please enter the IP address of the ISPConfig web: E.g. 192.168.0.1
Please enter the host name: E.g. www
Please enter the domain: E.g. xyz.de
Please select the protocol (http or https (SSL encryption)) to use to access the ISPConfig system:
If you want to use your control panel with SSL, select 1. You can then access it under https://www.xyz.de:81. If you want to access it under http://www.xyz.de:81, choose 2.

After you have answered the questions ISPConfig should be duly installed. If you indicated www as host and xyz.com as the domain during the installation, you will find the ISPConfig interface under https://www.xyz.de:81 or http://www.xyz.de:81. Here you can login first with the user name admin and password admin.


SpamAssassin

The ISPConfig comes with SpamAssassin, but without the Perl modules needed by SpamAssassin. Run the following command after the installation of the ISPConfig:

/home/admispconfig/ispconfig/tools/spamassassin/usr/bin/spamassassin

If no errors occur you can exit with ^c.

After you have logged into ISPConfig for the first time -- remember admin-admin. It is recommended to change the password immediately! This can be done under Tools -> Change password.

You might want to add phpmyadmin to ISPConfig go to Management -> UpdateManager -> Update and paste

http://www.ispconfig.org/downloads/phpmyadmin-2.6.4-pl3.pkg

into the url box, choose url and press update.


To create a Ruby on Rails hosting site.

Create a Hosting plan with

Options +ExecCGI +FollowSymLinks
AllowOverride all

in the Apache Directives box.

Create the New site using the Hosting plan.

In the rails application rename the public directory to web. (The following assumes that the directory created by the hosting plan is web1. Change the following accordingly if it is not.)

cd (rails application directory)
mv public web

Copy everything in the rails directory to the new directory created on your server for the website.

cp -R * /var/www/web1

Modify the .htaccess in the web directory by adding

SetEnv RAILS_ENV production
Order allow,deny
Allow from all

and removing any option directives.

Make sure the webserver can access all the files by changing the owner of the files to your web server.

cd /var/www/web1 (or whatever your website directory is.)
chown -R www-data:web1 *

It should work now!


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by heymrdj (registered user) on Sat, 2007-04-07 04:04.
ISPConfig's default directory is now /var/www, No need to use expert mode or change it.
Submitted by Anonymous (not registered) on Tue, 2006-06-27 04:36.

Submitted by Anonymous (not registered) on Tue, 2006-05-30 22:51.

Tim, just working through your how-to and found that I get an error on the following command:

root@vps:/etc/postfix/ssl# mv -f smtpd.key.unencrypted smtpd.key openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem -days 3650
mv: invalid option -- n
Try `mv --help' for more information.

Submitted by tom@ttucker.com (registered user) on Thu, 2006-06-08 16:24.

Thats because there was an error in the formatting. It should have been two lines thus:

mv -f smtpd.key.unencrypted smtpd.key

openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem -days 3650


Fixed it sorry.

Submitted by Anonymous (not registered) on Mon, 2006-05-15 19:27.

I find that many rails problems revolve around permissions and setting fcgi/cgi

Permissions:

chmod -R 755 public
chmod -R 755 log

# triple check your .htaccess file that .fcgi is selected
# replace this line
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
# with
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
# make sure you've used the ispconfig control panel to make a database for this site
# fill out the database name, username, and password in your database.yml
# ~/config/database.yml
#example configuration

development:
adapter: mysql
database: web1_db1
username: web1_u1
password: <yourpassword>
socket:

# make sure you set the path to ruby in files ~/public/dispatch.fcgi and dispatch.cgi
# use the command which ruby to identify the correct path
root@ubuntu:/# which ruby
/usr/local/bin/ruby
#if this is your path then the first line of your dispatch files would look like this

#!/usr/local/bin/ruby/