Passenger dedicated server


#1

Hi,
I am trying to install/configure Passenger on a dedicated centos
server. I have installed passenger successfully, but i am having to
much troubles trying to configure it with my dedicated server, I have
read/saw your screencasts, documentation, buyed peepcode.com
screencasts about this issue etc, but still can not get the thing
working, hope you give me some help.
After passenger installation i pasted all the lines into my
httpd.conf
file as the installation indicates, but well i have some problems
here:
First of all, my dedicated server uses cpanel, this means that i can
not just open directly the http.donf file to make changes because
cPanel rebuilds the file on every update or account creation by
compiling from its userdata files. So any VirtualHost created will be
lost(in fcat any change that i have made will be lost). To create a
custom VirtualHost, in my case i need to create a new domain account
from my WebHostManager and then edit the cPanel files for this
account
located in /var/cpanel/userdata/username folder, not just, copy-paste
the lines that passenger installation gaves to me, at this point i
dont know how to configure this virtualhost thing??? besides this,
the screencast of phusion site, tells that i have to configure de
etc/
hosts file but in my case i am not configuring a local passenger
install, so the /ect/hosts could not be configured equal as the
screencast does…or yes?
So where/how i have to paste/configure my passenger installation in
order to work with a dedicated server??? i have tryed a lot of
variations, none of them works, even i have talked with some irc, and
they told me that i have just to follow the passenger installation
instructions(it means copy-pasted the lines in http.conf) but this
this is not working, am i doing something wrong, any idea/advice?
Regards,
Shirkavand


#2

On Wed, Oct 8, 2008 at 6:28 PM, fRAnKEnSTEin removed_email_address@domain.invalid
wrote:

I am trying to install/configure Passenger on a dedicated centos
server. I have installed passenger successfully, but i am having to
much troubles trying to configure it with my dedicated server

First of all, my dedicated server uses cpanel, this means that i can
not just open directly the http.donf file to make changes because
cPanel rebuilds the file on every update or account creation by
compiling from its userdata files.

If it’s a “dedicated server”, you should be able to configure it any
way you want – so why don’t you turn off this “cpanel” thing, which
sounds like total crap, and edit your conf files as needed?

I just installed passenger/mod_rails on a system yesterday for the
first time, and it took about 5 minutes. It sounds like your problem
is with cpanel, not passenger.

Just sayin’ … :slight_smile:


Hassan S. ------------------------ removed_email_address@domain.invalid


#3

On Wed, Oct 8, 2008 at 9:20 PM, fRAnKEnSTEin removed_email_address@domain.invalid
wrote:

This system that you have installed passenger, was a dedicated server?

Maybe you should define /exactly/ what you mean by “dedicated server”.
I was installing on my OS X system – just another *nix box. A server is
a
server is a server. Because you installed server software on it :slight_smile:

Maybe you should do a test install on another system where you aren’t
wrestling with “cpanel” to validate the basic process.

if yes, dou you just follow the passenger installation
instructions(i.e copy-paste the lines into http.conf), and just with
that it works properly for you?

Yep.

the name of the virtualhost
must be the same as the domain name that i buyed?

Well, yeah, that’s basic name-based virtual hosting :slight_smile:

HTH,

H*

Hassan S. ------------------------ removed_email_address@domain.invalid


#4

Hi,

I just installed passenger/mod_rails on a system yesterday for the
first time, and it took about 5 minutes. It sounds like your problem
is with cpanel, not passenger.

This system that you have installed passenger, was a dedicated server?
if yes, dou you just follow the passenger installation
instructions(i.e copy-paste the lines into http.conf), and just with
that it works properly for you? did not configure any etc/hosts file
or anything else? how do you access the rails app, something like
http://www.mydomain.com” where “www.mydomain.com” is the name of the
virtual host you put in in the htp.conf? the name of the virtualhost
must be the same as the domain name that i buyed?

Regards,

Mohammed


#5

What company did you get your dedicated server from? Most dedicated
servers has the ability to be installed without a control panel and
most of the time it is easier to do custom installs like pasanger/
mongrel or other without a control panel like cpanel. cpanel is a
great tool if all you want is a few static pages (that is MY take
btw.)

When you got your domain you set that up in DNS to point to your
dedicated servers ip.

www.your-domain.com -> A record -> 1.1.1.1 (dedicated server ip)

Then you have to configure Apache to listen for www.your-domain.com if
you have virtualhosts setup. (If you only have one that will be the
default host and should work anywho… )

You should be able to see entries in the apache logs if you hit the ip
address.

Btw did you install wget on the server (yum install wget) and/or links
(yum install links) this will let you “test” from the local server to
see if everything is working fine there before testing outside…

AND THE BIG QUESTION! IS THE CPANEL FIREWALL OPEN???


#6

Hi,

Maybe you should define /exactly/ what you mean by “dedicated server”

Well i mean that i have full root access to all accounts on the
server. And that i can install, delete, update etc in any way i want
to. Only my apps are installed and running , i have all the power over
the server, this is what i mean with “dedicated server”

I was installing on my OS X system – just another *nix box. A server is a
server is a server. Because you installed server software on it :slight_smile:

I already installed passenger on my MAC, and it works, but that is
obius, because my MAC:

1- Is a local eviroment, that means that all the installations are
donde like root, and more important with a very low security
configuration(my mac is a testing eviroment not a production one)

2- As a local machine, is a testing eviroment, so it does not have any
high securiity, firewalls, special users and all that stuff that a
real production server has and that usually make things harder to
install and configure, for a simple example i connect in my local
machine to mysql using user root with no password, but in a real
producction eviroment this can not be done, so i have not to deal with
this stuff when installing something in my *nix local machine :),
thats why passenger was easy to install :slight_smile:

Maybe you should do a test install on another system where you aren’t 
wrestling with “cpanel” to validate the basic process.

the cpanel stuff was just an example, i am not sure if it is the
cpanel who causes the problem, i was just giving an example that in a
production eviroment exists a lot of “extra” thing that are
configurated different and that may cause tha passenger install not so
easy to do, maybe cpanel, maybe some chmod problems, maybe some lost
symbolic links problems etc

What company did you get your dedicated server from

www.jaguarpc.com

Most dedicated
servers has the ability to be installed without a control panel and
most of the time it is easier to do custom installs like pasanger/
mongrel or other without a control panel like cpanel

of course, as i said before i have installed passenger already, the
problem i got is that i can not configure it properly using just the
instructions that passenger installing process gives

did you install wget on the server (yum install wget) and/or links 
(yum install links) this will let you “test” from the local server to 
see if everything is working fine there before testing outside

i have installed many software using yum, and wget was already
installed when i buyed the dedicaded server, and both work just fine

AND THE BIG QUESTION! IS THE CPANEL FIREWALL OPEN???

I am not sure, but is this important for passenger to work properly?

Thanks for your support,

Regards


#7

On 09 Oct 2008, at 05:36, Hassan S. wrote:

way you want – so why don’t you turn off this “cpanel” thing, which
sounds like total crap, and edit your conf files as needed?

I just installed passenger/mod_rails on a system yesterday for the
first time, and it took about 5 minutes. It sounds like your problem
is with cpanel, not passenger.

Every control panel system has a way of adding custom configurations
to certain accounts.

For plesk, that would be by creating a new file in the /var/www/vhosts/
domain.com/conf/ directory named vhost.conf. You can add extra
directives there or override existing ones. After configuring the
file, you can just do “/usr/local/psa/admin/sbin/websrvmng –
reconfigure-vhost --vhost-name=domain.com

A simple google search brings up the following for cpanel
(http://www.cpanel.net/support/docs/ea/ea3/customdirectives.html
):
Like the main portion of httpd.conf, the VirtualHost containers also
provide the ability to add customizations using Include files. At this
time there is no graphical interface for creating and managing
VirtualHost includes, so they must be manipulated manually. The
include directory structure is not created automatically, but uses the
following file structure:
• Individual VirtualHost
/usr/local/apache/conf/userdata/(ssl|std)/(1|2)
///.conf

cPanel/WHM and Plesk are tools to make it easier on your end-user to
manage their accounts. You as a server admin however should know
everything about it: where it puts it files, which built-in services
it uses and how it uses them, … Frankly, if you order cPanel or
Plesk because you don’t have a clue on how to configure a server
yourself, you’re better off looking for a managed dedicated server
hosting and let those people handle it for you instead.

Best regards

Peter De Berdt


#8

On Wed, Oct 8, 2008 at 11:09 PM, fRAnKEnSTEin removed_email_address@domain.invalid
wrote:

Well i mean that i have full root access to all accounts on the
server. And that i can install, delete, update etc in any way i want
to. Only my apps are installed and running , i have all the power over
the server, this is what i mean with “dedicated server”

Good, then you should be able to kill this cpanel thing if it’s causing
you problems, eh? :slight_smile:

I already installed passenger on my MAC, and it works, but that is
obius, because my MAC:

2- As a local machine, is a testing eviroment, so it does not have any
high securiity, firewalls, special users and all that stuff that a
real production server has and that usually make things harder to
install and configure

Nonsense. If anything I find desktop systems more problematic to
install stuff on because they typically lack developer libraries, etc.

OK, so this morning, on my own (RHEL, RackSpace) dedicated
server I’ve:

  1. compiled and installed ruby

  2. installed rubygems

  3. gem install rails

  4. compiled and installed apache httpd 2.2.9

  5. gem install passenger

  6. run the passenger install program

  7. pasted the appropriate LoadModule yadda yadda statements into
    httpd.conf

    I had one initial problem, with not explicitly specifying the
    location
    of apr:

-bash-2.05b$ ./bin/apachectl -t
httpd: Syntax error on line 71 of
/usr/local/apache-httpd-2.2.9/conf/httpd.conf: API module structure
‘passenger_module’ in file
/usr/local/ruby-1.8.6/lib/ruby/gems/1.8/gems/passenger-2.0.3/ext/apache2/mod_passenger.so
is garbled - expected signature 41503232 but saw 41503230 - perhaps
this is not an Apache module DSO, or was compiled for a different
Apache version?
-bash-2.05b$ export
APR_CONFIG=/usr/local/apache-httpd-2.2.9/bin/apr-1-config
-bash-2.05b$ sudo passenger-install-apache2-module

 :: but once past that, it just works.

HTH,

Hassan S. ------------------------ removed_email_address@domain.invalid


#9

Hi Hassan,

Thank you for your reply and help. Ok. Gonna check again my
installation, maybe i did somehting wrong. So i am going to check
again to see if i have better luck!. I will let you know what
happenned.

Regards


#10

Hi Mr Hassan,

In my dedicated server i’ve: (obiusly RoR and mongrel already
installed & running fine):

1- gem install passenger
2- passenger-install-apache2-module

here i got 3 errors:

a- “Apache 2 development headers were not detected by the script.”
To fixed this i just create a symbolic link as follows: /usr/sbin/
apxs’ to '/usr/local/apache/bin/apxs

b- “error: Compiling and installing Apache 2 module…cd /usr/lib/ruby/
gems/1.8/gems/passenger-2.0.3 rake clean apache2…”
I fixed this by: yum install apr-devel

c- “/usr/local/apache/include/apr_file_info.h:200: error: ‘apr_ino_t’
does not name a type …”
i fixed this by: export APR_CONFIG=/usr/local/apache/bin/apr-1-config

After fixing that 3 errors i re-run the installer by:
passenger-install-apache2-module
and installation was successfull.

3- i edited my http.conf file located at: pico /usr/local/apache/conf/
httpd.conf
4- i added the lines and save, so my httpd.conf file look like:



LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/
passenger-2.0.3/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.0.3
PassengerRuby /usr/bin/ruby

<VirtualHost 69.73.160.174:80 *>
ServerName www.mydomain.com
DocumentRoot /home/user/public_html/railsapp/public

5-then i restart apeche by using:
/etc/init.d/httpd restart

6- I opened a browser and put the same url a puted in the httpd.conf
file, this is:
http://www.mydomain.com

at this point i should see my “railsapp” rails application, but what i
see is my normal web root.

Do i have any misconfiguration/error/ something???

Regards,

Mohammed


#11

Hi Mr Peter De Bredt,

Frankly, if you order cPanel or Plesk because you don’t have a clue on how to configure a server yourself

I have not ordered cpanel, in fact i have not buyed the dedicated
server. But yes, i am not an Senior Server Administrator. in fact i am
not using cpanel for nothing i always use ssh terminal. When i talked
about cpanel is because my hosting solutions told me that they does
not recommend that i modify the http.conf manually from a ssh terminal
because the cpanel overwrite every change that i made manually, so i
was asking for some other ideas about the issue.

A simple google search brings up the following for cpanel

Yes i did a lot of simples googling an found a lot of ways to install
the thing, any of it does not followed the way that passenger
documentation explains( some other do), some need sttuf/configuration
like you finded at:
http://www.cpanel.net/support/docs/ea/ea3/customdirectives.html
some others tells me that i have to follow this:
http://bobcares.com/index.php/blog/?p=174
the passenger screencast/documentation explains other way…
www.peepcode.com screencast about passenger installation explains a
whole different way to make the thing work on a shared hosting
solution
so that means that it is not as simple as copy-paste in a real
production server, thas way i am asking for help/ideas/comments on how
to installed on a “dedicated/shared/dedicated managed server
solution”, just to know-learn and help others

So,

  1. does anybody installed pasenger over a dedicated server?
  2. just with a copy-paste of the lines that the installer gives to the
    httpd.conf make passenger work?

Have a nice day.

Shirkavand


#12

On Thu, Oct 9, 2008 at 10:22 AM, fRAnKEnSTEin removed_email_address@domain.invalid
wrote:

PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.0.3
PassengerRuby /usr/bin/ruby

<VirtualHost 69.73.160.174:80 *>
ServerName www.mydomain.com
DocumentRoot /home/user/public_html/railsapp/public

It’s a good idea to use bin/apachectl -t and bin/apachectl -S to check
your config file syntax.

I didn’t bother setting up a virtual host (yet), but on my installation
I
changed both the DocumentRoot directive and the primary Directory
directive to both point to the public folder of my rails app. I believe
those need to be in sync.

Besides that, have you looked at your httpd log files?


Hassan S. ------------------------ removed_email_address@domain.invalid


#13

Hi Hassan,

It’s a good idea to use bin/apachectl -t and bin/apachectl -S to check
your config file syntax.

I’ve executed bin/apachectl -t and bin/apachectl -S both commands give
me “Syntax OK” and no errors.

on my installation I
changed both the DocumentRoot directive and the primary Directory
directive to both point to the public folder of my rails app. I believe
those need to be in sync

Well in my server i can not do this thing because i have lots of rails
apps there, so i need to access all of them via apache, so i want to
do a simple “http”//www.mydomain.com/railsapp1" or “http”//
www.mydomain.com/railsapp2" and so on…

Besides that, have you looked at your httpd log files?

yes i ave checked the error_log file located at /usr/local/apache/logs
and there are some normal errors like some required images, php etc
that does not exists, but nothing about my railsapp or this
virtualhost

If you have some free time, can you test the virtualhost configuration
over your dedicated server? to see if you get the same problem that i
do or if you not. Maybe the real problem is something about the
virtualhost…i dont know just guessing…:frowning:

regards


#14

Hi,

My apologize for this late reply, i was a little bit busy since my
last reply. Ok finally fixed out the problem. The problem was that i
pasted the “LoadModule …” lines that passenger installation gives,
at the very end of my httpd.conf file(as the tutorial etc etc saids
so), the only thing i made was pasting the lines at the top of the
httpd.conf file, and it worked just wonderfull!.

Such a strange problem, don’t you think?

Thanks for your support.

Cheers


#15

On Thu, Oct 9, 2008 at 2:45 PM, fRAnKEnSTEin removed_email_address@domain.invalid
wrote:

If you have some free time, can you test the virtualhost configuration
over your dedicated server? to see if you get the same problem that i
do or if you not. Maybe the real problem is something about the
virtualhost…i dont know just guessing…:frowning:

OK, I created 2 VirtualHost entries, this one (minus the standard
stuff – ServerName, logging, etc.):

<VirtualHost *:80>

DocumentRoot "/path/to/rails_app/public"

LoadModule passenger_module

/usr/local/ruby-1.8.6/lib/ruby/gems/1.8/gems/passenger-2.0.3/ext/apache2/mod_passenger.so
PassengerRoot
/usr/local/ruby-1.8.6/lib/ruby/gems/1.8/gems/passenger-2.0.3
PassengerRuby /usr/local/ruby-1.8.6/bin/ruby

:: plus a static VirtualHost with a different DocumentRoot.

Both vhosts worked as expected – the first forwards to my Rails app,
the second to the static instance.

Well in my server i can not do this thing because i have lots of rails
apps there, so i need to access all of them via apache, so i want to
do a simple “http”//www.mydomain.com/railsapp1" or “http”//
www.mydomain.com/railsapp2" and so on…

Well, er, mmm. That looks like a different problem. I’m not sure that
mod_rails is intended to address that use case. Not that that means
much, since I’m new to it as well, but… :slight_smile:

At the very least, your scenario looks like it would require mod_proxy
and/or mod_rewrite. The simplest configuration that strikes me – not
tested yet! – would be to set up your virtual hosts as e.g.

railsapp1.example.com
railsapp2.example.com

and then use mod_proxy to forward requests for example.com/railsapp1/
appropriately (and transparently).

HTH!

Hassan S. ------------------------ removed_email_address@domain.invalid